headroomlabs-ai/headroom
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
The score is jscpd's own --health model: markup, data and text left out, tests kept. The numbers below are the trending scan's.
Most complex files
- headroom/providers/opencode/_dist/index.js3719 cx
- headroom/proxy/handlers/openai.py1649 cx
- headroom/cli/wrap.py1270 cx
- headroom/transforms/content_router.py1019 cx
- headroom/proxy/server.py919 cx
- headroom/proxy/handlers/anthropic.py756 cx
- headroom/proxy/helpers.py732 cx
- headroom/memory/traffic_learner.py419 cx
- headroom/proxy/handlers/streaming.py417 cx
- crates/headroom-core/src/transforms/log_compressor.rs410 cx
Dead code 0.71% unused · 88 findings
- headroom/evals/html_extraction.pyunused-file
- deploy/beacon/worker.jsunused-file
- headroom/evals/html_oss_benchmarks.pyunused-file
- plugins/headroom-snip/hooks/register.tsxunused-file
- headroom/transforms/adaptive_sizer.pyunused-file
- headroom/learn/plugins/opencode.pyunused-file
- deploy/beacon/test-rollup.mjsunused-file
- headroom/shared_context.pyunused-file
- headroom/learn/plugins/grok.pyunused-file
- headroom/integrations/litellm_callback.pyunused-file
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code, and 4 generated files: headroom/dashboard/static/alpine.min.js, headroom/dashboard/static/tailwind.min.js, headroom/transforms/dense_line_elider.py, tests/test_content_router_compact_json.py.
Largest clones in the code
- 10 lines in 23 placesjavascript51 tokensheadroom/providers/opencode/_dist/index.js:4057–4066headroom/providers/opencode/_dist/index.js:4333–4342headroom/providers/opencode/_dist/index.js:4575–4584headroom/providers/opencode/_dist/index.js:4843–4852headroom/providers/opencode/_dist/index.js:5345–5354and 18 more
4057 set: { unit: "\u0639\u0646\u0635\u0631", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" } 4058}; 4059function getSizing(origin) { 4060 return Sizable[origin] ?? null; 4061} 4062const parsedType7 = (data) => { 4063 const t = typeof data; 4064 switch (t) { 4065 case "number": { 4066 return Number.isNaN(data) ? "NaN" : "number";4333 } 4334}; 4335function getSizing(origin) { 4336 return Sizable[origin] ?? null; 4337} 4338const parsedType7 = (data) => { 4339 const t = typeof data; 4340 switch (t) { 4341 case "number": { 4342 return Number.isNaN(data) ? "NaN" : "\u043B\u0456\u043A"; - 14 lines in 23 placesjavascript51 tokensheadroom/providers/opencode/_dist/index.js:4201–4214headroom/providers/opencode/_dist/index.js:4482–4495headroom/providers/opencode/_dist/index.js:4620–4633headroom/providers/opencode/_dist/index.js:4751–4764headroom/providers/opencode/_dist/index.js:5252–5265and 18 more
4201email: "email address", 4202url: "URL", 4203emoji: "emoji", 4204uuid: "UUID", 4205uuidv4: "UUIDv4", 4206uuidv6: "UUIDv6", 4207nanoid: "nanoid", 4208guid: "GUID", 4209cuid: "cuid", 4210cuid2: "cuid2",First 10 of 14 lines.
- 166 lines in 2 placesjavascript1,111 tokensheadroom/providers/opencode/_dist/index.js:12757–12922headroom/providers/opencode/hook-shim/handler.js:266–431
12757 return new URL(`${protocol}//${hostname3}${port}${path}`); 12758 } catch { 12759 return void 0; 12760 } 12761} 12762function headersForNodeRequest(options, upstream, originalPath, project, sessionToken) { 12763 const headers = new Headers(options.headers); 12764 headers.set(BASE_URL_HEADER, upstream.origin); 12765 if (originalPath) { 12766 headers.set(ORIGINAL_PATH_HEADER, originalPath);First 10 of 166 lines.
7 more
- 14 lines in 19 placesjavascript52 tokens
- 27 lines in 8 placesjavascript122 tokens
- 158 lines in 2 placessql832 tokens
- 101 lines in 2 placesjavascript686 tokens
- 68 lines in 2 placesjavascript531 tokens
- 42 lines in 2 placesjavascript301 tokens
- 48 lines in 2 placespython284 tokens
Largest clones over all files, tests and data included
- 18 lines in 24 placesjsontests63 tokenstests/parity/fixtures/code_aware_compressor/07dd1a61089c1e53.json:1–18tests/parity/fixtures/code_aware_compressor/095be1adad76b588.json:1–18tests/parity/fixtures/code_aware_compressor/1e319c5e33af4af1.json:1–18tests/parity/fixtures/code_aware_compressor/2c239d4af41282c2.json:1–18tests/parity/fixtures/code_aware_compressor/2d214f401618d639.json:1–18and 19 more
1{ 2 "config": { 3 "ccr_ttl": 300, 4 "compress_comments": true, 5 "docstring_mode": "first_line", 6 "enable_ccr": false, 7 "fallback_to_kompress": false, 8 "language_hint": null, 9 "max_body_lines": 5, 10 "min_tokens_for_compression": 100,First 10 of 18 lines.
- 10 lines in 23 placesjavascript51 tokensheadroom/providers/opencode/_dist/index.js:4057–4066headroom/providers/opencode/_dist/index.js:4333–4342headroom/providers/opencode/_dist/index.js:4575–4584headroom/providers/opencode/_dist/index.js:4843–4852headroom/providers/opencode/_dist/index.js:5345–5354and 18 more
4057 set: { unit: "\u0639\u0646\u0635\u0631", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" } 4058}; 4059function getSizing(origin) { 4060 return Sizable[origin] ?? null; 4061} 4062const parsedType7 = (data) => { 4063 const t = typeof data; 4064 switch (t) { 4065 case "number": { 4066 return Number.isNaN(data) ? "NaN" : "number";4333 } 4334}; 4335function getSizing(origin) { 4336 return Sizable[origin] ?? null; 4337} 4338const parsedType7 = (data) => { 4339 const t = typeof data; 4340 switch (t) { 4341 case "number": { 4342 return Number.isNaN(data) ? "NaN" : "\u043B\u0456\u043A"; - 14 lines in 23 placesjavascript51 tokensheadroom/providers/opencode/_dist/index.js:4201–4214headroom/providers/opencode/_dist/index.js:4482–4495headroom/providers/opencode/_dist/index.js:4620–4633headroom/providers/opencode/_dist/index.js:4751–4764headroom/providers/opencode/_dist/index.js:5252–5265and 18 more
4201email: "email address", 4202url: "URL", 4203emoji: "emoji", 4204uuid: "UUID", 4205uuidv4: "UUIDv4", 4206uuidv6: "UUIDv6", 4207nanoid: "nanoid", 4208guid: "GUID", 4209cuid: "cuid", 4210cuid2: "cuid2",First 10 of 14 lines.
- 166 lines in 2 placesjavascript1,111 tokens
- 22 lines in 20 placesjsontests58 tokenstests/parity/fixtures/cache_aligner/0225460359a992d9.json:1–22tests/parity/fixtures/cache_aligner/231ab237501e106b.json:1–22tests/parity/fixtures/cache_aligner/25683f67cbb74ece.json:1–22tests/parity/fixtures/cache_aligner/31eb80356eeeb30d.json:1–22tests/parity/fixtures/cache_aligner/336311b995b063d5.json:1–22and 15 more
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 604 | 266,263 | 393 | 5,273 | 1.98% |
| rust | 154 | 72,268 | 226 | 2,538 | 3.51% |
| javascript | 7 | 14,779 | 126 | 1,991 | 13.47% |
| typescript | 36 | 6,783 | 10 | 140 | 2.06% |
| powershell | 2 | 2,000 | 8 | 88 | 4.4% |
| sql | 4 | 461 | 1 | 158 | 34.27% |
| bash | 20 | 3,179 | 0 | 0 | 0% |
| tsx | 1 | 336 | 0 | 0 | 0% |
| c | 1 | 170 | 0 | 0 | 0% |
| perl | 1 | 168 | 0 | 0 | 0% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| python | 1,680 | 620,911 | 1,906 | 25,446 | 4.1% |
| rust | 216 | 89,993 | 593 | 6,913 | 7.68% |
| json | 212 | 11,270 | 128 | 2,732 | 24.24% |
| javascript | 7 | 14,779 | 126 | 1,991 | 13.47% |
| typescript | 95 | 18,998 | 98 | 1,095 | 5.76% |
| yaml | 39 | 5,560 | 25 | 281 | 5.05% |
| markdown | 93 | 26,699 | 18 | 208 | 0.78% |
| powershell | 6 | 2,050 | 8 | 88 | 4.29% |
| text | 24 | 933 | 7 | 26 | 2.79% |
| markup | 7 | 4,399 | 5 | 62 | 1.41% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Oct 20, 2026 | #3 | 76,359 (+310) | 2,476 | 805,989 | 2,922 | 4.85% | 2.78% | C 65.2 | fbf7bc3 |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.