Trail for coding agents
A self-evolving
CLAUDE.md
Trail keeps the files your coding agent reads current. Every correction you make becomes a rule. The ones that must never break become a hook that blocks the action.
Read only. Trail proposes the changes and you approve them. Nothing is written to your repo.
- Public repo, no install
- Every rule cited
- Claude Code, Codex, Cursor
## 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 the agent can ignore becomes a hook it cannot.
Four things it gets wrong, every repo, every week.
It forgets what you told it last session.
It breaks the rule that is already written down.
It follows steps your team stopped using months ago.
It suggests the thing you already tried and dropped.
What comes back
A change you can read in ten seconds.
Trail proposes, you decide. Every change names the file, the line and the source it came from.
+ 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 for all three.
Rules that contradict each other
Trail asks you which one holds, rather than 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, is flagged for removal.
Rules that never fire
Trail tracks which rules an agent actually applies. The rest are the first to go.
One repo, many agents
Your corrections are yours. The team's decisions are the team's.
A rule reaches the shared file only when someone approves it for the team. Then every agent reads the same version.
How a rule reaches the agent
Into the file, or straight into the session.
Trail is the memory layer, not the runtime. It writes files you can read in a diff.
Pull the file
One command writes the approved changes into your working tree. You commit the diff yourself.
Or read the rules live
The same rules over MCP, so Claude Code, Codex and Cursor ask for the ones that apply to the file in front of them.
Hooks ship with the repo
A blocking rule becomes a hook in .claude/settings.json. It runs for every teammate, and in CI.
What people ask first.
Does Trail write to my repository?
No. Trail proposes changes and you approve them. The approved 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 your agent sessions, your commit history, and PR review threads. Every proposed rule carries the source it came from, 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 that 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 when a note has already 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 a Model Context Protocol server, plain REST and GraphQL. Trail is the memory layer, not the runtime, so it does not replace the coding agent you already use.
Can I try it on a repository that isn't mine?
Yes, if it is public. Point the field at any public repo and Trail reads it without writing anything back.
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.
Point it at a repo.
Read what it would change.
Nothing is written until you approve it.
Read only. Trail proposes the changes and you approve them. Nothing is written to your repo.