Integrate with Claude Code
Claude Code gets the deepest setup: hooks, statusline, and learnings with every prompt.
Wire up Claude Code
Section titled “Wire up Claude Code”-
Run init for Claude Code
Terminal window trail init --agents claudeClaude Code is pre-selected in the regular
trail initpicker too.--agents claudewires Claude Code alone, with no prompt. -
Commit the setup
Terminal window git add .claude .mcp.json .trail .gitignore .ignore && git commit -m "set up Trail-code"trail initwrites the MCP server into the project’s.mcp.json. Restart Claude Code to load it. -
Start a Claude Code session
From then on, any Claude Code session opened in the repo gets the features below.
What a session gets
Section titled “What a session gets”- A live statusline: the graft map’s size, how many learnings the repo has, and a
⚠ N stalewarning when the code has moved ahead of the map. - Auto-sync: every query brings the graph up to date first, so an answer always describes the code as it is right now, uncommitted edits included. A query refreshes only what it reads; the markdown under
graft/is refreshed by the background rebuild at the end of a turn that touched code. Both are structural and$0; auto-sync never calls the LLM on its own. - Context on tap: each prompt pulls in the matching nodes and the learnings left on that code; editing a file surfaces what depends on it (“blast radius”); new sessions start with the repo map and how many learnings there are.
- Learnings when you ask: say “save this as a learning” and Claude saves one; it never asks to on its own.
- Overlap with teammates: at session start, and every few minutes, it reads what teammates’ open branches change, skipping any already merged or closed; when Claude edits a function or constant one of them also changes, it reads their change and tells you whether the two clash.

edit a file → blast radius appears inline → graph auto-resyncs → confirmed in the viewer
Teammates without Trail-code installed
Section titled “Teammates without Trail-code installed”trail init writes its own skill file, .claude/skills/trail/SKILL.md, and never touches your CLAUDE.md. The committed skill file is also how a teammate without Trail-code installed gets your learnings: it tells their agent where .trail/learnings/ is, to read it before exploring, and to tell them once how to install the rest.
Keep your own settings and statusline
Section titled “Keep your own settings and statusline”trail init is idempotent and never clobbers your existing .claude/settings.json: it merges its blocks and leaves the rest alone. A statusLine that is not Trail-code’s is left untouched; re-running init refreshes Trail-code’s own helper command if it is already installed.
Pass --no-statusline (or set GRAFT_NO_STATUSLINE=1) to skip installing one at all, since a project-level statusLine would otherwise hide a custom one in ~/.claude/settings.json.
Add LLM summaries
Section titled “Add LLM summaries”Want the LLM summaries too? Run trail build --deep (with a key) whenever you like; auto-sync will never do it for you. See Enable deep mode.
See also
Section titled “See also”- Agent wiring reference: the hooks and files written for Claude Code, including those outside the repo.
- Set up the MCP server