Skip to content

CLI reference ​

All commands are subcommands of tokengraph (or python tokengraph_all.py). Add --help to any command for its full flags. Run against the current repo, or point elsewhere with the global --path PATH.

Retrieval ​

CommandPurpose
context "task" -b 6000Token-budgeted context pack for a task
ask "task"Focused pack + intent / coverage / risk / cost metadata
semantic "query" -n 10Find symbols by meaning (embeddings)
federated "task" --root ../a --root ../bRetrieve across multiple repos, merged
diff-contextBudgeted pack for exactly what the git diff touches

Graph navigation ​

CommandPurpose
modulesToken-count table of top-level dirs — call first
archWhole-repo overview: modules, hubs, cycles, languages, routes
explain FILESignatures + imports + external callers for a file
skeleton FILEEvery signature in a file, no bodies
summary FILECompact module summary
callers / callees QNAMETrace the call graph (full symbol source: MCP get_symbol)
impact QNAMEBlast radius: callers / subclasses / tests
method-impact QNAMEFunction-level: who breaks / deps / overrides / call sites
test-map [TARGET]Map implementations ↔ tests (+ coverage %)
lines FILE 40 80Surgical line range (secret-scanned, sandboxed)
map imports|hierarchy|routes|hubsProject graph views

map routes covers Flask/FastAPI, Django URLconfs, Express, NestJS, Rails, Spring, Go and Next.js-style file-based endpoints, including declarations split across several lines. Each route carries the handler symbol it belongs to — taken from the decorated function, the handler named in the call, or the enclosing one — which is the link between an app's HTTP surface and its call graph. Where no handler can be identified honestly (a Django route declared inside urlpatterns), the field is simply absent rather than guessed.

Trust gates ​

CommandPurpose
validate "task" --min-coverage 60Coverage gate (percent, default 60); exit 1 if insufficient
judge --answer-file A --context-file CScore if an answer is grounded (0–100%)
verify --answer-file AFlag fabricated files / symbols; exit 1 if any
groundingQuantify the guard: fabrications caught vs real refs flagged

Grounded generation ​

CommandPurpose
conventionsDetect naming / layout / test / export style + conformance
scaffold NAME --kind module --applyPropose (or write) a convention-matched file
verify-planCheck a plan's file/symbol refs + blast radius before acting
verify-outputAudit AI-generated code for fabricated files / symbols / imports
reviewAudit the working/staged diff for scope drift, hub edits, missing tests
create "task" --applyOrchestrate scaffold → plan → verify-output → review

Cost, savings & optimization ​

CommandPurpose
costEstimate USD of an API call before sending it
prompt-scoreScore a prompt's clarity / specificity / context / action
summarize-chatCompress a long transcript into a token-cheap brief
dedupeRemove near-duplicate context blocks
squeezeShrink a pasted stacktrace / CI log / JSON blob
measure "task" / reportToken savings for a task / aggregated
gainRealized savings from the ledger (tokens + $), dashboards
statusOne-line repo snapshot (branch / index / savings)

Setup & operations ​

CommandPurpose
indexBuild / rebuild the graph (MCP tool: reindex)
serveRun the MCP server (stdio or HTTP)
ide-setupWire the MCP server + rules (default: Claude Code + VS Code/Copilot; --all for every editor)
ide-pluginScaffold installable VS Code / Neovim / JetBrains plugins
langsList parseable languages by extraction tier
evidenceDeterministic, hash-grounded evidence pack (audit/CI)
hallucinationMulti-repo, reproducible grounding benchmark
doctor / healthDiagnose the install / index

See also ​

Released under the terms in the repository LICENSE.