Codex makes your PC lag? Find which part is busy.
There are two different problems behind "Codex slows my whole PC", and they have
different fixes. One is Codex itself using the CPU. The other is what Codex starts for
you: cargo build, npm test,
pytest, each taking every core it can find, and a sub-agent
doing the same beside it. A minute in Task Manager tells you which one you have.
Keel is free for two agents. Every install starts with 14 days of Pro. No account.
Or from a terminal:
See what is using the CPU.
Open Task Manager (Ctrl+Shift+Esc), Activity Monitor or top,
sort by CPU, and read the first ten rows while the PC lags.
- Compilers, test runners, a column of
nodeorpython.rustc,cc1plus,go, pytest's workers: that is the work Codex started, and what the rest of this page is about. codexitself, busy while it only waits for a command or an answer. That is a fault in that version, not load, and nothing on this page fixes it: update Codex, and report it to OpenAI with the version.codexprocesses left over after the session ended, still holding a core. People have reported these. End them, and update.- Memory full and the disk busy. The PC is out of RAM and swapping. No priority fixes that: run fewer sessions and sub-agents, or close what holds the memory.
- Antimalware Service Executable near the top (Windows). Defender is reading every file the build writes. On Windows 11, a Dev Drive is Microsoft's answer to that.
The free fixes.
Tell Codex to use fewer cores. Put the line in AGENTS.md and
every session reads it:
Each sub-agent can start a build of its own. Codex's config,
~/.codex/config.toml, has a limit for how many run at once:
Or start the heavy work at low priority, so it waits for everything else:
What it costs: a cap holds when the PC is idle too, so every build is slower, always.
nice treats a dev server the same as a test run. And the agent has to
remember it, in every project and every session.
The same thing, per process, and only when the PC is busy.
Keel is a small app in the tray. It knows which processes Codex started, from the process tree and from the marks Codex puts in the shells it runs commands in, and it gives each one a lane:
- Tests, builds and compilers wait for your apps. The busier the PC, the further back they go.
- Servers Codex started, a dev server or a database, stay quick: something is waiting on them.
- Codex itself is never lowered. It's what you talk to.
- A build you start yourself goes ahead of the agents' work.
- Anything no agent started is left alone.
With CPUs to spare, a lowered build runs as fast as before: a lower priority only matters when something else wants the CPU. Work that waits three seconds without running gets its priority back for five, so nothing starves. Quit Keel and every priority is put back as it was. How it decides
110 ms to start a command, not 1,335.
On one machine (i7-11700K, 16 threads, Windows 10), with more spinning tests than CPUs on top of the agents already running, a new command took 110 ms to start with Keel steering and 1,335 ms without. A thread that asked to wake was 3.6 ms late at worst instead of 21.7 (99th percentile).
The cost is the other side of the same trade: the steered work got 21% to 56% less done while the PC was overloaded. It yields, and that is the point. Your own CPU work got no faster. The receipt, and how to run it yourself
When Keel won't help.
- The busy process is Codex itself. Keel never lowers an agent, only the work it starts. That one is OpenAI's to fix.
- The PC is out of memory. On Windows Keel lowers the memory priority of quieted work, which is no substitute for RAM.
- You want the builds to finish sooner. Under load Keel makes the agents' work slower, never faster. It trades their time for yours.
- The slow part is the answer. That is the network and the model, not your PC.
- You're on macOS and want every lever. macOS has one, background mode, so work is either left alone or put in the background. What each system can do
Free for two agents.
Keel steers the work of your two oldest agents for free, for good. Pro steers every agent's work and keeps CPUs for you: $39 once, no subscription. Every install starts with 14 days of Pro, and there is no account.
Running several at once? Several agents on one PC: do the sum