For AI coding agents

Is there room for one more agent?

host-headroom checks your machine and answers in one line: room for N, room if you free X GB, or no room. It names exactly why and prints the command that fixes it.

pipx install git+https://github.com/workingBen/host-headroom
Or add it to Claude Code
  • Read-only
  • One Python file, no dependencies
  • macOS, Linux, containers
The same answer in the terminal and the web dashboard, after each of three printed fixes. Sample output on a demo Mac; a real capture replaces it before launch.

Three steps, every time

Ask before you start another session. The answer comes with its own fix.

  1. 1

    Run it

    Type host-headroom. It reads memory, disk and what is running. It usually takes a few seconds, and it changes nothing.

  2. 2

    Read the verdict

    The first line is the answer: room for how many, room once you free something, or no room and why.

  3. 3

    Run the printed fix

    Each problem comes with the exact command, biggest first. Run the ones you agree with, then ask again.

host-headroom output after the three fixes: ROOM FOR 3. Three idle sessions, or one that runs its tests. Nothing to fix.
After the three fixes: room for three. Sample output.

What it checks

Twelve checks, in two groups: what is using memory right now, and what is filling the disk. Each one can be turned off in the config.

Every check, its fix and an example

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.

Swipe sideways to see the whole diagram.

Idle or running its tests
An idle session costs what a running agent typically holds by itself (the median of the agents running now, 0.8 GB when none are). A session that runs its tests also needs room for the largest test run seen, 3 GB until one has been measured. The verdict gives both: “room for 2 idle sessions, or 1 that runs its tests.”
Available memory
What could be handed to a new process right now. On a Mac that is free, speculative and purgeable pages, plus inactive pages only as far as files back them. Memory that can only be compressed or swapped does not count.
The safety floor
15% of memory always stays free. On a Mac whose compressor already holds 20% or more of memory, the floor rises to 25%, and the verdict says memory is heavily compressed.
Room if you free
When nothing fits, it adds the biggest fixes from the problem list, one at a time, until one session would fit, and names them. A hard stop is cleared only by its own fix.
Couldn't check
If memory or disk cannot be read, the answer is never “room”. Any check that could not run is named at the end of the verdict.

Where it runs

It works out where it is first, then reads what that place really has. Inside a container, that means the container's own limits, not the host's.

EnvironmentMemoryDiskProcesses and ports
macOSvm_stat pages and the compressor, swap from sysctl vm.swapusage, and the system's memory pressure levelThe Data volume; floor 20% of it, 2 to 15 GBps and lsof; also looks for leftover Chrome copies
Linux hostMemAvailable and swap from /proc/meminfo; out-of-memory kills from /proc/vmstatThe root volume; floor 20% of it, 2 to 15 GBps and ss, or /proc when either is missing
ContainerThe cgroup limit (memory.max, or the v1 limit) less what is in use, plus file pages it can drop; out-of-memory kills from memory.eventsThe root volume, 5 GB floorThe same as a Linux host, inside the container

A container is recognized by /.dockerenv, a container= variable on its first process, or a cgroup memory limit.

Install

Python 3.9 or newer. Nothing else.

With pipx

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

That works once the repository is public. Until then, clone it and run pipx install . from the clone.

As a single file

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

Make sure ~/.local/bin is on your PATH.

Claude Code plugin

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

Adds a “check the machine” skill and a session-start warning that stays silent unless something is red.

Worktrunk add-on

wt headroom
wt headroom install-hook

Copy wt-headroom onto your PATH and Worktrunk finds it. install-hook prints a pre-remove hook that refuses to remove a busy worktree.

The promise

Read-only

It never stops a process and never deletes a file. Fixes are printed as commands for you to run. The only things it writes are a small cache in ~/.cache/host-headroom/ and the --html page you ask for.

It never guesses

If a check cannot run, it says “couldn't check” and the verdict names it. It never reports all clear while something is unknown.

Tested on real machines

Known problems are planted on a real machine, host-headroom runs, and each one is graded: named, or not. The misses are published too.

  • 72 of 77planted problems named
  • 8full runs
  • 0false all-clears

macOS and Linux host only, so far. Runs in containers are still to come.

Every run, every plant