Quick start
Trail-code gives your coding agent a map of your code, and what your team has learned about it. This tutorial walks you through installing it and setting it up in a repo.
Install and initialize
Section titled “Install and initialize”-
Install the CLI, once
Terminal window npm install -g @trailhq/trail-code -
Initialize in your repo
Terminal window trail inittrail initasks which of your coding agents to wire up, builds the graft map from your code, creates.trail/for the repo’s learnings, and adds a statusline and hooks to Claude Code.It also reads your past Claude Code sessions in the repo, once, for what you told Claude more than once, and saves those as learnings. Your own Claude Code does that reading, in about a minute.
Run
trail init --dry-runto see the agent wiring it would write, ortrail init --agents claudeto wire Claude Code alone. -
Commit the setup
Commit the setup so your teammates get it too. The graft map itself, in
graft/, is a local cache likenode_modulesand is added to.gitignore, so it stays out of the commit:Terminal window git add .claude .mcp.json .trail .gitignore .ignore && git commit -m "set up Trail-code"Teammates’ Claude Code reads the learnings in
.trail/even before they install anything, and tells them once how to get the rest. -
Work the way you always do
That is the whole setup. No daemon, no server, nothing to babysit: it is all files.
Next steps
Section titled “Next steps”- Your first graph: explore the graft map from the command line.
- Your first learning: save a learning and check a change against it.