Skip to main content

host-headroom: room for another AI coding agent? Ask first.

Claude Code plugin Python 3.9+ No dependencies macOS, Linux, containers MIT license Tests, run on request In the wild: 72 of 77 planted problems named, 0 false all-clears

One read-only command that tells you whether another AI coding agent fits on this machine, names exactly why, and prints the fix.

Side by side, host-headroom in the terminal and its web dashboard both say ROOM IF YOU FREE 1.2 GB: a test run stuck for 3 days, a 14.6 GB log and a dev server left running. Each printed fix is copied, run, and checked again: kill 4242 frees 1.2 GB of memory (ROOM FOR 1), emptying the log frees 14.6 GB of disk (ROOM FOR 2), and kill 5150 frees 0.6 GB of memory (ROOM FOR 3).

Same answer, two views: host-headroom in the terminal and host-headroom --html in the browser. Three printed fixes, one at a time: stop a stuck test run (+1.2 GB memory, room for 1), empty a 14.6 GB log (+14.6 GB disk, room for 2), stop a forgotten dev server (+0.6 GB memory, room for 3). Sample output on a demo Mac.

Watch the 2-minute walkthrough on YouTube

Quick start

pipx install git+https://github.com/workingBen/host-headroom
host-headroom

No pipx? It is one file with no dependencies (Python 3.9 or newer):

mkdir -p ~/.local/bin
cp host_headroom.py ~/.local/bin/host-headroom
chmod +x ~/.local/bin/host-headroom

The first line of the answer is the verdict: ROOM FOR N, ROOM IF YOU FREE X GB, or NO ROOM. Below it are the agents running now and the problems, each with the command that fixes it, biggest first.

host-headroom                # the verdict and problems, as text
host-headroom --json         # everything, for scripts
host-headroom --html OUT     # a dashboard page
host-headroom --brief        # Claude Code SessionStart JSON; silent unless red
host-headroom worktree PATH  # exit 1 if a process is running in that worktree
host-headroom guard chrome   # Claude Code PreToolUse hook (see below)

Read-only. It never kills a process and never deletes a file; fixes are printed for you to run. The only things it writes are a small cache in ~/.cache/host-headroom/ and the --html file you ask for. No guessing. If a check cannot run it says "couldn't check", and it never reports all clear while something is unknown.

What it checks

Check What it looks at Runs on
Memory Memory really available, swap, and on a Mac the pressure level and compressor macOS, Linux, containers
Stuck test runs Test runs going for more than two hours macOS, Linux, containers
Test suites at once More than one full suite at a time on 16 GB or less macOS, Linux, containers
Dev servers left running Servers on ports 3000 to 9999 up for more than 12 hours macOS, Linux, containers
Orphaned processes Test runs and servers whose agent has exited macOS, Linux, containers
Disk space Free space against a floor (20% of the disk, 2 to 15 GB; 5 GB in a container); when short, the biggest space users it measured macOS, Linux, containers
Old worktrees Merged, clean worktrees nobody has edited for seven days; idle worktrees holding commits never pushed or uncommitted changes (reported, never offered for removal) macOS, Linux, containers
Big logs Project log files over 100 MB macOS, Linux, containers
Test databases Postgres test databases, and ones whose worktree is gone macOS, Linux, containers
Chrome leftover copies Whole-app copies Chrome leaves behind when it is killed macOS only
Render leftovers Remotion render folders left in the temporary folder macOS, Linux, containers
Agent files The size of ~/.claude, ~/.codex and agent scratch folders macOS, Linux, containers
Claude Code scratch Claude Code's /tmp/claude-<uid> session folders where nothing changed in 36 hours macOS, Linux, containers
Instruction files Memory indexes near Claude Code's 200-line cutoff and CLAUDE.md files over 20 KB macOS, Linux, containers
Dev caches Old Playwright browsers, and node_modules and virtualenvs inside stale worktrees and scratch folders macOS, Linux, containers
Daytona sandboxes Sandboxes left started (opt-in: cloud = ["daytona"]) macOS, Linux, containers
Open pull requests Your open GitHub pull requests not updated for a week (opt-in: cloud = ["github"]) macOS, Linux, containers

Every check, its fix and a sample: checks.

How it decides "room for N"

Memory and disk are worked out the same way: what is left above a safety floor, divided by what one more session costs. The smaller answer wins. Hard stops override it: there is no plain "room" while a test run is stuck, several full suites run at once on 16 GB or less, swap is over 90% full, or (on a Mac) memory pressure is high. The full picture: how it decides.

Claude Code plugin

/plugin marketplace add workingBen/host-headroom
/plugin install host-headroom@host-headroom

It adds a "check the machine" skill and a session-start hook that runs host-headroom --brief: silent unless something is red, and then one warning line when the session opens. To see memory and disk at every session start, even when nothing is wrong, set brief_always = true in the config. The plugin ships its own copy of the command, so it works with nothing else installed; if you also install host-headroom with pipx, the plugin uses that one.

Worktrunk add-on

Copy wt-headroom onto your PATH (for example ~/.local/bin), then Worktrunk finds it as wt headroom. To refuse removing a busy worktree:

wt headroom install-hook     # prints the pre-remove hook to paste into your config

Chrome guard

On macOS, Chrome copies its whole app (1 GB or more) into a temporary folder each time it starts, and removes the copy only on a clean quit. Browser scripts that get killed or crash leave one behind every time. host-headroom guard chrome is an opt-in Claude Code PreToolUse hook that refuses a Bash command which launches Chrome (directly, or through a Playwright or Puppeteer script it runs) without --disable-features=MacAppCodeSignClone. A script whose local helper (require('./launch.cjs') and the like) passes the flag is allowed. It does nothing on Linux. To turn it on, add this to the PreToolUse hooks in your Claude Code settings:

