Trail for coding agents
Stop repeating yourself
to your coding agent.
Trail reads your commits and PR history, then proposes rules for CLAUDE.md. The ones that must never break become a hook instead of a note.
Paste it into Claude Code. Nothing is written until you approve it.
- One prompt, no dashboard
- Every rule cited
- Nothing lands without approval
## Commands
+Use pnpm. npm install rewrites the lockfile.
hook3 corrections in your sessions
You say it every session. Trail says it once.
Today
- MondayUse pnpm, not npm.
- TuesdayUse pnpm, not npm.
- WednesdayUse pnpm, not npm.
- ThursdayUse pnpm, not npm.
Trail writes it down
CLAUDE.md
## Commands
+Use pnpm. npm install rewrites the lockfile.
from 3 corrections
- Tuesday
- Wednesday
- Thursday
And when it must not break
$ npm install
Blocked before it ran
.claude/settings.json, your rule on line 3
A note it can ignore becomes a hook it cannot.
Four things it gets wrong, every repo, every week.
Forgets what you said last session.
Breaks a rule that is already written down.
Follows steps your team dropped months ago.
Suggests the thing you already tried.
What comes back
Rules pulled from your commits and PR history.
Every change names where it came from. You decide.
+ Use pnpm. This repo has no package-lock.json and npm install will rewrite the lockfile.Blocks npm install before it runs, and prints the rule instead.
A note has already failed here three times, so this one blocks the command instead.
Upkeep
A long file is not a well-kept one.
Rules rot in three ways. Trail watches all three.
Rules that contradict each other
Trail asks which one holds, instead of letting the agent pick whichever it read last.
Rules nothing matches any more
A path that no longer exists, or a library you migrated off, gets flagged.
Rules that never fire
Trail tracks which rules an agent applies. The rest go first.
How a rule reaches the agent
Into the file, or straight into the session.
Trail writes files you can read in a diff.
Pull the file
One command writes approved changes into your working tree. You commit the diff.
Or read the rules live
The same rules over MCP, so Claude Code, Codex and Cursor ask for the ones that apply.
Hooks ship with the repo
A blocking rule becomes a hook in .claude/settings.json. It runs for everyone, and in CI.
What people ask first.
Does Trail write to my repository?
No. Trail proposes, you approve. The text reaches your working tree when you run graft claude-md pull, and you commit it yourself.
What does Trail read to propose a rule?
The corrections you make in agent sessions, your commit history, and PR review threads. Every proposed rule carries its source, so you can check it before approving.
What is the difference between a note and a hook?
A note is a line in CLAUDE.md or AGENTS.md the agent reads as context. A hook is a command in .claude/settings.json that blocks an action before it happens. Trail proposes a hook once a note has been written and broken.
Does this work with agents other than Claude Code?
Yes. Trail writes AGENTS.md as well as CLAUDE.md, and serves the same rules over MCP, REST and GraphQL. It is the memory layer, not the runtime, so it does not replace the agent you already use.
Is my personal file separate from the team's?
Yes. Your own corrections stay in your file. A rule reaches the shared file only when someone approves it for the team, and then every agent reads the same version.
Copy one prompt.
Read what it would change.
Nothing is written until you approve it.
Paste it into Claude Code. Nothing is written until you approve it.