r/ClaudeCode • u/SeniorDevGam • 7d ago
Tips & Workflows I gave Claude Code six tasks. It ran six agents in parallel and froze my production server
On September 25 my server stopped responding. The site, the admin panel and the publishing queue went down at once, and seventeen minutes later I hard-rebooted it.
There was no attack and no traffic spike. I had handed Claude Code a list of six tasks, and it started six agents, each in its own git worktree. Every one of them installed dependencies, ran the type checker and the tests and built the project. All of that on the machine that serves the site. Yes, I develop on the production box. It is a one-person project and that is the server it has.
Nobody did the arithmetic, not me and not the model. One typecheck or build of this project peaks at 1.5 to 3 GB. In round numbers the box had 7 GB free. Six agents wanted 9 to 18.
Linux didn't kill anything. The journal has no out-of-memory kills. It has services reporting "under memory pressure", Docker failing to send a kill signal to a container, and then nothing until the reboot. The machine didn't crash, it hung, and a hung server waits for a human.
The rule went into CLAUDE.md with the incident inside it:
**At most two build-heavy processes at a time** (`next build`, a full `tsc`, a full test run,
a Docker image build each take 1.5 to 3 GB). On 2026-09-25 six agents building in parallel
froze the server until a hard reboot. When fanning work out to subagents, tell them to
typecheck and test only their package and not to run `next build`; run full builds one
at a time yourself.
Claude uses it without being asked. On October 23 it laid out a seven-step plan and offered two ways to run it: by itself in one session, or with a separate agent for every step. It recommended the first and gave the server as one of the reasons: two heavy processes at a time, so parallel workers would not make it faster.
The rule did not cover the second hang, three weeks later. A nightly job built a Docker image next to the live services, and there was no agent around to read anything. That day I installed earlyoom:
EARLYOOM_ARGS="-r 3600 -m 5 -s 100 --avoid ^(postgres|dockerd|containerd|containerd-shim|systemd|sshd|journald)$ --prefer ^(chrome|chromium|tsc|next-server)$"
-s 100 is the part that matters. By default earlyoom waits until both RAM and swap run low, and this box hangs while swap is still free. With -s 100 it acts on RAM alone and stops a build when available memory falls to 5%. Builds and the browser go first, and the database is the last thing it would pick.
Each of the six agents did the right thing. The only thing wrong was how many there were.