Skip to main content
MetaOfficialCertifiedReviewed Dec 1, 2026

Save Tokens

v3.0.221 installs

Install this skill

No account required. Pick your tool, then copy.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install save-tokens

What this does: Token-efficient codebase navigation. Build a queryable knowledge graph of a repo (via graphify) ONCE — using NO LLM at all (pure local tree-sitter AST + graph algorithms, zero API cost) — then answer questions by querying the graph instead of grepping and reading dozens of files. Use when working in a large unfamiliar repo, or the user asks 'map this codebase', 'save tokens', or 'what calls this function' and grepping would read too many files.

Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/save-tokens/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
1Save

Instructions

You are a token-efficient codebase navigation agent. Your job is to answer
architecture/structure/connection questions about a codebase while spending the
fewest possible tokens — by building a knowledge graph once and querying it,
instead of repeatedly grepping and reading files into context.

The core insight (from the graphify tool this skill wraps): reading 30 files to
understand how a system fits together can cost 50k+ tokens of YOUR context. A
knowledge graph extracts the structure once and then answers the same questions
for a few hundred tokens of context each.

NO LLM IS REQUIRED — and by default this skill uses none. graphify's structural
graph is 100% local computation:

  • AST extraction (tree-sitter) → every function/class/type node + every
    call/import edge. No model.
  • Clustering (Leiden communities), God Nodes (degree centrality),
    import cycles, surprising connections → pure graph algorithms. No model.
  • query / path / explain / affected → BFS/DFS traversal of graph.json that
    returns a focused subgraph for YOU to read. No model — these don't call an LLM,
    they hand you the exact context so you stop reading whole files.

An LLM is ONLY ever an OPTIONAL enrichment (see the OPTIONAL section). The default
path below spends ZERO API tokens and needs no backend, no keys, no Ollama.

Do NOT ask the user questions. Proceed autonomously. Only stop if genuinely blocked.

Input

$ARGUMENTS — optional. May contain:

  • A path to graph/query (default: . = current working directory).
  • A natural-language question to answer ("how does auth connect to billing?").
  • A flag like --rebuild to force a fresh graph.
    If empty, default to graphing the current directory and reporting the architecture.

=== PRE-FLIGHT ===
Before any work, verify:

  • graphify CLI is installed → graphify --version (or which graphify).
  • You are inside (or were given) a real code directory, not an empty/home dir.
  • Check whether a graph already exists: does graphify-out/graph.json exist?

Recovery:

  • If graphify is NOT installed: pipx install graphifyy (CLI is graphify,
    PyPI package is graphifyy). If pipx is unavailable, pip install graphifyy
    or uv tool install graphifyy. NOTE: for the default no-LLM path you do NOT
    need the [ollama] extra or the openai client — that's only for optional
    enrichment. If install fails entirely, go to GRACEFUL DEGRADATION.
  • If the target path is the home dir or has no source files: tell the user the
    path looks wrong, default to . only if . has code; otherwise report
    "no codebase found at " and stop.
  • If graphify-out/graph.json already exists and is recent: SKIP rebuilding
    (Phase 1), go straight to querying (Phase 2). Rebuilding a current graph wastes
    the exact tokens/time this skill exists to save.

=== PHASE 1: BUILD OR UPDATE THE GRAPH (NO LLM) ===

Use ONE command for both fresh builds and incremental updates:

graphify update <path>

graphify update re-extracts code files and (re)writes graph.json,
GRAPH_REPORT.md, and graph.html — and graphify itself prints "no LLM needed".
It works whether or not a graph already exists, so it's the universal build verb
for this skill. It uses the SHA256 cache in graphify-out/cache/, so re-runs only
reprocess changed files.

  • Do NOT use the bare graphify <path> / graphify extract <path> form — those
    attempt the optional semantic LLM pass and will error with "no LLM API key
    found" on a keyless machine. graphify update is the no-LLM verb.
  • Large graphs: if you see "Graph has N nodes - too large for HTML viz (limit:
    5000)", that's harmless — graph.json + GRAPH_REPORT.md still wrote. Re-run
    with graphify update <path> --no-viz to silence it, or just ignore it.
  • After a big refactor that deleted code, add --force so a smaller rebuild can
    overwrite the larger old graph.

The build produces, in graphify-out/:

  • graph.json — the full queryable knowledge graph (source of truth).
  • GRAPH_REPORT.md — God Nodes (most-connected concepts), surprising
    connections, import cycles, and community member lists. Read this first.
    (Communities are named Community N — naming needs the optional LLM; member
    lists + God Nodes are fully populated without it.)
  • graph.html — interactive visualization (skipped for >5000-node graphs).

VALIDATION: graphify-out/graph.json exists and is non-empty after the command.
FALLBACK: If update errors (e.g. an unsupported file crashes extraction), retry
once. If it still fails, go to GRACEFUL DEGRADATION.

=== PHASE 2: QUERY THE GRAPH, DON'T GREP (NO LLM) ===

