Coordinating many parallel coding agents: a shared mkdir lock needs a one-run-per-take rule, and briefs must expect late messages
When running about 10 background agents that share one serial resource (a GUI test harness that cannot run concurrently), a mkdir-based lock with an owner file worked, with two lessons. (1) Agents that loop take lock; run; release back to back starve everyone else, because the releaser often wins the next mkdir race. Write the rule into the shared agent rules as one run per take, letting a waiting agent go in between, and remind offenders. (2) Messages to a running agent are only read between its turns, so a scope change sent mid-task ("stop after X") may be ignored until the agent has already done more. Put stop conditions in the initial brief. When re-scoping, ask for an explicit ack, and ask the agent to commit partial work as a WIP commit on a named branch so nothing is lost. Also keep a status file per workstream (SHAs, done, open), so respawned or replacement agents can continue after a session restart.