headroom-desktop: Instructions file for Claude Code

CLAUDE.md

headroom-desktop CLAUDE.md is an instructions file for Claude Code from gglucass/headroom-desktop. It costs 2,782 tokens per session, scanned A, original, MIT.

A project instruction file for Headroom Desktop, a desktop application with Rust code and a frontend. It defines testing requirements, rules for updating a pinned dependency version, persistence behaviour, and formatting expectations.

In plain words
What is it for?
Use it when changing the Rust backend, frontend, styling, persisted data, or the pinned Headroom dependency, and when deciding which checks to run.
Why use it?
It tells agents which checks must run after changes and what extra investigation is needed before changing an upstream version. This reduces regressions caused by skipped tests or incompatible dependency updates.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md.

This is gglucass/headroom-desktop's own configuration. It tells Claude Code how to work on headroom-desktop 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-desktop configures →

Reuse

Borrowing it

Nothing to install: this file belongs to gglucass/headroom-desktop. 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/gglucass/headroom-desktop/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/gglucass/headroom-desktop

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 headroom-desktop CLAUDE.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/gglucass/headroom-desktop/claude-md"><img src="https://agentmods.dev/badge/instructions/gglucass/headroom-desktop/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,782 This file is loaded in full into every session.
When invoked 2,782 The same file — it is already loaded in full.
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.02782 $0.02782
Opus 5 $0.01391 $0.01391
Sonnet 5 $0.00556 $0.00556
Haiku 4.5 $0.00278 $0.00278

Measured today against content hash 117da87e9891, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

headroom-desktop CLAUDE.md 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 today.

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.md · 53 lines

How it starts

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

CLAUDE.md - headroom-desktop

This file holds only what the model cannot derive: project invariants, environment quirks, and concrete commands. Generic coding-style coaching (write simply, read before editing, state the bug and stop) was removed on 2026-08-03 — modern models do it unprompted and the harness enforces the rest. Do not re-add it.

Testing Rules

  • After any code change, run the relevant tests/checks before declaring the task done. Do not ask the user to verify.
  • Rust changes: cargo test --manifest-path src-tauri/Cargo.toml --lib <filter> for the affected module, plus cargo check --manifest-path src-tauri/Cargo.toml if the change crosses module boundaries.
  • Frontend changes: npx tsc --noEmit and any relevant Vitest suite. For visual changes, see Styling Rules.
  • If a test cannot be run in this environment, say so explicitly rather than skipping silently.

Wheel Bump Rules

  • Before changing HEADROOM_PINNED_VERSION: diff upstream savings_tracker.py, prometheus_metrics.py, and server.py between the old and new pins, and check every consumed field against stats_contract_pins_every_consumed_path in state.rs. Upstream has silently redefined persisted savings fields before (0.36.0 widened compression_savings_usd); the savings-rate canary in state.rs is the runtime tripwire, this diff is the compile-time one.
  • Re-pick every platform's wheel URL/sha256 when bumping (see the pin comment in tool_manager.rs).
  • Diff rollout.py's FEATURES registry between the old and new pins. The app declares HEADROOM_ROLLOUT_CHANNEL=beta (tool_manager.rs), so any new feature with default_enabled_in at or below beta auto-enables for every user on the bump; any feature the app requests whose available_in moved above beta silently turns off (this is how 0.37.0 disabled the output shaper on stable).
  • Diff headroom/transforms/ between the pins. This is the compression ENGINE and nothing else in these rules covers it; the 0.35.0 -> 0.37.0 bump changed it by +421 lines and shipped unexamined. Diff it, but do NOT assume a diff means a behaviour change. Bisected 2026-09-02 with a fixed workload replayed on both wheels installed from PyPI (uv venv + uv pip install headroom-ai==<v>, about 3s per version): ContentRouter.compress() AND the full ContentRouter.apply() path returned BYTE-IDENTICAL output on 0.35.0 and 0.37.0 (tok_before 62,384 -> tok_after 57,068, identical transforms list, on both). The engine is EXONERATED. The real production drop (fable-5 500k+: 4.64% / 25,631 tokens per request down to 0.45% / 2,463 at matched model and size) is therefore caused by the INPUT reaching the compressor, not the compressor. Six hypotheses are refuted and must not be restated as fact: the prefix-replay guard (identical on full-replay and floor builds), workload/model mix (matched), the TTL-aware net-cost gate (flag-gated behind HEADROOM_NET_COST_POLICY=1, not set, zero netcost:skip markers across 925 requests), protection rate (0.35 vs 0.32 per request), router acceptance thresholds (min_ratio_* identical), and content granularity (today's messages are BIGGER, 3,053 vs 1,982 tok/msg, which should compress better). What the router logs do show: more messages compressed per request (4.0 -> 5.1) each yielding far less, at an unchanged frozen fraction (86.8% -> 85.2%). Investigate session shape next, not the wheel.
  • The #3380 prefix-floor vendor is exact-pin gated to wheel 0.37.0. Any bump makes it INERT, silently: replay falls back to the full-replay guard, compression drops by roughly half (measured 13,568 -> 6,831 tokens/request on the 0.9.4->0.9.5 swap), and nothing errors. So on every bump, check whether the new wheel actually carries #3380: if it does, delete the vendor; if it does not, re-pin the vendor to the new version and re-run cargo test --manifest-path src-tauri/Cargo.toml --lib vendored_prefix_floor against the installed runtime. That test self-skips when the vendor does not bind, so a green suite is NOT evidence the floor still works after a bump.
  • Three more 0.37.0-pinned vendors live in the same sitecustomize (upstream PRs #3482 thinking signatures, #3483 fresh cache_control, #3484 Kompress marker gate; kill switches HEADROOM_THINKING_SIG_TOKENS, HEADROOM_FRESH_CC_COMPRESS, HEADROOM_KOMPRESS_MARKER_GATE; probe scripts/verify-compression-vendors.py, test compression_vendors_behave_against_the_installed_wheel). On a bump, diff tokenizers/base.py (thinking branch), the router's cache_control skip, and the Kompress marker gate against the new wheel: drop each vendor the wheel carries, re-pin the rest. The probe self-skips when a vendor does not bind, so green is not evidence.
  • When a wheel ships upstream #3460 (conversation clusters in the output-savings ledger), purge BOTH ledger arms once on that bump: extend ledger_bytes_without_control (tool_manager.rs) to treatment under a new stamp. Legacy accumulators carry no clusters so they cannot clear the 5-conversation gate, but the moment new records add clusters the whole accumulator, old requests included, re-enters the mean. Treatment has also accrued since 2026-07 while control was purged 2026-08-19, so the arms describe different months until both restart together. Also drop the holdout boost (output_holdout_for) back to a flat 3% only if the fleet's measured coverage says so; it is evidence-gated per machine on purpose.

Read the full file on GitHub · 53 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. today Changed · +2 lines · +326 tokens per session 117da87e9891
  2. 3d ago Changed · +5 lines · +276 tokens per session 85019c42b1e7
  3. 5d ago Changed · +11 lines · +1,324 tokens per session 71f833aebcb5
  4. 9d ago First seen · 35 lines · 856 tokens per session scan A ae00461fcd3d

Subscribe to this mod's changes

headroom-desktop CLAUDE.md is an instructions file published in the GitHub repository gglucass/headroom-desktop (541 stars, last pushed today), licensed MIT. It adds 2,782 tokens to every session, about $0.0139 per session on Opus 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.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,737 tokens