Skip to content

Claude Code slowing your computer? Check your parallel test runs

When a computer that runs coding agents turns slow, there are two usual suspects. A quick check tells them apart, and each has a different fix.

On this page

Two different causes

A coding agent such as Claude Code is mostly a program waiting for answers. On its own it should use little CPU when it is not working. A slow computer usually comes from one of two places:

  • The tool's own process. It uses CPU while it should be idle, or its memory keeps growing over a long session. That is a problem in the tool.
  • The commands the agents start. Each agent runs its own test suite, type check or build. With two, three or more agents, those heavy commands overlap and the machine runs out of CPU and memory.

The second cause is easy to miss, because each agent only sees its own run. It also has a side effect: tests that pass alone time out under load, and an agent may then change code that was never broken.

Check what is busy

1. Compare the load with your cores

The load average is roughly how many processes want a core. Compare the first number (the last minute) with your core count:

macOS
uptimesysctl -n hw.ncpu
Linux
uptimenproc

A load far above the core count means more work is waiting than the machine can run.

2. See which processes use it

Open Activity Monitor on macOS and sort by CPU or memory, or use top:

macOS
top -o cpu
Linux
top

3. Count the test and build processes

List the processes with their CPU share and memory, and look for test runners and build tools:

Shell
ps -Ao pid,pcpu,rss,command | grep -E "vitest|jest|playwright|node --test|tsc|webpack|next build" | grep -v grep

Several suites or builds from different folders at once is the pile-up. One agent process near the top of the list while nothing else runs is the tool itself.

If the tool itself is busy

Restart the session to see whether it comes back, update to the tool's latest version, and report it in the tool's own issue tracker with what you saw: CPU and memory over time, and what the agent was doing. A queue cannot fix a process that is busy on its own.

If heavy commands pile up

Give the heavy commands one line to wait in. DeployOnTime's machine queue lets at most 2 run at once by default, and starts the next one only when the computer has room: free memory, free disk, a CPU that is not already busy, and charge when on battery.

Shell
npm install -g deployontimedotime-queue setup --write   # in each project the agents work in

setup adds one instruction to the project's agent files (AGENTS.md, CLAUDE.md), so the agents start their heavy commands like this:

Shell
dotime-queue run --label "shop-api: unit tests" -- npm test

A single test file or a lint of a few files finishes quickly and does not need the queue. Agents that speak MCP can use the MCP server instead.

Only commands started through the queue are queued. A plain npm test an agent runs directly is not held, so the instruction in the agent files matters.

See it working

status shows the taken slots, each running job with its time left, the jobs waiting and whether the gate is open:

Shell
dotime-queue status
slots: 2 of 2 taken, 1 waitingrunning "shop-api: unit tests": pid 48712, kind test, 4 min so far, limit 30 min, 26 min leftrunning "docs-site: build": pid 48713, kind build, 2 min so far, limit 12 min, 10 min leftwaiting 1 "mobile-app: e2e": pid 49511, 1 min so fargate: shut; no free slot: 2 of 2 taken, by "shop-api: unit tests" and "docs-site: build"

dotime-queue history then shows, per project, how long jobs waited and which gate held them. If you schedule the optional reaper, it also reports a large test run started outside the queue: 5 or more test processes, or 2 or more that together use 2 GB of memory or more.

More on the exit codes and a gate that stays shut: troubleshooting. For several agents in separate checkouts, see git worktrees and shared CPU and RAM.