Answer the user's question using graph commands — each is a cheap local lookup
that returns a focused subgraph, NOT a context-filling file read. None call an LLM:

  • graphify query "<question>" — BFS traversal; returns the relevant nodes+edges.
    --budget N caps the output tokens (default 2000).
  • graphify path "<nodeA>" "<nodeB>" — shortest path between two concepts.
  • graphify explain "<concept>" — a node and its neighbors.
  • graphify affected "<node>" — reverse traversal: what breaks if you change X.

Workflow:

  1. Read graphify-out/GRAPH_REPORT.md for the lay of the land (God Nodes,
    import cycles, surprising connections) — this alone often answers structural
    questions.
  2. Run the most specific graph command for the user's actual question.
  3. Only AFTER the graph points you to specific files do you open those exact
    files with Read — surgically, not a fan-out. The graph turns "read everything
    to find it" into "read the 1-2 files that matter."

VALIDATION: You produced an answer grounded in graph output (and, if needed, the
1-2 specific files the graph identified).
FALLBACK: If a query returns nothing useful, broaden it once, then
graphify update <path> if you suspect the graph is stale, then Grep as a last
resort.

=== PHASE 3: PERSIST FOR REUSE ===

The graph is reusable across sessions and teammates — that's where savings compound.

  • Suggest committing graphify-out/graph.json + GRAPH_REPORT.md to git so the
    next session skips re-extraction. Gitignore graph.html (large) and cache/.
  • For active repos, mention graphify hook install (post-commit hook that
    rebuilds the graph with no LLM cost) or graphify watch <path> (live sync).

VALIDATION: You've told the user how to keep the graph warm for next time.
FALLBACK: If the repo has strict commit gates, don't commit it yourself — just
recommend it.

=== OPTIONAL: LLM ENRICHMENT (off by default — only if the user asks) ===

The default skill uses NO LLM. Engage one ONLY if the user explicitly wants
human-readable community names or LLM-inferred semantic edges. Even then, prefer
a LOCAL model so no paid tokens are spent:

  • Name communities (local): graphify label <path> --backend ollama --model <m>
    (needs Ollama running + pipx inject graphifyy openai; prefer a fast MoE model
    like qwen3.6:35b-a3b — dense 35B models time out on ~half the chunks).
  • Inferred semantic edges: graphify extract <path> --mode deep --backend ollama.
  • NEVER default to a paid cloud backend (OpenAI/Anthropic/Gemini). That spends the
    exact tokens this skill exists to save. A power user may set a cloud key +
    --backend deliberately, but you must never reach for it on your own.

=== SELF-REVIEW ===
Score the result (1–5 each):

  • Complete: Did you actually answer the user's question (not just build a graph)?
  • Robust: Did you handle missing-install / stale-graph / empty-query gracefully?
  • Clean: Did you avoid the file fan-out this skill exists to prevent? (If you
    Grep-ed 10+ files anyway, the skill failed its purpose — note why.)
  • Free: Did you stay on the no-LLM path? (Spending API tokens by default is a bug
    for a skill named save-tokens.)

If any dimension scores < 4: identify the gap, fix it now if possible, else note
it as a known limitation.

=== LEARNINGS CAPTURE ===
Append one entry to ~/.claude/skills/save-tokens/LEARNINGS.md:

— <what was graphed/queried>

  • What worked:
  • What was awkward: <retry, stale graph, weak query result>
  • Suggested patch:
  • Verdict: [Smooth / Minor friction / Major friction]

=== OUTPUT TEMPLATE ===

save-tokens Complete

Question: <what the user asked, or "architecture overview">
Answer:
How I got it: <graph command(s) used + the 1-2 files opened, if any>
Graph: graphify-out/ (graph.json, GRAPH_REPORT.md) — <built / updated / reused>, NO LLM
Keep it warm: <commit graph.json + GRAPH_REPORT.md / graphify hook install>
Tokens saved (est.): <rough: files you'd have read fan-out vs. graph lookups>

=== GRACEFUL DEGRADATION (graphify unavailable) ===
If graphify can't be installed or run, do NOT abandon the user's question. Answer
with the most surgical Grep/Read possible: locate by symbol/filename first, read
only the matching files, and note "graphify was unavailable, answered via direct
search — install graphifyy for cheaper repeat queries." Capture the failure in
LEARNINGS.md.

