CopybookEnglish搜索

提示词

多 agent 时电脑变慢的排查

开着很多 agent 电脑就卡:先 dry run 理清进程树和开机启动项,再只清理你批准的那些。

673 X 收藏,截至 发帖日期

提示词
Run a coding-agent performance audit on this computer. Detect macOS or Windows and record the hardware configuration first. Use only built-in, read-only tools. Do not spawn subagents or modify anything on the first pass.

1. Establish a baseline.

Take several samples, not one snapshot.

Check CPU, load average or processor queue, memory pressure or available / committed memory, swap / pagefile growth, disk I/O, free space, thermal throttling, sleep blockers, attached displays, and process / thread counts.

If a metric is unavailable, report it and continue. Do not install tools.

2. Build a process tree.

Aggregate the main process and helpers for each application family.

Focus on:
→ AI: Codex, Claude Code, MCP servers, code indexers, headless browsers
→ Development: Node / Bun / Python, Docker / WSL / VMs, 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 a terminal, editor, or active session is still using it.

3. Audit every startup source.

macOS:
→ Login Items and Allow in Background
→ LaunchAgents, LaunchDaemons, Homebrew services
→ system and network extensions

Windows:
→ Startup Apps, Services, Scheduled Tasks, Run keys
→ WSL and Docker Desktop
→ VPN, proxy, and network filters

On both platforms, inspect browsers, menu-bar or system-tray monitors, Adobe and Office helpers, cloud sync, and stale VPN, DNS, or proxy entries.

4. Inspect large disk consumers.

Include build outputs, node_modules, Docker data, DerivedData or simulators, Downloads, and duplicate project copies. Do not bulk-delete caches or personal files.

5. Label each item.

Use: active and needed / idle / orphaned / duplicate / unknown.

Prioritize items that meet all three conditions:
→ long-running
→ no longer needed
→ sustained CPU, memory, disk, or network use

6. Return a dry-run table.

For every item, include:
→ evidence
→ expected benefit and risk
→ whether a restart is required
→ recommended action: keep / quit normally / stop / disable at startup / uninstall / investigate
→ reversible commands and rollback steps

Without my item-by-item approval, do not kill processes, delete files, uninstall software, unload services, change startup items or network settings, or restart the computer. If sudo or Administrator access is required, explain the purpose and risk, then wait for approval.

Do not disable FileVault, BitLocker, firewalls, Defender, or other system security controls. Preserve the active agent sessions, terminals, editors, databases, sync jobs, VPNs, and security tools that I explicitly say are still in use.

After I approve the plan, handle one group at a time and remeasure after each. Once done, reboot, wait 5-10 minutes, and measure again. Use the computer normally for a day, then repeat the audit. Show the before / after results and flag any processes or services that returned.

下一步 在要检查的电脑上把它发给 Codex,macOS 或 Windows 都行。

我同时开着更多会话和 subagent,Mac 被拖慢了。它是一台 64GB 统一内存的 M1 Max。内存小的机器在同样的负载下,会更早遇到内存压力和 swap。

我让 Sol 理出完整的进程树。它查了没关的开发服务、重复的 MCP server、headless 浏览器、登录项、VPN 和网络扩展、浏览器辅助进程和更新程序。我把多余的项分批清掉,重启,正常用了一天,再查一次。现在同样的多 agent 负载很少再卡,我还能多开几个会话。

我把这次排查写成了一条 macOS 和 Windows 都能用的 prompt。第一轮只做 dry run。