Explore code
Skill grahambrooks/gb-agent-skills/plugins/code-intelligence/skills/explore-code
Claude Code Plugins
npx -y skills add grahambrooks/gb-agent-skills --skill explore-codeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use symgraph MCP tools to explore, understand, and safely refactor code. Use whenever you need to locate a symbol, find who calls or references something, trace call paths, assess the blast radius of an edit, find dead code or interface implementations, or build focused context for a coding task. Prefer this over grep/find/ripgrep and over reading whole files when the target is a symbol or a relationship between symbols.
SKILL.md
8.5 KB, as published. Nobody here has run it
You have access to symgraph, a semantic code-intelligence MCP server that holds a resolved knowledge graph of the codebase (symbols, calls, references, contains, imports, implements, extends). Use it to answer: $ARGUMENTS
Reach for symgraph first — not grep
When the thing you're after is a symbol (function, method, class, struct, trait, enum, field) or a relationship between symbols (who calls it, what it references, what breaks if it changes), symgraph is the right tool and grep is the wrong one. Make symgraph your default first move and only fall back to text search when the rules below say to.
Why this is faster and cheaper, not just tidier:
- Fewer tokens.
symgraph-referencesreturns the exact resolved usage sites. Grep returns every textual hit — comments, strings, unrelated same-named symbols, vendored copies — and you pay tokens to read and filter the noise, then often pay again to open files for context. - Precision, not string-matching. symgraph distinguishes a definition from a call from an import, resolves overloads/shadowing, and won't match
userinsideusernameor inside a docstring. Grep can't tell a real caller from a coincidental substring. - Relationships grep can't express. "Who calls this?", "what's the call path from A to B?", "what breaks if I change this?", "which structs implement this trait?" are single symgraph calls and multi-round grep archaeology.
If you catch yourself about to grep for a function/type/method name, or about to read a whole file to find one definition, stop and use the mapping below instead.
grep/find habit → symgraph tool
| If you'd reach for… | Use instead |
|---|---|
grep -r "fn foo" / "where is foo defined?" | symgraph-search → symgraph-definition |
grep -rn "foo(" to find callers | symgraph-callers |
grep -rn "foo" to find every usage | symgraph-references (resolved: calls + imports + type uses) |
| reading a file top-to-bottom to see one symbol's body | symgraph-definition |
| reading a file to list what's in it | symgraph-file |
| grepping for a method to see what it touches | symgraph-callees |
| grepping a class name to find subclasses/impls | symgraph-implementations |
| grepping an interface/enum to find match/dispatch sites | symgraph-dispatch-sites |
git log -S / git blame on a symbol | symgraph-blame |
| "which files change most / are riskiest?" | symgraph-churn |
When grep/find/Read is still the right tool
symgraph indexes code symbols, so use Grep/Glob/Read for things that aren't symbols or relationships:
- Free-text inside strings, log messages, error text, TODO/FIXME comments.
- Config and data files (JSON/YAML/TOML/
.env), docs, build files, generated output. - Locating files by path/name pattern (
Glob). - Reading the surrounding lines (constants, imports, comment blocks) after symgraph has pointed you at the right symbol — see Strategy step 5.
Tool cheat sheet
| Question | Tool |
|---|---|
"Where is X defined?" / "find symbols matching name" | symgraph-search → symgraph-definition |
"Show me the source of X" | symgraph-definition |
"Who calls X?" | symgraph-callers |
"What does X call?" | symgraph-callees |
"All usages of X" (calls + non-call references) | symgraph-references |
"How does control/data flow from A to B?" | symgraph-path |
"If I change X, what breaks?" | symgraph-impact |
"What would changing lines N–M of file.rs affect?" | symgraph-diff-impact |
"What symbols live in file.rs?" | symgraph-file |
"All implementations of trait/interface T" | symgraph-implementations |
"Where is enum E matched/dispatched on?" | symgraph-dispatch-sites |
| "Class/module parent–child relationships" | symgraph-hierarchy |
| "Find dead code" | symgraph-unused |
"Who last changed X and when?" | symgraph-blame |
| "Which files/areas are high-churn (bug-prone)?" | symgraph-churn |
| "Module dependencies, fan-in/out, cycles" | symgraph-module-graph |
| "Where are the worst coupling hotspots?" | symgraph-coupling-score |
| "Which structs are overgrown hubs / arch debt?" | symgraph-god-struct |
| "Build broad context for a task" | symgraph-context |
| "Detailed info on one symbol" | symgraph-node |
Refactoring playbooks
Before editing a symbol, map its blast radius with symgraph rather than grepping for occurrences — you'll get the complete, resolved set and miss nothing.
- Rename / change a signature:
symgraph-references(andsymgraph-callers) to enumerate every site that must change →symgraph-impactto gauge blast radius → edit. Re-runsymgraph-reindexafter, thensymgraph-referencesagain to confirm nothing dangling. - Delete code safely:
symgraph-unusedto confirm zero references, orsymgraph-referenceson the specific symbol. Empty result ⇒ safe to remove. - Replace an enum match with polymorphism (or vice versa):
symgraph-dispatch-sitesto find every match site so the refactor is exhaustive. - Swap or extract a module:
symgraph-module-graphfor the dependency edges and cycles,symgraph-coupling-score/symgraph-god-structto spot what's tangled,symgraph-impacton the boundary symbols before cutting. - Decide where to harden: cross-reference
symgraph-churn(volatility) withsymgraph-impact(coupling) — high-churn × high-impact symbols are the riskiest to touch.
Coupling/module tools rely on field, import, and dispatch edges, so run symgraph-reindex after edits before trusting them again.
Strategy
- Start narrow. For a specific question,
symgraph-search→symgraph-definition. Reservesymgraph-contextfor open-ended "help me understand this area" tasks. - Disambiguate first. If
symgraph-searchreturns several matches, pick the right one (from context or by asking) before pulling callers/callees/impact. - Follow chains step by step with
callers/callees; for "how is A connected to B" usesymgraph-pathdirectly instead of guessing. - Always show source. When explaining behavior, fetch the real code with
symgraph-definitionand quote the relevant lines — don't paraphrase from names. - Combine with Read for surrounding context only. symgraph returns symbol-scoped excerpts; if you need nearby constants, imports, or comments, follow up with
Readon the file/line symgraph gave you — don't re-discover the location by grepping. - For impact analysis, use
symgraph-diff-impactwhen you have a line range,symgraph-impactwhen you have a symbol name.
Index hygiene
- A project must be indexed before symgraph can answer. The plugin's SessionStart hook kicks off a first-time index via
bx grahambrooks/symgraph index. - If
symgraph-statusreports 0 nodes, orsymgraph-searchreturns nothing for symbols you know exist, the index is missing/unfinished — tell the user to runbx grahambrooks/symgraph indexin the project root (progress is logged toindex.logbeside the index, e.g.<git-common-dir>/symgraph/index.log). - After edits, run
symgraph-reindex(incremental, fast). This is required before re-trustingreferences,impact, and the coupling/module tools. Full re-index only when structure changed dramatically.
Gives 0 of the 12 instructions most refactoring skills give
Counted across 521 of the 525 authors here whose files we hold, read 2026-08-06
- run tests after each changein 59 of 521, across 56 files
- write tests before refactoringin 27 of 521, across 24 files
- preserve external behaviorin 26 of 521, across 22 files
- remove dead codein 25 of 521, across 24 files
- make small incremental changesin 20 of 521, across 17 files
- break the implementation into tiny commitsin 18 of 521, across 5 files
- ask the user about alternative optionsin 17 of 521, across 4 files
- create a GitHub issue with the planin 17 of 521, across 4 files
- explore the repository to verify assertionsin 17 of 521, across 4 files
- interview the user about the refactorin 16 of 521, across 3 files
- check the codebase for test coveragein 16 of 521, across 3 files
- refactor one thing at a timein 16 of 521, across 12 files
Said here and by no other author read
- use symgraph tools first for symbols and relationships
- fall back to grep only for non-symbol text
- search then fetch definitions for specific questions
- disambiguate search results before pulling relationships
- follow call chains step by step
- use path queries directly instead of guessing connections
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.