{"matcher": "Bash", "hooks": [{"type": "command", "command": "host-headroom guard chrome"}]}

Config

Optional. ~/.config/host-headroom/config.toml (or $HOST_HEADROOM_CONFIG). Every value has a default that works with no file.

roots are the folders scanned for worktrees and big logs: each root and every folder one level down is checked for a git repository. Without a config, the roots are whichever of ~/code, ~/src, ~/projects and ~/Developer exist. With no roots at all (a fresh machine), worktrees and logs report "no repos": nothing exists to check, so they are not "couldn't check", and the note says where to set roots.

disk_floor is the free space a new agent needs. Unset, it is 5 GB inside a container and otherwise 20% of the disk, at least 2 GB and at most 15 GB (15 GB when the disk size can't be read).

brief_always = true makes --brief print one line with memory and disk (host-headroom: Memory 5.1 GB free of 16 GB · Disk 120.4 GB free.) at every session start, not only when something is red. The green line goes to you only, never into the agent's context. Off by default.

cloud = ["daytona", "github"] turns on the two checks that ask a service over the network: sandboxes (daytona sandbox list) and open_prs (gh search prs). Both are off unless listed, give up after 15 seconds, say "couldn't check" when the CLI is missing or not logged in, and never run in --brief.

[thresholds] overrides the defaults: stuck_test_secs, server_secs, log_bytes, worktree_stale_days (7), memory_index_lines (180), instructions_bytes ("20KB") and pr_stale_days (7).

disabled turns checks off by id: memory, stuck_tests, suites_at_once, servers, orphans, disk, worktrees, logs, test_dbs, chrome_copies, leftovers, agent_files, claude_scratch, context_files, dev_caches, sandboxes, open_prs, and watch:<label> for a watched folder. An unknown id is an error, so a typo cannot silently leave a check on.

roots = ["~/code"]
disabled = ["test_dbs"]

[[watch]]
label = "Build cache"
paths = ["~/.cache/myapp/*"]
warn = "600MB"
red = "2GB"
fix = "Clear it when no build is running"
cmd = "rm -rf ~/.cache/myapp/*"

A worktree's "last edit" ignores logs, tmp, node_modules and build folders, so they do not make an idle worktree look busy.

Results from the wild

Real problems planted on real machines, then graded: did host-headroom name each one, and did it ever say all clear when it should not have? Misses are listed.

72 of 77 planted problems named across 8 full runs, 0 false all-clears. Export of 2026-11-27.

Machine Run Kind Result Named Misses
daytona (Linux host) 1 (Nov 27) full FAIL 8 of 9 Dev server left running: missed
daytona (Linux host) 2 (Nov 27) full PASS 9 of 9 none
daytona (Linux host) 3 (Nov 27) full PASS 9 of 9 none
mac8 (macOS) 1 (Nov 25) full FAIL 8 of 10 Remotion render bundle: flagged, not named; Leftover test database: known gap
mac8 (macOS) 2 (Nov 25) full FAIL 9 of 10 Leftover test database: missed
mac8 (macOS) 3 (Nov 25) partial PASS 1 of 1 none
mac8 (macOS) 4 (Nov 25) full FAIL 9 of 10 Leftover test database: missed; memory test: false room
mac8 (macOS) 5 (Nov 25) full PASS 10 of 10 none
mac8 (macOS) 6 (Nov 25) full PASS 10 of 10 none

No runs yet on: Container.

Every run, plant by plant: results.

FAQ

Does it delete anything? No. It never kills or deletes. Every fix is a printed command; you decide which to run.

Does it work in Docker or Daytona? Yes. Inside a Linux container it reads the container's own memory and disk limits, not the host's, and uses the container disk floor.

Why Python? Python 3 is already on almost every Mac and Linux machine, and one standard-library file means nothing to install or keep up to date.

Why not just Activity Monitor or htop? They show what is using memory right now. They do not know what one more agent costs, which test runs are stuck, which worktrees are stale, or which command frees the space.

Windows? Not supported. It runs on macOS, Linux and Linux containers.

What does it send anywhere? Nothing. No telemetry and no network calls of its own; the test-database check only asks your local Postgres, through psql.

  • Mole: cleans a whole Mac.
  • zclean: kills orphaned agent processes.
  • cc-reaper: also cleans up orphaned agents.
  • claude-code-cleaner: trims ~/.claude.

host-headroom only tells you where the room went; use these to reclaim it.

License

MIT. See LICENSE.

Metadata

Release files for host-headroom 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for host-headroom 1.2.0
File Size Uploaded Provenance Actions
host_headroom-1.2.0.tar.gz 103.1 kB With provenance Details for host_headroom-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for host-headroom 1.2.0
File Interpreter ABI Platform Actions
host_headroom-1.2.0-py3-none-any.whl Python 3 none any Details for host_headroom-1.2.0-py3-none-any.whl

Total release size: 151.3 kB

Release files / host_headroom-1.2.0.tar.gz

Download URL host_headroom-1.2.0.tar.gz
Size 103.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bd8c07f5e530051807714598e11db74b20917f650362d882f7618f9b47c357f7
BLAKE2b-256 checksum
How to use checksums
8dde725761996ba8c5504e9411df1b1122fbbfd1babfcabbb5d0c5c4c7e9659f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / host_headroom-1.2.0-py3-none-any.whl

Download URL host_headroom-1.2.0-py3-none-any.whl
Size 48.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d706c8ebe211050fe74055a9b63df79cc752fdc44f71e234910373a6a9fc7848
BLAKE2b-256 checksum
How to use checksums
c68acdd7f3c972bb6a2853962ead11a9e9b73547543894404f960da5e8c19ab7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for host-headroom 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for host_headroom-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page