headroom: Command for Claude Code

.claude/commands/lap.md

lap is a command for Claude Code from patwalls/headroom. It costs 29 tokens per session (2,699 once invoked), scanned B, original, MIT.

A single-step command from a recurring development loop that ships one small improvement and checks the result.

In plain words
What is it for?
Completing one bounded project task, testing its outcome, recording the result, and pushing the change.
Why use it?
It keeps autonomous work limited and verifiable, while also respecting pause and usage-throttling controls.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

This is patwalls/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 patwalls/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/patwalls/headroom/main/.claude/commands/lap.md
Clone the repo
git clone --depth 1 https://github.com/patwalls/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 lap

README.md
[![agentmods](https://agentmods.dev/badge/commands/patwalls/headroom/lap/github.svg)](https://agentmods.dev/commands/patwalls/headroom/lap)
Your own site
<a href="https://agentmods.dev/commands/patwalls/headroom/lap"><img src="https://agentmods.dev/badge/commands/patwalls/headroom/lap/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 lap

Your own site · 80×15
<a href="https://agentmods.dev/commands/patwalls/headroom/lap"><img src="https://agentmods.dev/badge/commands/patwalls/headroom/lap.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 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,699 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 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.00029 $0.02699
Opus 5.5 $0.00012 $0.01080
Sonnet 5.5 $0.00006 $0.00540
Haiku 4.5 $0.00003 $0.00270

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

Security

Grade B, and why

lap scanned grade B with 2 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 2mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- `cat ~/.claude/LOOPS_THROTTLE` gives a number of seconds. That is the MINIMUM delay

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Site live: !`curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://headroom.walls.sh/health 2>/dev/null` · downloads: !`curl -s --max-time 10 "https://headroom.walls.sh/metrics?probe=1" 2>/dev/null | head -c 200
.claude/commands/lap.md · 167 lines

How it starts

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

⏸ Pause guard (check FIRST, before anything)

If ~/.claude/LOOPS_PAUSED exists (test -f ~/.claude/LOOPS_PAUSED), Pat has paused all loops (usually: out of credits). Say "loops are paused — not running this lap" and STOP immediately. Do no work, schedule no wakeups. Pat resumes with /resume-loops in walls.

🐢 Throttle guard (check right after pause)

If ~/.claude/LOOPS_THROTTLE exists, Pat is low on credits — run FRUGAL this lap:

  • cat ~/.claude/LOOPS_THROTTLE gives a number of seconds. That is the MINIMUM delay before the next lap: when this lap ends and you schedule the next wakeup, set ScheduleWakeup delaySeconds to AT LEAST that value.
  • Keep the lap small and cheap: do ONE small thing, do NOT escalate to opus/fable subagents (stay on the cheap session model), skip optional polish. Cleared with /unthrottle-loops (or /resume-loops) in walls.

💸 Token discipline (every lap, always)

The loop re-reads its whole context each lap, so wasted work compounds fast. Keep every lap cheap and bounded:

  • One thing, one success test. Before starting, state in ONE line what this lap ships and the exact check that proves it done. Hit that test, then STOP — no second task, no gold-plating, no "while I'm here."
  • Never spin. If an approach fails twice the same way, abandon it, log it as a blocker (a registry/VISION note), and end the lap. A third retry of a broken approach is banned — that is the #1 token sink.
  • Read once, narrowly. Open only the files this lap needs, once. Do NOT re-read or re-grep what is already in context. Trust VISION.md's loop log as the state of the world instead of re-deriving it from the whole codebase.
  • Cheap by default, escalate rarely. Stay on the session model. Spawn AT MOST one subagent per lap, and only for genuinely substantial/critical work — never fan out a swarm for a routine lap.
  • Hand off small. End with a 2–3 line loop-log entry (shipped / fact learned / next) so the next lap can act from that summary, not from re-reading everything.

Read the full file on GitHub · 167 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. 2mo ago First seen · 167 lines · 29 tokens per session scan B 487b304e78ef

Subscribe to this mod's changes

lap is a command published in the GitHub repository patwalls/headroom (11 stars, last pushed 4mo ago), licensed MIT. It adds 29 tokens to every session and 2,699 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.