Why you'd want it
trail init parses your repo with tree-sitter into a map of files, functions and who calls what, with no model or API key, and refreshes it when the code changes. It registers an MCP server with six tools (trail_find_code, trail_file_api, trail_trace_calls, trail_find_all, trail_repo_map, trail_check_freshness), and in Claude Code adds hooks that put matching files into each prompt and show what depends on a file after an edit. Agents can also save decisions as markdown learnings in .trail/learnings/, committed with the code, and trail check compares a branch diff against them.
Best for
- Giving agents a call graph of a large repo
- Blast-radius checks after edits
- Sharing team decisions through git
Use it when
You want Claude Code, Cursor, Codex or another MCP agent to find the right code and see what depends on it without repeated grepping. It also fits teams that want agent-saved decisions kept in the repo and checked before a PR.
Skip it if
trail init writes hooks, a statusline and MCP entries, and by default also edits user-level files such as ~/.claude/settings.json and ~/.codex/config.toml (skip with --no-global). It reads your past Claude Code sessions and, when gh is signed in, review comments on the last 50 merged PRs to seed learnings, and it sends anonymous usage stats unless you run trail telemetry disable; the optional trail build --deep calls the model provider you choose with your own key. The README marks the team workspace, skills and guardrails as coming soon, and the repo is about three months old.
Editor's note
Formerly graft; the old package @nanonets/graft and the graft command still work. No GitHub releases are published; the package is on npm.