Skip to content
Back to skills

Headroom

ASecurity

Walk a user through setting up swarm's built-in headroom: which models each role uses, what local inference they own and when to use it, and how swarm reads each seat's spare quota. Use when the user asks to set up headroom, to choose seats by spare quota, or to add a local model server to swarm.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added December 1, 2026
ai-agentsgoshellbashawsapisecurity

Works with

  • claude code
  • api
  • mcp

Security analysis

A100/100

Scanned December 1, 2026

npx -y skills add STRML/swarm --skill headroom --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Headroom?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Headroom
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/strml-headroom/badge)](https://www.skillsdirectory.com/skills/strml-headroom)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: swarm-headroom
description: >-
  Walk a user through setting up swarm's built-in headroom: which models each role uses, what local inference
  they own and when to use it, and how swarm reads each seat's spare quota. Use when the user asks to set up
  headroom, to choose seats by spare quota, or to add a local model server to swarm.
---

# Setting up headroom

Headroom lets `swarm spawn` pick the seat whose quota would otherwise go unused, and use local inference when the
user wants it. You write the config with the user, one question at a time, and check it before you stop.

```
detect ─▶ ratings and models per role ─▶ local inference ─▶ meters ─▶ write config ─▶ show diff ─▶ check
```

Rules for the whole walkthrough:

- Ask before you change anything outside the swarm config. A status line setting is the user's, so show the exact
  change and wait for a yes.
- Keep the user's comments and any seat they already have. Edit the config in place. Never regenerate it.
- Put no host names, account names, paths or keys of the user into files that are shared or committed. The config
  lives in their home directory, so it may hold them.
- Ask one question at a time and offer the default first.

## 1. Detect

Run the read-only inventory and tell the user what it found:

```bash
swarm headroom detect --json
swarm doctor
```

`detect` lists the harnesses on PATH, the names of Claude config directories, whether Codex has a model catalog, and
which usual local ports answer `/v1/models` on 127.0.0.1 with their model ids. `swarm doctor` shows where the config
lives. If there is no config yet, run `swarm init` and edit the file it writes.

## 2. Ratings, then model preferences

Start with ratings, because they show which models are worth their cost. Swarm ships none, since publishers restrict
redistribution. Offer `swarm ratings fetch` first (see [docs/seats.md](../../docs/seats.md#ratings)):

1. Tell the user to make a free API key at artificialanalysis.ai. They store it themselves. Never ask for the key in chat,
   and never write it to a file you create.
2. It is read from `AA_API_KEY`, or from a command in the config: `ratings_key_command: [<their secret tool>, get, <name>]`.
   Help them write that line. Then run `swarm ratings fetch` and `swarm rates`.
3. If they want no key, read the public comparison pages together with them and write the ratings file by hand
   (`~/.config/swarm/ratings.json`), as the docs describe. Say that the numbers are theirs to keep, not to publish.

Then ask which models each role should use, one role at a time. Offer the defaults from `examples/config.yaml` first and
keep them unless the user names another. List each model at its vendor's API-default effort, which is how the ratings are
read, and offer that effort first. Never offer `xhigh` or `max`: they cost several times as much for a few index points.
With ratings in, go through each vendor the user has and offer the model and effort pairs that no cheaper pair of that
vendor matches (`swarm rates` marks the others `beaten by`), and place each pair in the band its rating fits.

The `index` is a capability score. A role only gets models inside its band, so a swarm runs at one level.

| Role | Band | Writes | Default models (index, seat, effort) |
|---|---|---|---|
| `simple` | 24 to 40 | yes | `claude-haiku-5-5` (30, claude, medium), `gpt-*-terra` (38, codex, medium) |
| `worker` | 41 to 55 | yes | `gemini-4-hydrogen-high` (46, agy, read only), `claude-sonnet-5-5` (52, claude, high), `gpt-*-sol` (55, codex, medium) |
| `deep` | 56 to 62 | yes | `claude-opus-5-5` (56, claude, medium), `gemini-4-neon-high` (58, agy, read only), `gpt-*-astra` (61, codex, medium) |
| `verifier` | 56 to 62 | read only allowed | the `deep` models |
| `verifier-lite` | 48 to 55 | read only allowed | `claude-sonnet-5-5` (52), `gpt-*-sol` (55) |

Each `models:` entry names the seats that run it. Drop the models the user does not have. A Claude-only user fills `deep` and
`verifier` with Opus, which sits at the floor of those bands. `verifier-lite` is for routine PR verification and `verifier` for
money, security, concurrency or a disputed finding; an agy-only user has no model in the lite band, so tell them to use `verifier`. If a role ends up with no model from the user's seats, tell
them: a role with no model cannot pick a seat, and `local.roles` may only name roles that have a band. Local models may sit
below a band, because the band minimum is waived for them.

## 3. Local inference

Ask whether the user runs models on their own hardware. If yes, ask these, one at a time:

1. Which machine, and what do you want to call its pool? Seats on one machine share a pool.
2. Which server runs there (mlx-serve, mtplx, oMLX, llama.cpp, LM Studio, Ollama)? Offer what `detect` found.
3. What is the endpoint, and does it have a health URL that answers 2xx? That URL becomes `probe`.
4. Which model, and how good is it compared with the cloud models? That is its `index`.
5. How many workers can it serve at once? That is `capacity`.
6. Which harness reaches it? A `claude` or `codex` seat declares `endpoint: <the URL>`, and swarm points the harness there itself,
   with a private config directory, a dummy key and none of the user's cloud variables. An endpoint on a vendor host is refused. Tell the user that a local claude seat does not see their `permissions.allow` rules, and that a project `.mcp.json` is not blocked. An `omp` seat declares `profile: <name>`, a profile whose providers are all local, and
   swarm passes `--profile`; its model is named `<provider>/<model>`. A `cmd` seat is the user's own command. A `launcher` is
   optional and must be one word, the user's own wrapper script, never `env`, `nohup` or a shell.

Warn about omp: a local omp seat may start its own subagents or auxiliary roles (smol, slow, plan) on a cloud model from its
profile. Swarm enforces the seat and model it starts, not what a harness does inside a turn. The profile needs local
providers only. Swarm refuses a model named on a cloud provider omp ships, such as `anthropic/` or `openai/`, and removes
the provider keys omp reads from the seat's environment.

Then ask when they like to use it, and write the matching config:

| Answer | Config |
|---|---|
| Always for some roles | `local: {roles: [simple]}` |
| At set hours or days | add `hours: ["18:00-09:00"]` and `days: [sat, sun]` to `local` |
| Only when cloud runs low | `local: {roles: [simple], below: 20}` with no hours or days, and a `headroom:` section so cloud seats have scores |
| Only on request | no `local` section. The user runs `/swarm local` or `swarm --room R local prefer` |

Explain the room modes once: `prefer` takes a free local seat for any role, and `only` allows nothing else.

## 4. Meters

Each cloud seat reads a meter. Readings older than `headroom.refresh_minutes` (default `10`; set `0` to disable
live reads, including explicit refreshes) are refreshed live at zero tokens and cached under `<state dir>/.headroom/` (mode `0600`, shared across
processes, one refresher at a time). Ask how the user wants each seat read:

- A `claude` seat reads the newer of the status line JSON (`swarm headroom tee`) and a live `<launcher> -p /usage` read
  (which also captures Fable's own weekly limit). Offer to wrap their status line command for live in-session updates:
  `"command": "swarm headroom tee -- sh -c '<their current command>'"`. Their command is shell text that Claude Code runs
  with `sh -c`, so put it inside `sh -c '...'` and write each single quote in it as `'\''`. Show the change, ask, and back
  up the file first.
  Seats with their own `CLAUDE_CONFIG_DIR` or `claude-*` wrapper launcher use their own account and cache; wrap the status
  line in each account's settings if desired.
- A `codex` seat reads the newest rollout under `$CODEX_HOME/sessions`, and refreshes live via `codex app-server` when stale
  (so recovered credits are noticed with no new session). It needs nothing.
- An `agy` seat asks `agy -p /quota` and caches it for five minutes. It needs nothing.
- An `omp` seat that draws a Claude plan gets `meter: claude` and `account: <config dir name>`.
- Anything else can use `meter: {command: [...]}`, a command that prints one JSON number, `null` or `"throttled"`.
- If the user runs a model with its own sub-limit (such as Fable on Claude), add `limit: fable` on that model entry so a
  near-zero Fable limit throttles only Fable and leaves other models on that account usable.

Ask about the pace and refresh cadence too. `headroom: {daily_pct: 14, floor_pct: 5, refresh_minutes: 10}` means a seat is
expected to use 14 percent of its long window per day, a window with under 5 percent free is throttled, and readings older
than 10 minutes refresh live. Keep those unless the user has a reason. Mention `swarm headroom refresh [--if-older MINUTES]`
if they prefer a timer or worker hook to keep the cache warm.
A `weight` below 1 on a seat, such as a shared team plan, makes it the last choice.

## 5. Write and show the diff

Copy the config to a backup, edit the original, then show the user the diff:

```bash
cp "$CONFIG" "$CONFIG.bak"
diff -u "$CONFIG.bak" "$CONFIG"
```

Use the path `swarm doctor` printed for `$CONFIG`. Wait for the user to accept the diff before you go on.

## 6. Check

```bash
swarm doctor
swarm headroom
swarm local
```

`doctor` must show the config loaded and each local seat's probe. `headroom` lists every seat with a score, or a dash
and a note saying why there is none. `local` lists free slots. Fix what a note names, then show the user the final
table and how to use it: `swarm headroom --pick worker` shows the seat a spawn would take now, and `/swarm local` or
`/swarm local-only` sets a room's mode.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.