← Back to BlogYour Mac Is Choking on a Dozen AI Agents: How to Find and Clear the Ballast

Your Mac Is Choking on a Dozen AI Agents: How to Find and Clear the Ballast

If you keep several Codex or Claude Code sessions open at once and start layering in subagents, you know the moment: the cursor thinks longer than the agent itself, the fans spin up, and the whole machine starts to crawl. This happened to one developer running an M1 Max with 64GB of RAM, not exactly a lightweight machine. If it can bog down a rig like that, laptops with less memory will hit swap even sooner.

The surprising takeaway: it wasn't the models slowing things down. The real culprit was months of accumulated clutter sitting quietly on the machine, lingering dev services, duplicate MCP servers, forgotten headless browsers, stale network extensions and VPNs, browser helper processes, autostart items, and background updaters.

What actually fixed it

The fix was simple in concept: ask your agent to map out the full process tree and walk through everything set to launch automatically. From there, clean up in batches, reboot, use the machine normally for a day, and check again.

The result was that the same multi-agent workload stopped lagging almost entirely, and it became possible to run even more sessions in parallel than before.

An audit prompt worth saving

Out of this whole exercise came a reusable audit prompt for macOS and Windows. The core principle is safety first: the initial pass only observes and changes nothing (a dry run), and every action only happens after you approve it item by item.

The logic behind the prompt works like this: capture baseline metrics using multiple readings rather than a single snapshot (CPU, memory, swap, disk, thermal throttling), build a process tree grouped by category (AI tools, development tools, background services), check every autostart source, identify major disk hogs (node_modules, Docker caches, build artifacts), tag each item as needed, idle, orphaned, or duplicate, and finally produce a table listing evidence, expected benefit, risk, and reversible rollback commands.

The key constraint: without your explicit approval, the agent kills nothing, deletes nothing, and never touches system security settings.

Below is the full prompt. Copy it as-is and hand it to your agent.

Audit this computer's performance for running AI agents. First determine whether it's macOS or Windows, and record the hardware configuration. Use only built-in, read-only tools. Do not launch subagents and do not change anything on the first pass.

1. Capture baseline metrics. Take multiple readings, not a single snapshot. Check CPU load, average load or processor queue, memory pressure or available/allocated memory, swap or page file growth, disk I/O, free disk space, thermal throttling, sleep blockers, connected displays, and process/thread counts. If a metric is unavailable, note it and move on. Do not install anything.

2. Build the process tree. Group the main process and its helpers for each application family. Pay attention to: -> AI: Codex, Claude Code, MCP servers, code indexers, headless browsers -> Development: Node / Bun / Python, Docker / WSL / virtual machines, dev servers, watchers, test processes, databases -> Background: browser helpers, sync processes, updaters Record the parent process, runtime, CPU, memory, disk and network activity, listening ports, project directory, and whether the process is still in use by a terminal, editor, or active session.

3. Check every autostart source. macOS: -> Login Items and "Allow in Background" -> LaunchAgents, LaunchDaemons, Homebrew services -> system and network extensions Windows: -> Startup apps, services, Task Scheduler, Run keys -> WSL and Docker Desktop -> VPN, proxy, and network filters On both platforms, check browsers, menu bar or system tray monitors, Adobe and Office helpers, cloud sync tools, and outdated VPN, DNS, or proxy entries.

4. Find the major disk consumers. Look at build outputs, node_modules, Docker data, DerivedData or simulators, the Downloads folder, and duplicate project copies. Do not bulk-delete caches or personal files.

5. Tag every item. Use labels: active and needed / idle / orphaned / duplicate / unknown. Prioritize items that meet all three conditions: -> running for a long time -> no longer needed -> consistently consuming CPU, memory, disk, or network

6. Return a dry-run table. For each item, include: -> evidence -> expected benefit and risk -> whether a reboot is required -> recommended action: keep / close gracefully / stop / disable from autostart / delete / investigate further -> reversible commands and rollback steps Without my item-by-item approval, do not terminate processes, delete files, uninstall software, unload services, change autostart items or network settings, or restart the computer. If sudo or admin access is needed, explain the purpose and risk, then wait for approval. Do not disable FileVault, BitLocker, firewalls, Defender, or other system security tools. Preserve active agent sessions, terminals, editors, databases, sync tasks, VPNs, and any security tools I explicitly tell you are still in use.

Once I approve the plan, process one group at a time and take fresh measurements after each step. When finished, restart the computer, wait 5-10 minutes, and measure again. Use the machine normally for a day, then repeat the audit. Show before/after results and flag any processes or services that came back.

Takeaway

This resonates, plenty of people run several Codex workstations at once. What makes this approach valuable is that you hand the diagnostic work to the very agent creating the load, and the dry-run discipline removes the biggest fear people have about letting an agent near their system: an audit with manual approval at every step makes the cleanup genuinely safe.

If you're juggling multiple agents at once and your machine has started to groan under the weight, this is exactly the kind of maintenance worth doing once, properly, so it stays out of your way for good.

For AI Agents

Read with AI

Short prompt for a summary, takeaways, and applying this to your task.

ChatGPTClaude
Audio Version

Listen to This Article

Alpha version: audio generated via local TTS, errors possible.

Download MP3

Want to discuss your own task?

Tell us about the workflow you want to improve. We will help you identify the practical next step.

Request a free consultationExplore our services