TRAIL Labs has one engineer. The products are built with AI coding agents working in parallel, most days without me watching each step. That only works if three questions have written answers: where does an agent get its facts, what may it decide alone, and what stops it when it is about to repeat a known mistake. The harness is those answers.
- RoleDesigned and maintain the whole setup: canon, protocols, agent roles, hooks, scripts
- Runs onClaude Code, git worktrees, shell hooks, Markdown documents under version control
- Used forEvery product on this portfolio that carries the TRAIL Labs name
- PrincipleA rule that keeps being broken in a prompt is moved into a mechanism where one can enforce it
The shape

A request goes to a front-door agent. It works out which project the request belongs to, sorts it into company writing, project work or something cross-cutting, and hands it on with a brief. Project work goes to that project’s lead, who splits it among specialists. Each specialist works in its own copy of the repository. I get one report at the end.
Four things sit underneath, and each one is its own page.
- The canon is where company facts live. Agents query it before they write a sentence about the company, and the query itself says whether the fact may be used in public.
- The autonomy protocol says what an agent decides without asking, which is almost everything, and names the three kinds of action it must never take alone.
- The worktree flow gives every task an isolated copy of the code and a progress document that is committed with it, so the task can be picked up on another machine.
- Hooks are checks that run before an agent’s tool call. They exist for the mistakes that kept happening after the rule was written down.
Why it is built this way
An agent does not remember yesterday. It reads what is in front of it, and it reads confidently. Left alone it will write a plausible number for a company fact, edit the file whose path it was given even when that file is in the wrong copy of the repository, and stage every changed file with one command.
None of that is fixed by asking nicely. The first answer to each problem was a sentence in a prompt. The sentence worked most of the time, and the remaining failures were the expensive ones. So the pattern across this project is the same every time: write the rule, watch it fail, and then move it somewhere an agent cannot skip, such as a lookup command, a filter, a script or a hook.
The other half is restraint. An agent that stops to ask about every choice is slower than doing the work by hand. The protocol therefore lists what does not need a person, in more detail than what does, and one tool that agents used for asking is denied outright.
Reading order
- ProtocolDispatch from the front door to specialists, what agents decide alone, the stop lines, and how much review a change gets.
- A canon that answers "may I say this in public?"One concept per file, trust computed when a fact is read, and a verdict printed with every lookup.
- Worktrees and a progress document that travels with the branchFive steps per task, and why the plan is committed and pushed in the first commit.
- Hooks: when a prompt could not stop itTwo checks that run before a tool call, the conditions they test and the incidents behind them.
- Rules written after incidentsSeven failures and the rule each one left behind, sorted by how strongly the rule is enforced.
Results in three lines
- Every TRAIL Labs product on this portfolio was built by one engineer with this setup, including a paid service that went live within three months of incorporation.
- A task started on one machine can be continued on another from its branch alone, because the plan and its state are in the first commit.
- The two mistakes that agents repeated most, editing the main tree and staging everything in a worktree, are now refused before they happen.
What it does not do
It does not make agents right. It makes a specific list of wrong actions impossible or visible, and it leaves a person at the three points where a wrong action cannot be taken back. Review of what the agents wrote is still my work, and so are the design decisions on every other page of this portfolio.
