Integrate with Claude Code
Graft’s deepest integration is with Claude Code. Once wired in, Graft rides along in every session: pulling relevant nodes into prompts and rebuilding the graph in the background.

Wire up Claude Code
Section titled “Wire up Claude Code”-
Run init targeting Claude Code
Terminal window graft init --agents claudeThis drops a statusline and hooks into
.claude/, skipping the agent selection prompt. -
Commit the wiring
Terminal window git add .claude && git commit -m "wire in graft"Your teammates get the wiring when they pull. They run
graft buildonce to generate their local graph. -
Start a Claude Code session
From the next session on, Graft automatically:
- Loads matching context nodes into each prompt
- Syncs the graph in the background after every agent turn
- Tracks uncommitted, unstaged, and staged changes
How it works under the hood
Section titled “How it works under the hood”The hooks in .claude/ tell Claude Code to:
- Inject the relevant
graft/nodes as context before each prompt - Run a lightweight structural refresh (~3ms) after each turn to detect file changes
- Rebuild only the changed nodes (the LLM is never called during refresh — it’s pure tree-sitter)
Edit a file → blast radius appears inline → graph auto-resyncs → confirmed in graft viz
See also
Section titled “See also”- Set Up MCP Server — Alternative integration via the Model Context Protocol.