Systems / OPERATIONS · SINCE JULY 2026
Coding agents on one codebase, without locks
Claude Code, Codex, and Grok editing the same code at the same time, on a VPS, a GPU box, a laptop, and two DGX Sparks, without stepping on each other.
- 11
- agent seats: seven Claude, three GPT, one Grok2026-09
- 5
- machines on one private mesh, plus cloud hosts2026-09
- 235
- dated change reports written by agents since August2026-09-27
- 87
- recorded decisions that must not be silently revisited2026-09-26
- 4
- hourly memory-sync jobs keeping every seat's context current2026-09-19
- 5,242
- orphan identity slots one bug created before the fix; found, explained, fixed2026-09-19
Claude Code, Codex, and Grok edit the same repositories at the same time, across five machines, and nobody waits for a lock. A check before every write, a shared memory synced hourly, routing by cost, and a ledger for every token keep it from falling over. The two ways it failed first are written up next to the fix.
The problem
One agent is an assistant. Several agents working the same repository at once are a team, and teams need rules or they overwrite each other's work. I wanted to run coding agents from multiple vendors, on multiple machines, on the same trees, concurrently, and never wait for a lock.
What I built
Optimistic concurrency instead of locks. A tiny tool called filesafe: after reading a file you note it; before writing you check it. Exit 0 means it's unchanged, exit 3 means someone changed it under you, so you re-read and re-apply. Claude Code runs the check from a pre-write hook automatically; Codex and others call it themselves. The mutation claim, a separate short-lived flag, guards only Docker, config writes, and restarts. It has never guarded file edits. Claim last, keep it to minutes, release immediately.
A shared memory that syncs itself. Every seat reads and writes one operator-memory library, a git repository synced hourly by cron, systemd, or launchd on each host. A new agent on any machine reads README, then START-HERE, then the router, and knows what's live, what's open, and which document owns the job in front of it.
Routing by cost. The most capable model plans, consolidates, and writes the prose that has to be right. Cheaper models survey, draft, build, and monitor, in parallel. Every spawn carries an explicit model choice. This rule exists because on 2026-09-27 five agents had to be stopped and relaunched after running on the expensive model by default, and the correction is in the record with my words in it.
Ledgers. Tokens in and out per call, from the usage block, into JSONL. GPU consumers registered in one file with a row per standing lane. Nothing is estimated that can be measured.
Discipline in writing. Change reports are dated and specific. Decisions get a number and a "why," so no agent quietly re-litigates them. A memory-awareness tracker lists every known class of memory bug with its invariant and the vectors that could reintroduce it; you grep it before you touch that code.
How it’s checked
Concurrency rules fail silently, so I look for the failure. Two examples from the record: a script printed filesafe's status without gating the write on its exit code, which defeated the whole check; and identity derived from the process ID (when the agent variable was unset) created 5,242 orphan slots and always-zero exit codes until a stable id was required. Both are written up as traps, with the fix.
What happened
Since July this setup has shipped 26 sites, six books, a CAC-gated GovCloud deployment, the Spark service, and Bob's cognition wave, with three vendors' agents working simultaneously and, so far, no lost work.
Links and credits
Built withClaude Code, Codex, Grok; git; a few hundred lines of shell and Python. Directed by me.