codegraph
Original:🇺🇸 English
Translated
Pre-indexed code knowledge graph (MCP, SQLite + tree-sitter) for faster, lower-token exploration of brownfield codebases. Use when starting work on a repo larger than ~500 files or when the task involves cross-file traversal — "where is X used", "what calls Y", "what breaks if I change Z", "trace flow from A to B", "explain this subsystem". Skip for single-file edits or sessions shorter than the cold-start cost. Triggers include "codegraph", "code graph", "index this repo", "where is X defined", "find callers of", "callees of", "blast radius of changing X", "explore this codebase". Replaces grep + Read loops with O(1) SQLite lookups and FTS5 search via 8 MCP tools.
16installs
Sourceonsager-ai/dev-skills
Added on
NPX Install
npx skill4agent add onsager-ai/dev-skills codegraphTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →codegraph
Local code graph exposed as 8 MCP tools. Replaces grep + Read loops for exploration with O(1) SQLite lookups and FTS5 search.
When to use
- Brownfield repo where structure is non-obvious
- Task involves: "where is X used", "what breaks if I change Y", "trace flow from A to B"
- Long-running session — cold-start cost amortizes over multiple queries
When NOT to use
- Single-file edits or trivial lookups
- Session likely shorter than cold-start cost (see for per-repo numbers)
references/spike.md - Repo not initialized AND no cached AND short session
.codegraph/
Prerequisites
- Node 18+ on PATH
- Project has (run
.codegraph/if not)codegraph init - For cloud sessions: cold-start cost verified via for the target repo
references/spike.md
Files
- — installation for local / Claude Code Cloud / devcontainer
references/install.md - — which of the 8 MCP tools to use when, with main-session vs subagent rules
references/usage.md - — cold-start measurement protocol; run once per new target repo before relying on codegraph in cloud sessions
references/spike.md
Known integration targets
Cold-start measured locally (Node 22, 4 cores). Cloud cold-start still pending — re-run in a cloud session before relying on these numbers there.
references/spike.md| Repo | Indexed files | Nodes / edges | DB size | Cold init+index | Query wall |
|---|---|---|---|---|---|
| onsager-ai/onsager | 578 (rust + tsx/ts) | 8.6k / 20k | 24 MB | 12s | ~0.9s |
| crawlab-team/crawlab | 644 (go) | 6.8k / 15k | 11 MB | 6s | ~0.9s |
| codervisor/leanspec | 695 (tsx/rust/ts) | 8.9k / 21k | 23 MB | 10s | ~0.9s |
Per-query wall is dominated by Node startup — the SQLite work itself is milliseconds. End-to-end cold-start including one-shot is ~13–19s for repos in this size class.
npx install