code-graph
Skill77 starsChanged 5 days agoMITView on GitHub
Structure questions - who calls/launches a symbol, where it is defined, what a change reaches, is it dead, path from API to kernel, blast radius, what depends on a header. Not free-text search (`rg`), not opening a known path.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- aishwaryajayanth1820-git/code_graph_agentic_observable_codingtheir own version, first seen Oct 11, 2026
- FalkorDB/code-graphtheir own version, first seen Oct 8, 2026
- alinaqi/claude-bootstraptheir own version, first seen Oct 8, 2026
- handsontable/handsontabletheir own version, first seen Oct 8, 2026
- Manav1011/mcp-and-skillstheir own version, first seen Oct 8, 2026
- aniruddha-adhikary/skillstheir own version, first seen Aug 16, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- handsontable/handsontable★ 22ksame name
- alinaqi/maggy★ 711same name
- alinaqi/claude-bootstrap★ 708same name
- FalkorDB/code-graph★ 350same name
- aniruddha-adhikary/skills★ 7same name
- aishwaryajayanth1820-git/code_graph_agentic_observable_coding★ 1same name
- valarpirai/code-graph★ 1same name
- kekzl/cplusplus-cuda-graph★ 0same name
- Manav1011/mcp-and-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- add-model-archSkill
- benchmark-cudaSkill
- building-and-testingSkill
- check-degenerationSkill
- codebase-auditSkill
- docs-layersSkill
- docs-syncSkill
- find-stubsSkill
- numerics-bisectSkill
- quant-formatsSkill
- server-apiSkill
- shipping-prsSkill
- sm120-cuda-expertSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
codegraph node <file>prints the file, not its dependents: Use the SQL above. - Very specific: line 57
No preprocessor (macro-generated functions absent, template instantiations collapse to the primary), no runtime (which try_* dispatch …
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
code-graph - ask the index, then verify
imp has a symbol and call graph in .codegraph/codegraph.db (CodeGraph v1.5.0, codegraph on PATH). It answers reverse and scope-resolving questions a text search cannot: which function calls a symbol, who reaches it transitively, what a header change touches.
Hard rules
| # | Rule | Evidence |
| 0 | codegraph sync before you trust it; it does NOT sync itself and codegraph status prints "up to date" on a stale DB | 2026-08-19: 16 days / 236 commits behind, empty answer for every symbol added in that window; sync cost 2.8 s (279 files). 2026-09-02: DB dated 2026-08-21, codegraph query gdn_scan_chunkpar = "No results" |
| 1 | Control symbol before believing a negative | run the same query on a live symbol (codegraph callers write_kv_cache -> 2); if the control is empty too, the DB or the edge kind is missing (docs/audit/SETTLED.md, "control symbol") |
| 2 | Reverse question -> graph; text question -> rg | "who calls / what breaks" ~30 tokens via the graph vs 500-2500 via rg + reading; "which files mention X" is grep territory |
| 3 | The name in the answer must be the name you asked | trap 1 below |
| 4 | Kernel-launch and destructor questions are rg questions right now | the DB has edge kinds calls contains extends imports instantiates references and NO launches edges (checked 2026-09-02); ccg enrich, which materialises them, aborts with sqlite3.IntegrityError: UNIQUE constraint failed: idx_edges_identity (docs/audit/DEBT_LEDGER_2026_08_21.md). Every __global__ kernel reads as uncalled |
Commands
codegraph sync # first
codegraph query <name> # where is it
codegraph callers <symbol> # who calls it
codegraph callees <symbol> # what it calls
codegraph node <symbol> # source + immediate callers/callees (on a FILE arg: prints the file, NOT dependents)
codegraph impact <symbol> # what a change reaches
codegraph explore "<topic>" # symbols + call paths in one shotccg = ~/github.com/kekzl/cplusplus-cuda-graph/ccg: ccg enrich (CUDA launch edges + implicit destructor calls + macro-generated symbols; BROKEN, rule 4), ccg coverage (one-level: a kernel with a dead launcher still counts as covered), ccg kernels, ccg revert.
Header dependents (SQL only)
docker run --rm -v "$PWD/.codegraph:/db:ro" python:3.12-slim python -c "
import sqlite3; c = sqlite3.connect('file:/db/codegraph.db?immutable=1', uri=True)
for (p,) in c.execute(\"select n.file_path from edges e join nodes n on n.id=e.source \"
\"where e.target='file:src/runtime/config.h' and e.kind='imports'\"): print(p)"Re-derive the count every time (config.h importers: 48 -> 23 -> 32 -> 28 across four measurements as src/core/dispatch_policy.h and src/core/config/*.h split the surface).
Three traps, all confirmed on this repo
- A symbol the graph lacks is answered as if it had it.
gemv_q6k_q8_1is token-pasted (IMP_DP4A_QUANT_TYPES(IMP_DEFINE_GEMV_DP4A),src/compute/gemm_dp4a.cu); the query returneddispatch_gemv_fp32(caller of the DIFFERENTgemv_q6k_q8_1_fp32) with no nearest-match warning. Enrich materialised those 21 symbols once (gemv_q6k_q8_1->dispatch_dp4a_gemv,src/exec/executor_kernels.cu); any other macro level or generated header misleads the same way. Name mismatch = stop andrg. - "No callers found" != dead. With enrich, 99% of 423 kernels (468 by 2026-08-27) had a launcher; 74% without; the rest are reached through function-pointer struct fields. Real reachability = BFS over
calls/references/instantiatesfrom roots intools/,tests/,src/api/. Never re-flag:src/exec/gemm_kernel_*.cu(registry table binding),src/core/logging.cpp(IMP_LOG_*),src/memory/alloc_interpose.cpp(default-OFF flag),src/quant/turboquant_fp4.cuh(device inline), destructors. Confirm withrg -n '\bname\b' src/ tools/ tests/ include/(the residue after that grep found the two dead kernels removed in #1220). codegraph node <file>prints the file, not its dependents. Use the SQL above.
Destructors
Implicit destructor calls exist only through ccg enrich (85% of ~65-71 destructors had a caller with it, 0% without). With enrich broken, codegraph callers "~PinnedBuffer" returns nothing; rg for holders instead. Destruction through a base pointer is never covered (~HostPinnedAllocator, ~HostRegistrar show no caller and are live).
What it cannot know
No preprocessor (macro-generated functions absent, template instantiations collapse to the primary), no runtime (which try_* dispatch candidate fires: src/compute/dispatch_paths.h lists candidates, src/compute/dispatch_record.h records what ran).
Pairs with codebase-audit (verify before acting) and sm120-cuda-expert (once you know the kernel).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

