Devotd Github
NewAI agents

kevin-liu-01/headroom 2.2 — A List of Processes Left Behind by Agent Sessions and a Kill Button

A change that lists the processes that remain on macOS after Claude/Codex agent sessions end, having been adopted by launchd, and lets the user inspect them and terminate them manually.

Repositorykevin-liu-01/headroom ↗

A change that lists the processes that remain on macOS after Claude/Codex agent sessions end, having been adopted by launchd, and lets the user inspect them and terminate them manually.

GitHub description: Memory alerts for Macs that run AI coding agents: which Claude session owns the memory, alerts before macOS runs out, and advice relayed to agents through a CLI, HTTP API, Claude Code hook and MCP server.

stars
★ 11
Forks
0
Language
Swift
License
MIT
Read original source ↗View on GitHub ↗

The 2026-10-28 commit (3c27f73) of kevin-liu-01/headroom added a "leftover processes (leftovers)" list and a Kill button to the macOS app. The app collects how much memory the Claude and Codex desktop apps, their agent sessions, and the processes those sessions spawned are using, and displays it in the menu bar. The commit labels this change as 2.2.

The targets are processes that survived even though a session, shell, or script has ended. On macOS the parent of such a process changes to launchd (pid 1), so it drops out of the agent's process tree and does not show up in other rows either. Headroom reads the kernel-held pid version information of the original parent (PROC_PIDUNIQIDENTIFIERINFO in proc_pidinfo) and picks out only the adopted processes, not apps that launchd started on its own. Things started within 2 seconds in the same process group are grouped as a single task, so a shell's leftover tail -F | grep pipeline or a test browser's crash handler comes out as a whole. The window places side by side the kind, command, folder, copyable pid, age, memory, and the last sample of CPU time, which grew by 1 percent of a core, and orders them by memory size, putting them under the heavy tasks along with a group title ("5 leftovers, 4.3 GB"). The CLI gained the headroom leftovers table, --json, and a one-line count in headroom status, and the implementation came in as the new file Sources/HeadroomCore/Leftovers.swift and the test file LeftoverTests.swift.

Termination is done by the user. The Kill button must be pressed again within 5 seconds before it executes; it sends SIGTERM to all pids that still point to the same process, then sends SIGKILL to whatever is still there after 5 seconds. Headroom never kills anything by itself. The age threshold is a settings item with a default of 30 minutes, and the settings file is stored at ~/Library/Application Support/Headroom/settings.json. However, detection is limited to cases running in the home folder, /opt/homebrew, or /usr/local, or to test browsers, searches, and shells, so leftover processes on other paths may not be caught. It is macOS-only, and the run example in the commit message is offered only as the author's personal experience on the Mac where the app they made runs, with no separate benchmark. If you have a macOS environment where agents stay attached for a long time, this is a change worth checking out.