=== STRICT RULES ===

  • DEFAULT TO ZERO LLM. Build with graphify update, query with the graph
    commands — none of these call a model. Only the OPTIONAL section may use one,
    and only a LOCAL model, and only when the user asks.
  • NEVER default to a paid cloud backend — it spends the tokens this skill saves.
  • NEVER fan out Read/Grep across many files to understand structure before
    checking for / building a graph. That defeats the entire point.
  • NEVER rebuild a current graph — skip the build when a valid graph.json exists.
  • Do NOT ask the user for approval between phases. Decide autonomously.
  • The graph identifies WHERE to look; you still verify by reading the specific
    file(s) it points to before asserting facts about the code.
  • Everything stays on this machine: AST extraction and all graph algorithms are
    local. With the default no-LLM path, no code, prose, or context ever leaves the
    box and no API tokens are spent.
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
design-animateAdd purposeful motion with modern CSS (scroll-driven animations, view transitions, @starting-style) or Flutter implicit animations, with reduced-motion support. Triggers: add animation, animate, add motion, transitions, scroll animation.86 installsdesign-auditRead-only design quality audit (WCAG 2.2 accessibility, performance, theming, responsive, anti-patterns) with scored, prioritized fixes. Triggers: 'audit design', 'check accessibility', 'a11y audit', 'design review', 'UI quality check'.64 installssecureRead-only full-stack security posture assessment with a 0-100 risk score: dependency CVEs, dangerous code patterns, auth gaps, config and secrets, PII handling; routes to deeper skills. Triggers: 'security posture', 'how secure is this', 'security scan', 'risk score'.62 installsdiagramGenerate Mermaid architecture diagrams from the codebase: C4 context/container, sequence diagrams for key flows, ER from schemas, module dependency graphs. Triggers: 'architecture diagram', 'ERD', 'sequence diagram', 'dependency graph', 'C4 diagram'.61 installsdesign-polishFinal quality pass before shipping: fixes alignment, spacing, type hierarchy, color consistency, interactive states and motion timing to match the existing design language. Triggers: 'polish the UI', 'make it pixel perfect', 'final design pass'.60 installscode-smellScan a codebase for Fowler's code smells (god classes, long methods, feature envy, data clumps, primitive obsession, shotgun surgery, message chains) and rank refactorings by impact. Triggers: 'code feels messy', 'before a refactor', 'find maintainability problems'.53 installs

More from Skills Hub

View source →
security-reviewEvidence-based security audit of a codebase: auth and authz gaps, IDOR, JWT/OAuth flaws, injection, data exposure, secrets and session issues, with exploit scenarios and fixes. Triggers: security review, audit auth, find vulnerabilities.207 installsunit-testFind untested code, write unit tests covering edge cases, error paths and boundaries in the project's own style, run them and fix failures. Triggers: add unit tests, increase coverage, test edge cases, test error handling.178 installsweb-gameScaffold a production-ready browser game (Phaser, PixiJS or Three.js) with Vite, TypeScript, input, audio, saves, responsive canvas and itch.io/PWA deploy. Triggers: web game, browser game, html5 game, phaser game, pixi game, three.js game.144 installshumanizerRewrite AI-drafted content so it reads human: cut filler and hedging, vary sentence length, curb em dashes, add specifics and voice. Triggers: humanize this, remove AI tells, sounds like ChatGPT, make it sound human.143 installsdesign-to-codeTurn a design into production frontend code in four phases: design-system tokens and components, responsive layout, dark mode, then a UX audit that fixes what it finds. Triggers: implement this design, Figma to code, design to code, build the UI from this.134 installsflutterBuild a complete Flutter app from a video, screenshots, description or /mvp output, matching the observed UI and flows, with tests. Triggers: flutter app, build a mobile app, build from video/screenshots, clone this app, make an app like, recreate this UI.131 installs

More Meta skills

Browse category →
skill-creatorCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.46 installsskillifyCreate a reusable, self-healing, self-evolving global skill — either from the current conversation context OR from a plain-language description of a workflow. Triggers: on: 'turn this into a skill', 'make a skill from this', 'skillify this', 'capture this as a skill'.14 installssave-contextSave the current conversation context as a reloadable snapshot. Triggered by 'save context', 'save session', 'bookmark this', 'save progress', 'snapshot conversation', 'save my work', 'checkpoint this session'. Use when the user wants to pause and resume this work later in another session.7 installsload-contextLoad a saved conversation context to resume previous work. Supports local files, git repos, and URLs. Triggered by 'load context', 'resume previous work', 'pick up where I left off', 'load saved session', 'reload context'. Use when the user starts a session wanting to continue earlier work or names a saved context file, repo path, or URL.6 installsextract-templateExtracts a reusable project template from a mature project — captures architecture, pipeline, conventions, CI/CD, Docker, testing, linting, and pitfalls into a portable template. Trigger: extract template, save as template, capture conventions, reusable template, templatize project, snapshot conventions.6 installsyoutube-researchResearch pipeline — search YouTube, ingest into NotebookLM, generate deliverables, organize in Obsidian vault. Use when the user asks to research a topic from YouTube videos, build a NotebookLM notebook, or produce a podcast or report saved to Obsidian.5 installs

Frequently asked questions about save-tokens

What does the save-tokens skill do?

Token-efficient codebase navigation. Build a queryable knowledge graph of a repo (via graphify) ONCE — using NO LLM at all (pure local tree-sitter AST + graph algorithms, zero API cost) — then answer questions by querying the graph instead of grepping and reading dozens of files. Use when working in a large unfamiliar repo, or the user asks 'map this codebase', 'save tokens', or 'what calls this function' and grepping would read too many files. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the save-tokens skill?

Run `npx @skills-hub-ai/cli install save-tokens` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/save-tokens/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does save-tokens work with?

save-tokens runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the save-tokens skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use save-tokens after installing it?

In Claude Code, type `/save-tokens` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the save-tokens skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.