/codegraph:using-codegraphfrom codegraph
Use when navigating code in a repo with a .codegraph/ index — orienting in an unfamiliar area, locating a symbol, tracing callers or the blast radius of a change, picking which tests to run, or judging a codegraph_context injection — and before any multi-file Grep/Read sweep.
Ships in codegraph. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
codegraph --help lists the commands. This skill is the routing knowledge the help can't carry: which tool wins for which question, and the places the output is quietly load-bearing. Everything here also applies to the MCP tools (codegraph_explore, codegraph_node) — same output, different transport.
Stop at the first rung that answers the question:
rg. Grep wins on exact strings; use it without ceremony.codegraph query "<name>" to locate it, codegraph node <symbol> for its source plus caller/callee trail. Fuzzy, so a half-remembered name is enough.codegraph explore "<terms>". One call returns the relevant symbols' verbatim source, call paths, and blast radius. This replaces the search → read → read → read loop, and replaces it only if you let it (see below).codegraph impact <symbol>; callers/callees for one direction only.git diff --name-only | codegraph affected --stdin -q pipes straight into a test runner.A multi-file Grep/Read sweep is the signal you skipped a rung: name the question, re-enter the ladder.
Any directory holding .codegraph/ is queryable, wherever your session started: every command takes -p <path> (codegraph explore -p /path/to/repo "<terms>"). When a task points at another repo, check for its .codegraph/ before concluding the graph doesn't apply — the index belongs to the target repo, not to your working directory.
explore accepts multiple terms — codegraph explore "parser tokenizer lexer" is one round-trip; three separate explores are three. Batch the names you already know you need.
explore and node print verbatim, line-numbered, on-disk source — the output says so. Treat each block as a Read you have already performed and go straight to editing or answering. Re-Reading those files is the single move that erases the tool's entire token advantage.
Repos with the MCP hook inject a codegraph_context block naming symbols that match the prompt. The match is keyword, not intent — a prompt containing "build" will surface every build_* symbol in the index. Treat the block as a hint: when the named symbols are plausibly what the task touches, one fat explore on them is the cheapest possible start; when they're lexical coincidence, enter the ladder as if the block weren't there.
codegraph sync, then re-run the query. After large git operations (rebase, checkout of an old branch), sync first.codegraph status when results look wrong; codegraph unlock when indexing is blocked by a stale lock..codegraph/ directory: proceed with grep — the ladder's rung 1 covers everything, just at higher token cost — and suggest codegraph init to the user once. Degraded results beat a blocked task.query, impact, affected take -j/--json; affected -q emits bare file paths. Prefer these when the output feeds a script rather than your own reasoning.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub lioralabs/claude-plugins --plugin codegraph