Search & orient
Once you’ve run graft init, you have a graft/ directory full of linked Markdown nodes describing your codebase. This tutorial shows you how to explore and orient yourself.
Explore the graph
Section titled “Explore the graph”-
View the codebase map
Terminal window graft mapgraft mapis a token-budgeted first look at a repo — directory clusters with file/symbol counts, each dir’s local hubs, and the global hotspots — all ranked by in-degree, no LLM, no key:repo map — 113 files · 687 symbols · 2186 edges · typescriptsrc/ 63 files · 527 symbols hubs: contextDirFor (node-file.ts, 21←), wiringPath (write.ts, 14←)test/ 43 files · 102 symbols hubs: edge (graph-traverse.test.ts, 4←) -
Search the graph
Terminal window graft grep "authentication"graft grepis exhaustive over every indexed file and groups hits by enclosing symbol, ranked by the same in-edge couplinggraft mapuses:"NEEDLE" — 2 hits in 2 symbols across 1 files (searched 1 indexed files)heavilyCalled · function · src/a.ts:L1-L3 · 3 in-edgesL2: console.log("NEEDLE hit in heavilyCalled"); -
Trace call sites
Terminal window graft callers MyFunctionFind out who calls, references, imports, implements, or extends a symbol.
-
Check graph health
Terminal window graft checkVerifies if the
graft/directory has drifted from the code (never auto-refreshes — it’s the drift report). -
Visualize the graph
Terminal window graft vizServes an interactive viewer on localhost so you can visually explore the nodes and dependencies.
Understand the graft/ directory
Section titled “Understand the graft/ directory”The generated graph lives in graft/ and consists of:
- Markdown node files (
graft/*.md) — One per subsystem or concept, with typed wikilinks between them. - Wiring graph (
graft/.graph/wiring.json) — Per-symbol code graph built by tree-sitter. - Per-file wiring cards — Mirror your source tree with structural information.