ClaudeMap

Trail Code

The self-learning context layer for coding agents: a local code map (formerly the Graft map) plus a learnings layer — vendor-reported 46% fewer tool calls, 42% fewer uncached tokens.

Plugins & Agentscode maplearningscontextcliopen source

Trail Code (the map was formerly Graft; earlier releases shipped as @nanonets/graft) gives Claude Code, Cursor, Codex and other coding agents a map of your code plus what your team has learned about it. The code map is a local index of every function and its callers, so the agent goes straight to the right files and sees what a change can break; the learnings layer captures what you, your agents and your team decided, seeded by a one-time read of the repo's past Claude Code sessions. `trail init` asks which agents to wire up, builds the map, creates .trail/ and adds a statusline and hooks to Claude Code. Vendor-reported numbers over 162 runs: 46% fewer tool calls, 42% fewer uncached input tokens, 60% less time, and 33 of 50 SWE-bench Verified issues solved versus cold Claude Code's 27. No daemon, no server — it is all files. MIT; telemetry anonymous with opt-out.

What it does

  • Code map (previously the graft map): a local index of every function and who calls it — the agent goes straight to the right files and sees what a change can break
  • Learnings: what you, your agents and your team have learned and decided, so the agent picks up where you left off; seeded once from past Claude Code sessions in the repo
  • One-command wiring: `trail init` asks which coding agents to connect, builds the map, creates .trail/ and adds a statusline and hooks to Claude Code
  • Vendor-reported benchmark over 162 runs: 46% fewer tool calls, 42% fewer uncached input tokens, 60% less time; 33 of 50 SWE-bench Verified issues solved vs 27 cold
  • No daemon and no server — the map and learnings are plain files; ships as the @trailhq/trail-code npm CLI

When to use it

For teams tired of re-explaining the codebase each session: the map takes the agent straight to the right files, and learnings let it pick up where you and your team left off. Also fits agents-heavy workflows where the same corrections keep being re-discovered instead of persisting.

Getting started

npm install -g @trailhq/trail-code   # install the CLI, once; Node 22.3+ (20.16 works too)
trail init                            # in your repo: builds the graft map, sets up .trail/, wires your agents

Things to know

Performance numbers are vendor-reported — validate on your own repo. `trail init` reads your repo's past Claude Code sessions once (your own Claude Code does the reading, about a minute) and writes .trail/, a statusline and hooks — review before committing. If `npm install -g` fails with EACCES, the README documents a user-level npm prefix fix. Telemetry is anonymous with an opt-out documented in TELEMETRY.md. MIT.

Repository

trailhq/Trail-Code

Charted

Related on the map

  • clawd-conduit

    Plugin / Agent

    Wire all 15 Claude Code hook events into the Clawd on Desk desktop pet — and turn permission requests into a blocking desktop card.

    • hooks
    • desktop
    • notifications
    • claude-code
  • CometixCode

    Plugin / Agent

    An unofficial Rust 1:1 reimplementation of the Claude Code terminal UI, ported file-for-file onto an iocraft TUI framework.

    • terminal-ui
    • rust
    • reimplementation
    • unofficial
  • Abide

    Plugin / Agent

    Hook-level enforcement for the natural-language rules in AGENTS.md and CLAUDE.md — every edit is judged and violations are repaired in the same turn.

    • hooks
    • code-review
    • rules
    • agents-md