Skip to content
Unofficial community docs. Content pulled on 2026-10-24 from Trail-Code@d205ac3. For the latest, see the official repo.

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.

  1. Install the CLI, once

    Terminal window
    npm install -g @trailhq/trail-code
  2. Initialize in your repo

    Terminal window
    trail init

    trail init asks 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-run to see the agent wiring it would write, or trail init --agents claude to wire Claude Code alone.

  3. Commit the setup

    Commit the setup so your teammates get it too. The graft map itself, in graft/, is a local cache like node_modules and 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.

  4. Work the way you always do

    That is the whole setup. No daemon, no server, nothing to babysit: it is all files.