Code graph
The graph stores every symbol in your code and how they connect. Parsing is local and costs no tokens.
Build it
claude-db scan
claude-db scan --forceA scan takes about a second on a mid-size repository. Re-running only re-parses files that changed. --force re-parses everything.
The four modes
Ask the same question four ways, over MCP as find_usages or in the terminal as claude-db usages:
| Mode | Answers |
|---|---|
usages (default) | What uses the symbol, with the relation on each line. |
explain | That, plus what the symbol itself reaches. |
path | How two symbols connect. |
text | Live git grep only. Needs no scan. |
claude-db usages --mode explain closeObservations
claude-db usages --mode path cmdScan observationIdusages and explain also list who imports the symbol. Lines that git grep finds but the graph cannot link come last, so nothing a search would find is lost.
Confidence on every edge
EXTRACTED means the link was read straight from the syntax tree, so nothing is guessed. INFERRED means it was matched by name across files, and it carries a score. Name matching is the only guess the graph makes, and it is always labelled.
Never stale
Every graph query checks the working tree first and re-parses what changed, so an answer never points at a line that has moved.
Languages
- Parsed: TypeScript, TSX, JavaScript, Python, Go, Rust, Java, Kotlin and Ruby. These get real syntax: definitions,
calls,imports,extendsandimplements. The grammars ship with the package, so nothing compiles or downloads. On a platform without them, such as Alpine Linux, these languages are read by pattern. - Imports followed: all of these except Ruby, through path aliases, re-exports and workspace packages, so two symbols with one name in different modules stay apart.
- Method calls followed: Java and Kotlin.
x.method()reaches the method of the declared type ofx, through parent classes and chained calls. - Read by pattern: about 30 more, including C, C++, C#, Swift, PHP and SQL. Declarations are found by pattern and every edge is tagged
INFERRED. A reference that matches no declaration produces no edge, not a guess.