One session, one worktree.
A worktree is a second working folder for the same repo, with its own HEAD, index and files. It shares the history, so every branch is still visible. They are cheap. Make them freely.
an open operating standard
A git clone has one HEAD, one index and one set of files. Two coding agents in the same clone share all three, so they change files under each other mid-edit and fight at commit time. This is the standard we run to stop that, published in full and free to take.
why this exists
We publish the mistakes as well as the method, because the mistake is the part that teaches.
Our main checkout is not just shared, it is scheduled. Seven jobs run against it on a timer. Two of them file customer messages into the repo every hour, and both refuse to run if that checkout is on the wrong branch or holding work that is not theirs.
On 8 September 2026 a one-line fix to a document sat there uncommitted. Every hourly run after that refused, correctly, and wrote a single line to a log file. A whole day of customer messages never made it into the repo.
Nobody forgot a rule. The guard did its job. It just reported to a place nobody looks.
So we stopped writing rules people have to remember. The standard below is held up by two things you cannot ignore: something that refuses, and something you can see.
the rule
Six rules follow from that one. Everything else is ergonomics.
A worktree is a second working folder for the same repo, with its own HEAD, index and files. It shares the history, so every branch is still visible. They are cheap. Make them freely.
A guard refuses it and prints the command you actually wanted. If you see that refusal, the system is working. There is an escape hatch for the day you genuinely mean it.
A typo, a dead link. Commit it and leave the tree clean. Do not open a worktree for a one-liner, and do not leave a one-liner sitting there uncommitted. That second half is the part that broke.
Our capture daemon writes to the repo while you work, so a file you did not touch being dirty is normal. A blanket add once swept a day of customer chat into an unrelated pull request.
The stash is one stack for the whole repository, shared by every worktree. Popping takes the newest entry, which may be another session's work. Use a throwaway commit on your own branch instead.
A stale worktree is noise in tomorrow's list. If the remove command refuses because the folder is dirty, that refusal is right. Go and look. Do not force it.
what you see
Your status bar carries the state of the worktree you are in, and the state of the main checkout you are not. The second one only appears when something is wrong, because a warning that is always on is a warning nobody reads.
| Marker | What it means |
|---|---|
| ⧉ _wt-li | You are in a worktree. Safe to work. |
| no ⧉ | You are in the main checkout. Fine for reading and one-liners. |
| ⌂ main +2 | Main checkout has 2 uncommitted files. Scheduled jobs are blocked. |
| ⌂ adam/foo | Main checkout is parked on a branch. Worse. Put it back. |
| no ⌂ | Main checkout is clean. Nothing to do. |
the loop
Two commands hold the whole thing together. Make the right path the easy path, and you do not need anybody to be disciplined.
Lists every worktree you have open, with its branch and when it last moved. Checks your main checkout and says plainly if scheduled jobs are blocked. Reads your log back to you. Then opens a worktree named after today's work and puts you in it.
Commits by path, pushes, opens the pull request, and writes your log entry without asking. It used to ask. That is exactly why the log had holes on the busiest days: at the end of a session nobody chooses more work.
take it
Not a summary written for a website. This is the document our own operators are handed on day one, published as-is.
The rules, the loop, what each marker means, what the tooling costs in milliseconds, and what changes if nothing is scheduled on your machine.
Read the standard →This one is about how several agents share a repository. That one is about how the repository is written so agents can read it at all. Same idea, one layer down.
Read the spec →Free to implement, adapt and build on under CC BY 4.0. No app required, no vendor required. Attribute as: ‘Session Discipline Standard by OpsCode (https://opscode.ai), used under CC BY 4.0’.
the next step
Book 30 minutes with our team. Bring your business, and you'll leave knowing what your system would look like and which workshop fits. Prices are on each workshop page.