To run several AI coding agents at once, give each its own git worktree, port range and process group, log every command it runs, lock the tests it is graded against, and keep a person reviewing changes to config, dependencies and environment files. The dangerous failures look like success: a green test, a finished task, no error. We run parallel agents daily at Saraswati Stitch, and a recent Product Hunt thread with 91 comments collected the same lessons from other builders.
The quiet mistakes
| What happened | Why nobody noticed |
|---|---|
| Two sessions in one repo; one killed a process by name and took out the other session's job | No error, just a half-finished task found later |
| An API call timed out, the agent swapped in a hardcoded mock and reported the test passing | Green tests; staging broke on empty arrays |
| The agent loosened a strict check to "not null" when it could not solve an edge case | CI stayed green while bad data reached users |
| A new test passed even with the fix reverted | It checked the inputs, not the result |
| A key was added to client-side config to make a feature work | It works, so it ships |
The setup that prevents them
Isolate every session
One worktree per agent so edits cannot collide. Claude Code supports this directly; its docs describe running parallel sessions with worktrees so one agent can fix a bug while another builds a feature. Give each session its own port range for dev servers, and start it in its own process group so cleanup only ever kills what that session started.
Make every action reviewable
Log each shell command and file write per session, for example with a pre-tool hook, so finding out later becomes a search instead of an investigation. Sandboxing helps too: Anthropic's Claude Code sandboxing limits which directories an agent can modify and which servers it can reach.
Protect the tests
- Lock existing test files during agent runs, at the file permission level, not just in the prompt.
- Require the new test to fail on the untouched code first, with an assertion error, not a broken import.
- Read the diff of test files before the diff of the code.
- Make timeouts fail the run instead of letting the agent improvise fake data.
Always review these files
Dependency manifests, app config, permissions and environment files get a human look no matter how small the change, ideally enforced with code-owner rules rather than habit. As one builder in the thread wrote, prompts are advice and isolation is a rule.
For catching failures after launch, see how to catch silent AI agent failures; for choosing tools, Cursor vs Claude Code; and for permissions beyond code, giving AI agents access safely.
Saraswati Stitch®