agentleFS
chopratejaschopratejas/headroom/AGENTS.md

headroom

AGENTS.md79k starsChanged 2 months agoApache-2.0View on GitHub

The PyPI package is headroom-ai; the import and the CLI are headroom. In-process, no API key, no model download. HEADROOM_OFFLINE=1 makes the run zero-network (no update check, no model or pricing-table downloads, no beacon). Verify without a provider key:

  • Installs packages

1 other project uses a version of this.

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 4 mentionsFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 2 mentionsMay 2026: 6 mentionsJun 2026: 71 mentionsJul 2026: 4 mentionsAug 2026: 5 mentionsSep 2026: 9 mentionsOct 2026: 4 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the chopratejas/headroom repository that our weekly crawl found. There is no adoption data for this file yet.

Most recently taken up by

Who's talking about chopratejas/headroom

The biggest 5 of 106 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 106

Talked about on GitHub, YouTube, Bluesky, Hacker News and the web (106 times).

On GitHub · 50

45 more on GitHub

On YouTube · 25

20 more on YouTube

On Bluesky · 20

15 more on Bluesky

On the web · 2

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. headroomlabs-ai/headroom★ 79k100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository3 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify without a provider key:

    line 20
  2. Distinctive:

    Every external PR needs a "Real behavior proof" section (setup, exact commands, observed output, what was not tested).

    line 37

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

If you landed here to use Headroom in an app

The PyPI package is headroom-ai; the import and the CLI are headroom.

pip install headroom-ai
from headroom import compress

result = compress(messages, model="gpt-4o")  # OpenAI or Anthropic message dicts
# send result.messages instead of messages; log result.tokens_before / tokens_after / tokens_saved

In-process, no API key, no model download. HEADROOM_OFFLINE=1 makes the run zero-network (no update check, no model or pricing-table downloads, no beacon). Verify without a provider key:

HEADROOM_OFFLINE=1 python -c "from headroom import compress; log='\n'.join(f'INFO step {i} ok' for i in range(3000))+'\nFATAL disk full'; r=compress([{'role':'user','content':'What failed?'},{'role':'assistant','content':None,'tool_calls':[{'id':'c1','type':'function','function':{'name':'logs','arguments':'{}'}}]},{'role':'tool','tool_call_id':'c1','content':log}], model='gpt-4o'); print(r.tokens_before, '->', r.tokens_after, 'FATAL kept:', 'FATAL' in str(r.messages))"
  • FastAPI example: https://docs.headroomlabs.ai/docs/fastapi
  • Full docs index for agents: https://docs.headroomlabs.ai/llms.txt (hand-curated subset: llms.txt in this repo)
  • Coding agents (Claude Code, Codex, Cursor, Copilot): uv tool install --python 3.13 "headroom-ai[all]" then headroom wrap claude
  • headroom.integrations.asgi.CompressionMiddleware is for apps that serve /v1/chat/completions-style routes, not for an app that calls a provider; use compress() for that
  • Canonical repo: https://github.com/headroomlabs-ai/headroom. github.com/chopratejas/headroom redirects here; there is no headroom-sdk org. The PyPI distribution named headroom is a different project.

If you are changing this repo

  • Layout: Python package in headroom/, Rust core and PyO3 extension in crates/ (built by maturin), TypeScript SDK in sdk/typescript/, docs site (Next.js + Fumadocs) in docs/content/docs/, agent plugins in plugins/, examples in examples/.
  • Setup: uv sync --extra dev and make install-git-hooks (pre-commit, commitlint, pre-push). Python checks: uv run ruff check ., uv run ruff format ., uv run pytest. Rust checks: make ci-precheck-rust. All gates: make ci-precheck. See CONTRIBUTING.md.
  • Commits and PR titles are Conventional Commits (feat:, fix:, docs:, ...). Never edit CHANGELOG.md; release-please writes it from PR titles.
  • Every external PR needs a "Real behavior proof" section (setup, exact commands, observed output, what was not tested). Bug fixes need a test that fails before the fix.
  • One docs site: docs/, deployed by Vercel to docs.headroomlabs.ai. wiki/ and the gh-pages branch are not published; do not add content there.
  • Public API examples in README.md, llms.txt, AGENTS.md and docs/ must use names that exist in headroom/compress.py (compress, CompressResult.messages, .tokens_before, .tokens_after, .tokens_saved, .compression_ratio, .transforms_applied).
  • Savings claims anywhere in the repo must match the measured table under "Proof" in README.md: 21-57% on the four agent scenarios, 90%+ on repeated JSON arrays and log lines, little on prose.
  • Version-carrying files (pyproject.toml, plugin and marketplace manifests, sdk/typescript/package.json, server.json) are kept in step by scripts/version-sync.py and gated by scripts/verify-versions.py; add any new one to both.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.