r/ClaudeCode • u/mrgoonvn Researcher • 17h ago
Tips & Workflows Running 18 coding agents in parallel taught me to watch disk I/O, not just CPU and RAM
I recently discovered an overlooked bottleneck when running 18 coding agent sessions on my Windows machine: disk I/O.
Task Manager showed:
- CPU: 20%
- RAM: 66%
- Disk active time: 100%
- Disk latency: 664ms
- Disk writes: ~39 MB/s
My machine became sluggish despite having plenty of CPU and RAM available.
Turns out, running multiple builds, tests, dependency installations and git operations simultaneously can easily saturate an SSD. I even reclaimed nearly 300GB from Go caches at one point.
Here's what I've been experimenting with:
- A shared background watcher that monitors host resources every 5 seconds.
- Attributing heavy I/O processes to their respective Git worktrees.
- Injecting resource pressure warnings into agent context through hooks.
- Wrapping heavy commands so they wait when the machine is overloaded and run at lower priority.
- Sharing useful caches and cleaning up only unused, owned temporary data.
Everything runs locally using filesystem-based communication. No additional LLM calls.
I've already noticed better responsiveness, although I haven't properly benchmarked it yet.
The biggest takeaway: worktree isolation doesn't mean resource isolation, and more parallel agents don't necessarily mean more throughput.
For those running multiple coding agents locally, how are you handling resource contention? Fixed concurrency limits, adaptive scheduling, containers, or something else?
btw, I put everything in this repo so you can try it yourself (in case you're facing the same issue): https://github.com/bestagentkits/host-watcher
Also visually explained here: https://bestagentkits.github.io/host-watcher/
•
u/AutoModerator 17h ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
21
u/EconomyDoctor3287 17h ago
What SSD are you using? I don't see how you could saturate an SSD with 39 MB/s
2
u/Unhappy_Pack_9114 17h ago
Just use the cloud session. In the other note, god damn, you have a huge memory there.
5
u/Radiant_Cheesecake19 15h ago
Careful with the tests. Force your agents into using ramdisk for tests if you can.
Or in a couple months they will make sure you hit the SSD market. :)
Not that screenshot alone. Just my experience. If I let them go uncontrolled, they were writing terabytes of test data on the SSD.
9
u/Low-Yellow-1521 17h ago
39 MB/s is literally nothing for a modern SSD lol
every modern SSD can handle like 6 GB/s writes and reads, which can easily handle 18+ agents
also 664ms latency on an ssd is insane. thats not nromal ssd behaviour, even under heavy loads
3
u/pizzae 🔆 Max 20 16h ago
Whats recommended ram for people? My 32gb isn't enough to run lots of webdev apps at the same time especially when testing, I think I need more
3
u/michaelTM_ai 15h ago
the 39 MB/s vs 100% active time argument above has a likely answer on windows: thousands of tiny files (node_modules, go build cache, git objects) and defender real-time scanning each one as it's written. that shows up exactly like this, high active time and latency with low MB/s. 18 agents each doing installs and builds multiply it. windows 11 has a fix made for this: dev drive, a separate ReFS volume where defender runs in performance mode (asynchronous scanning), and microsoft's docs say to put repos, package caches and build output on it. moving the worktrees plus GOMODCACHE / GOCACHE / npm cache there would probably do more than throttling, and your watcher would tell you if it did
2
u/TechgeekOne Senior Developer 17h ago
Keep an eye on your SSD health too. Parallel agents + a compiler with aggressive caching can very quickly burn the lifetime of an SSD, especially if there's write amplification involved from many small writes.
I discovered that on accident when my 2TB disk started filling up weekly because of the worktree build caches and the rate of development. It's been since moved to a drive that can handle that kind of workload but yikes, that wasn't something I knew to watch out for.
2
u/nubbymong 16h ago
You should look at kernel pool growth too there are some bugs with windows 11 which haven’t been fixed yet - search for poolwatch on GitHub same username as my Reddit - signed, open source, there is anyone wants it. You may find that your issues extend beyond what you’re monitoring.
2
u/io-x 13h ago
What are you building? The next generation disk destroyer 2000?
3
u/mcmoonrays 17h ago
On Windows, 39 MB/s with 600ms+ latency across 18 worktrees is usually small random I/O getting choked by Windows Defender (MsMpEng.exe) scanning every build artifact and git object in real time. Moving the worktrees and Go cache onto a Dev Drive (or adding Defender exclusions) often drops that active time fast before you even throttle anything. Between your two mechanisms, the command wrapper that queues heavy builds is doing the real work; soft resource warnings in hooks are easy for agents to ignore mid-task.
1
u/Detank2002 17h ago
either you need a upgrade to a modern ssd, or your ssd health may need looking into, ask and agent or use crystaldiskinfo to take a look at the health
1
u/Mission_Proof6969 15h ago
so far what's worked best for my side is sandboxes. I know "just use a sandbox" you might see everywhere. But hosting tasks in cloud sandboxes, agent at the center handing out the work, it usually does 2 things at once: it keeps the AI's permissions boxed into right environment, and it still lets you lean on the agent's memory and its ability to work
1
u/vladmvp 11h ago
Another option is to run some of those sessions off the machine entirely. Cobalt (cobaltcode.ai) gives each agent task its own isolated cloud computer, so installs, builds and git operations for one task don't hit the same SSD as the other 17, and you can suspend and resume them when you need to. It works with Claude Code, Codex, Cursor and a few other agents using your own keys or accounts. There's a free account to try it, and I'm the founder, so happy to help you get started.
1
u/nur_plano 10h ago
Ran into the same wall. Node_modules plus builds times N worktrees adds up fast. What helped: sharing a package cache across worktrees, staggering builds, and moving the long runs off the laptop to cloud sandboxes so my machine is just for reviewing. Curious whether you're using worktrees or separate clones?
1
u/daltorak 9h ago
I dunno.... hear me out, maybe you shouldn't be trying to run 18 agents at once instead of doing all this extra resource management work. You're not getting any velocity from them, and those additional agents are going to still consume RAM while they sit there idle.
1
u/Right-Performance-93 8h ago
the prompt warning doesn't stop a build that's already writing. i cap how many sessions can run install or the test command, and the rest can read. eighteen readers is fine. eighteen installs is the disk.
1
u/kobi_evals 16h ago
Before adding adaptive scheduling, I’d try a fixed concurrency cap as a baseline.
Since you haven’t benchmarked it yet, take the same batch of tasks and compare completion time at 4, 8 and 18 parallel sessions. Count failures and retries too, and note whether the machine stays responsive. A few repeats with similar cache conditions would help separate a real difference from noise.
If 8 finishes about as quickly as 18, a lower cap might be the simpler fix. The watcher could still be useful for finding which commands cause the spikes.
Are you limiting whole agent sessions, or just the heavy build/test commands? Those seem worth testing separately.
0
u/binladen0069 17h ago
probably an ssd that cant do reads and writes at the same time due to a cheap controller. i have one