headroom: Command for Claude Code

.claude/commands/cleanup.md

cleanup is a command for Claude Code from michellzappa/headroom. It costs 19 tokens per session (2,062 once invoked), scanned A, original, MIT.

A repository-cleanup procedure for releasing all finished, unshipped work on the main branch as separate patch releases, then leaving the repository clean.

In plain words
What is it for?
Use it when preparing a repository for release: inspect worktrees and history, inventory unshipped changes, create separate changelog sections and tags, return to main, and remove leftover uncommitted changes unless explicitly kept.
Why use it?
It provides checks for unfinished work or other active sessions before publishing changes, reducing the risk of releasing someone else’s incomplete work.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions AGENTS.md.

This is michellzappa/headroom's own configuration. It tells Claude Code how to work on headroom itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything headroom configures →

Reuse

Borrowing it

Nothing to install: this file belongs to michellzappa/headroom. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/michellzappa/headroom/main/.claude/commands/cleanup.md
Clone the repo
git clone --depth 1 https://github.com/michellzappa/headroom

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cleanup

README.md
[![agentmods](https://agentmods.dev/badge/commands/michellzappa/headroom/cleanup/github.svg)](https://agentmods.dev/commands/michellzappa/headroom/cleanup)
Your own site
<a href="https://agentmods.dev/commands/michellzappa/headroom/cleanup"><img src="https://agentmods.dev/badge/commands/michellzappa/headroom/cleanup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cleanup

Your own site · 80×15
<a href="https://agentmods.dev/commands/michellzappa/headroom/cleanup"><img src="https://agentmods.dev/badge/commands/michellzappa/headroom/cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,062 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.02062
Opus 5.5 $0.00008 $0.00825
Sonnet 5.5 $0.00004 $0.00412
Haiku 4.5 $0.00002 $0.00206

Measured 1mo ago against content hash fdcc9686e262, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/cleanup.md · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cleanup: get back to a clean main

Run this in a fresh session when nobody else is working in the repo. It takes whatever state things are in — feature branches, uncommitted work from several sessions, commits sitting unshipped on main — and leaves:

  • every finished set released from main as its own patch version, each with its own CHANGELOG section and its own tag
  • nothing dirty except work you were explicitly told to leave
  • a checkout sitting on main, which is where work happens here

Read AGENTS.md first. It governs everything below, and where the two disagree, AGENTS.md wins.

0. Check nobody else is live

git worktree list, git status, and git log --all -20 --format='%h %cr %s'. Run ./scripts/ship-inventory.sh for a one-screen queue (unshipped commits, dirty paths, next version, recent Release runs). If another session looks like it is mid-change (a worktree you did not make, commits from the last few minutes, a half-applied edit), say so and stop. This command rewrites nothing, but it does publish, and publishing someone's half-finished work is not recoverable.

1. Inventory first, act second

Report before touching anything:

  • Unshipped on main: git log --oneline $(git describe --tags --abbrev=0)..main
  • Branches: git branch -v --no-merged main, then for each one git cherry -v main <branch>. Use git cherry, not the commit list — branches here get cherry-picked into one another, so the same change exists under two SHAs and --no-merged keeps reporting content that already shipped. A - prefix means already applied, + means genuinely outstanding.
  • Dirty: git status --short
  • Bumps already in flight: git log --all --oneline --grep='^chore: bump' since the last tag. Several branches may each carry one, and they may claim the same number or leapfrog each other. Treat every one as a guess someone made, not as a decision.
  • Last tag vs host/VERSION

Then present the sets you propose to ship, in the order you propose to ship them, with a version for each — and ask before starting. Getting the partition wrong is the expensive mistake; everything after it is mechanical.

Read the full file on GitHub · 165 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 165 lines · 19 tokens per session scan A fdcc9686e262

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository michellzappa/headroom (264 stars, last pushed 24d ago), licensed MIT. It adds 19 tokens to every session and 2,062 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.