Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/patwalls/headroom/lapgit clone --depth 1 https://github.com/patwalls/headroomWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00029 | $0.02699 |
| Opus 5 | $0.00015 | $0.01350 |
| Sonnet 5 | $0.00006 | $0.00540 |
| Haiku 4.5 | $0.00003 | $0.00270 |
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 2d 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 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_THROTTLEgives a number of seconds. That is the MINIMUM delay before the next lap: when this lap ends and you schedule the next wakeup, set ScheduleWakeupdelaySecondsto 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.
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.
- 2d ago First seen · 167 lines · 29 tokens per session scan B 487b304e78ef
lap is a command published in the GitHub repository patwalls/headroom (10 stars, last pushed 2mo ago), licensed MIT. It adds 29 tokens to every session and 2,699 once invoked, about $0.0001 per session on Opus 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.
Other commands, from other repositories
upload
Archive, upload, and submit to external TestFlight (full loop with monitor).
archive
Create xcarchive for TestFlight.
archive-mail
歸檔指定聯絡人的 Apple Mail 郵件到 Markdown 檔案.
archive-mail-migrate
一次性把所有舊 archive 的 indices + config 搬到 .claude/.mail/ namespace.
archive-mail-rebuild-threads
從 per-email md 的 frontmatter 重建 .threads.json.
archive-mail-repair-synthetic-ids
掃描歸檔目錄中 messageid 匹配 ^synthetic: 的 markdown 檔,嘗試從 Mail 重新解析真實 RFC 5322 Message-ID 並就地修復 frontmatter + emailindex.json。保守優先:寧可留 unparseable 交人工,絕不錯誤合併兩封不同的信。.