Your AI coding agent bills by the word and writes like it knows that. Caveman make it stop.
π #1 on GitHub Trending Β· July 2026 Β Β·Β π₯ #1 Repository of the Day on Trendshift Β· April 2026
#1 on Hacker News Β· 904 points Β· 366 comments Β Β·Β #8 Product of the Day on Product Hunt
π Cited in CAVEWOMAN, an Adobe Research paper that measured caveman-style output cutting cost 1.4 to 2.4Γ, up to 3Γ Β Β·Β π§ͺ Tested by JetBrains on 86 real coding tasks: "costs you nothing measurable in quality"
β‘ One command, no account, no API key. npx skills add JuliusBrussee/caveman -g β Quick Start
See it Β· Quick Start Β· The Numbers Β· In the Wild Β· The Skill Β· The Proxy Β· Wrap Β· When to Skip Β· Docs
Same diagnosis. Same fix. Same useMemo. The only thing that died was the throat-clearing.
Code, commands, file paths, and exact error messages never get cavemanned. Only the prose around them does. Security warnings and "are you sure?" confirmations come back in full sentences on their own, then caveman resumes.
Caveman no make brain smaller. Caveman make mouth smaller.
Half the fun is that your agent talks like it just discovered fire. The other half is that it is still right.
A token is what AI billing counts, roughly three quarters of a word. Your agent pays for every token it writes and every token it reads. Most agents write like a cover letter and read like a firehose.
Caveman attacks both ends:
- The skill shrinks what the agent says. One rule file. Free forever. Works in 30+ agents.
- The proxy shrinks what the agent reads: logs, test output, JSON, diffs, search results. Runs on your machine. Every squeezed byte gets a backup, so the agent can always pull the original back.
Started as a joke on a Friday in April 2026. Hit 4,000 stars in a week. Now past 100,000, with a research paper, a JetBrains lab test, and a Primeagen reaction video. The joke got serious. The voice did not.
Caveman come in two sizes. Start small.
A rule file that makes your agent answer in caveman. MIT, free forever, works in 30+ agents (Claude Code, Codex, Gemini, Cursor, Windsurf, Cline, Copilot, more). One command:
npx skills add JuliusBrussee/caveman -gType /caveman if your agent doesn't wake up on its own. That the whole install. One rock.
Runs on your machine, between your agent and the AI provider, and shrinks what the agent reads before every call. MIT CLI, BSL-1.1 runtime:
npm install -g @caveman-ai/cli && caveman setup --install
caveman claude # or codex Β· gemini Β· aider Β· kilo Β· qwen Β· opencode Β· hermes Β· openclaw Β· piThey stack. Most people start with the small rock and graduate.
More doors into the cave Β· full installer, Windows, single agents, uninstall
The full installer wires up Claude Code hooks and the statusline badge, finds every supported agent on your machine, and skips agents you no have. Safe to re-run. Needs Node.js 22.13+.
curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/v2.7.0/install.sh | bashWindows, PowerShell 5.1+:
irm https://raw.githubusercontent.com/JuliusBrussee/caveman/v2.7.0/install.ps1 | iexJust one agent:
# Claude Code
claude plugin marketplace add JuliusBrussee/caveman && claude plugin install caveman@caveman
# Gemini CLI
gemini extensions install https://github.com/JuliusBrussee/caveman
# Qwen Code CLI, then its Caveman wrapper
npm i -g @qwen-code/qwen-code
caveman qwen
# Codex, Cursor, Windsurf, Cline, and other skills-compatible agents
npx skills add JuliusBrussee/caveman --skill '*' -a codex --yes -g # replace codex with your agent profileInstall broke? Open your agent in this repo and say: "Read CLAUDE.md and INSTALL.md, install caveman for me." Agent read repo, agent fix own brain. Snake eat tail.
Changed your mind: npx -y github:JuliusBrussee/caveman -- --uninstall
The full 30+ agent matrix, dry runs, flags, and verification live in INSTALL.md.
Small rock. The skill, right after npx skills add:
- Ask it something. Any coding question. Watch the preamble vanish and the answer stay.
- Turn the dial.
/caveman litefor tight-but-polite./caveman ultrafor grunts./caveman wenyanfor classical Chinese, because someone asked. - Commit like a caveman.
/caveman-commitwrites a Conventional Commit in one line. - Review like a caveman.
/caveman-reviewgives one finding per line:L42: π΄ null deref. Guard it. - Shrink your memory files.
/caveman-compress CLAUDE.mdcuts the prose, keeps every heading, path, and command, and backs up the original. - Come home. Say
stop caveman. Normal prose returns. No hard feelings.
Big rock. The proxy, right after npm install -g @caveman-ai/cli:
- Find out where your tokens go.
caveman learnreads months of agent history already on your disk, locally, and ranks your token sinks worst-first with a one-line fix behind each. Do this before anything else. It is the most useful five minutes in this README. - Let it fix them.
caveman learn implementhands each fix to Claude Code or Codex one diff at a time, applied only on your yes, and reverts anything that did not lower tokens per turn. - Wrap your agent.
caveman claude(orcodex,gemini,aider,opencode,pi, β¦) puts the proxy in front of it. Logs, test output, JSON, and diffs get shrunk before the provider sees them. Originals stay on disk, and the agent can pull any of them back. - Shrink the noisy stuff.
caveman shrink -- pnpm testcompresses command output.caveman browse <url>gives the agent a compressed view of a web page instead of a 15,000-token accessibility dump. - Prove it on your own work.
caveman trial -- clauderuns a real session with and without caveman, thencaveman trial reportshows the difference. That A/B outranks every number on this page. - Shrink caveman itself.
caveman convert --dry-runshows which installed skills get cheaper as PNG pages the model reads as an image. Convert the profitable ones, revert byte-for-byte any time. - Watch the bill.
caveman statsfor history and estimates./caveman-statsinside Claude Code for that session.
Every number below is either from a committed run in this repo or from a named third party. Nothing rounded up. Where a number is small, it says so. Where a row is red, it stays red.
| Who measured | What they measured | Result |
|---|---|---|
| Adobe Research (CAVEWOMAN, arXiv 2606.24083) | Eight models, five datasets, five compression levels | Output-side caveman style cuts realized cost 1.4 to 2.4Γ per model, up to 3Γ in the best case |
| JetBrains | 86 real coding tasks, paired A/B, Claude Code 2.1.200. Skill only, no proxy (July 2026, before the proxy existed) | 8.5% fewer output tokens, about 10% cost. No detectable quality change (sign test p = 0.82) |
| This repo (committed eval snapshot) | Ten dev questions, skill vs a plain Answer concisely. control, claude-opus-4-6 |
50% fewer output tokens at the median on top of the terse control. Length only, not correctness |
Read those three together and you get the honest picture. Chat-style Q&A: big cut. Agentic coding sessions, where most tokens are code and tool calls that the skill never touches: high single digits on output, quality flat.
The JetBrains number is why the proxy exists. They measured the skill alone, in July 2026, before the proxy shipped. Their finding was that an agent's bill is mostly reading, not writing, and no talking style fixes that. So we built the thing that shrinks the reading. The table below is what that changed.
The Adobe paper's other finding matters too: compressing the human's prompt into caveman-speak makes models answer longer and worse. Caveman never rewrites your prompts. Only the agent's mouth.
The rules add input tokens on every call, and whether shorter output pays for them depends on your agent, caching, and billing. Full accounting: docs/HONEST-NUMBERS.md.
No reviewed API benchmark result is published here yet. Run
uv run python benchmarks/run.py to generate a new result, then review its raw
response pairs and quality before publishing the generated table.
Your agent rereads logs, test output, diffs, and half your repo all day. The proxy shrinks that stream before it reaches the provider. Pinned 54-run Claude Code benchmark, provider-reported input tokens, three runs per case, every answer checked against an exact oracle:
| Case | Direct Claude Code | Through caveman | Change |
|---|---|---|---|
| CSV outlier hunt | 165,823 | 74,484 | -55.1% |
| Log needle in haystack | 148,807 | 74,068 | -50.2% |
| YAML config drift | 132,124 | 71,027 | -46.2% |
| Test output failure | 150,377 | 108,514 | -27.8% |
| Deployment JSON drift | 147,975 | 108,939 | -26.4% |
| Dashboard HTML alert | 140,687 | 154,641 | +9.9% |
| Total | 885,793 | 591,673 | -33.2% |
18 of 18 answer checks passed. Case-clustered 95% interval: 14.6% to 48.5%. In the same suite, Headroom's wrap saved 6.7% and failed 3 of 18 checks. Method, provenance hashes, and limits: docs/WRAP-BENCHMARK.md. Raw harness artifacts are not in this checkout, so treat it as a pinned report, not a public reproduction.
Maintainer note. The HTML row is red and it stays red. That case had no compression transform, so caveman paid its own overhead and won nothing back. The day I hide a red row is the day you should stop trusting the green ones.
| Surface | Measured | Number |
|---|---|---|
| Browser pages | Focused question against a 200-row table, vs the Playwright ARIA snapshot | 121 tokens vs 15,704. 129.8Γ smaller. Tiny forms lose 2.3Γ; the benchmark says so |
Memory files (/caveman-compress) |
Five real CLAUDE.md-style fixtures |
46% smaller on average, headings, code, paths, and URLs verified intact |
| The skill itself (pixel mode) | Rendered to PNG pages the model reads as an image | 1,069 to 415 estimated tokens, a 61% cut |
Your harness prefix (subagent-tax) |
What every subagent re-sends before doing any work | On one real machine, 219k of a 267k-char request was tool schemas. Run it on yours |
|
ThePrimeagen Β· "No way this actually works" Adobe Research Β· CAVEWOMAN: How Large Language Models Behave Under Linguistic Input and Output Compression JetBrains Β· Speaking to AI Agents like Cavemen Saves 65% of Tokens. We Test. |
Hacker News Β· #1, 904 points, 366 comments The New Stack Β· Getting Claude Code to grunt in Caveman-speak might not save as many tokens as you think GitHub Trending Β· #1 overall, July 2026 Product Hunt Β· #8 Product of the Day |
One rule file, one talking style, plus a small toolbox. /caveman lite|full|ultra|wenyan-lite|wenyan-full|wenyan-ultra sets intensity. /caveman off or normal mode turns it off.
| Level | Same question: "Why does my React component re-render?" |
|---|---|
| lite | Your component re-renders because you create a new object reference each render. Wrap it in useMemo. |
| full (default) | New object ref each render. Inline object prop = new ref = re-render. Wrap in useMemo. |
| ultra | Inline obj prop, new ref, re-render. useMemo. |
| wenyan-full | ζ―ηΉͺζ°ηε°θ±‘εη §οΌζ ιηΉͺοΌδ»₯ useMemo ε δΉεε γ |
Three things the skill will never do: shorten your code, paraphrase an error message, or grunt through a security warning. It drops to full sentences for anything irreversible, then picks the club back up.
Everything in the box Β· commit messages, reviews, subagents, work patterns
| Tool / command | What you get |
|---|---|
/caveman [lite|full|ultra|wenyan-lite|wenyan-full|wenyan-ultra|off] |
Shorter replies at the intensity you choose. |
cavecrew-investigator, cavecrew-builder, cavecrew-reviewer |
Compressed subagent presets for locating, editing, and reviewing code. |
/caveman-commit |
Terse Conventional Commit messages. |
/caveman-review |
One-line, actionable review findings. |
/caveman-compress <file> |
Smaller Markdown memory files, with the original backed up. |
/caveman-stats |
Recorded Claude Code token usage; savings unknown without a measured comparison. |
/caveman-help |
One-screen reminder of every mode and command. |
investigate-first, lean-build, surgical-patch, safe-refactor, migration, verify-and-stop |
Work patterns that write less code, so the agent bills fewer tokens. Your agent picks these up on its own when a task fits. |
/caveman-setup, /caveman-discover, /caveman-learn, /caveman-manage, /caveman-optimize, /caveman-explore, /caveman-evidence-review |
Drive the caveman engine and proxy: set it up, find where tokens go, act on what it finds. |
One local process. Your agent talks to it, it talks to your provider. No Caveman server in the path, and your Claude Pro/Max login passes through to Anthropic untouched. Originals of everything it compresses sit in a SQLite file on your machine with a recovery handle, so the agent can always ask for the full version back.
Your agent (Claude Code Β· Codex Β· Gemini Β· Aider Β· opencode Β· Pi Β· β¦)
β tool output Β· logs Β· JSON Β· diffs Β· search results
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β caveman proxy (your machine, your keys) β
β detect() β json Β· log Β· code Β· diff Β· search Β· textβ
β originals β local SQLite, recovery handle returned β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β smaller prompt, same answer
βΌ
Your provider (Anthropic Β· OpenAI Β· Google Β· Bedrock Β· Vertex Β· Azure Β· OpenRouter)
Whole team? One container. Same proxy in your VPC, one shared token, keys stay on server. Deploy it β
What the engine keeps, by payload type Β· and the wrap stack diagram
detect() types each payload and routes it to a compressor that keeps what answers depend on:
| Detected type | Keeps | Target savings |
|---|---|---|
json |
keys, structure, error/message subtrees; collapses repetitive arrays | 70-90% |
log |
errors, stack traces, first/last lines; drops INFO and progress noise | 85-95% |
code |
imports, signatures, types; elides function bodies, syntax stays valid | 40-70% |
diff |
file/hunk headers and changed lines; elides repeated context | 60-80% |
search-result |
top/bottom hits plus diagnostic/security hits | 80-95% |
text / HTML |
headings, opening/closing context, important sections | 50-80% |
contextwindow.Pack() additionally fits candidate context into a token budget by BM25 relevance, recency, and error signal, returned in original order so chronology survives.
Any MCP host gets the same powers through five tools: caveman_compress, caveman_retrieve, caveman_stats, caveman_toon_encode, caveman_toon_decode.
Months of your agent history already sit on your disk. caveman learn reads it, locally, read-only, no account, and ranks your token sinks worst-first with a one-line fix behind each.
caveman learn # Claude Code + Codex + Gemini CLI + opencode; aider via CAVEMAN_AIDER_ROOT
caveman learn implement # hand the fixes to Claude Code or Codex, one diff at a time, applied only on your yesimplement re-measures after every change and reverts anything that didn't lower tokens per turn. Caveman never makes your agent dumber to make it cheaper.
caveman explore install # read-only FastContext subagent: finds code as path:line
caveman shrink -- pnpm test # compress noisy command output, byte-exact recoverable
caveman browse <url> # local Chrome over a compressed a11y tree
caveman mem remember|recall # durable memory; `mem recover <handle>` = original bytes
caveman trial -- claude # A/B a real session, then `trial report`
caveman toon encode|decode # the TOON re-encoder, standalone
caveman stats # token history, API estimates, subscription equivalentsCaveman eating its own tail. Every skill you install is prompt text your agent reloads on every call. caveman convert renders the skill body to PNG pages in place, and the model reads it as an image. On the caveman skill itself: 1,069 to 415 estimated tokens, a 61% cut.
caveman convert --dry-run # every installed skill, with the token math, no writes
caveman convert --agent claude # convert the profitable ones
caveman convert --revert # byte-identical restore from SKILL.orig.mdConvert only fires when pages beat the text. Any failure leaves the skill byte-identical and names the gate that said no.
caveman <agent> turns the proxy on for good and launches the agent. caveman wrap <agent> runs one session and leaves nothing behind. It never edits your config files.
| Agent | Vendor | How it's wrapped |
|---|---|---|
| Claude Code | Anthropic | env vars |
| OpenAI Codex CLI | OpenAI | env vars (API key) Β· ephemeral CODEX_HOME (ChatGPT login) |
| Gemini CLI | env vars | |
| Aider | OpenAI/Anthropic | env vars |
| Kilo Code | Kilo Code | KILO_CONFIG_CONTENT, your kilo.json untouched |
| Qwen Code | QwenLM | ephemeral system-settings overlay, source settings untouched |
| opencode | sst | inline config via env, your opencode.json untouched |
| Hermes Agent | Nous Research | --provider custom + env |
| OpenClaw | OpenClaw | ephemeral merged config, your config read-only |
| Pi | pi.dev | bundled native extension, your ~/.pi config untouched |
Fine print Β· tested versions, default loadout, SDK recipes
Tested against real sessions on Hermes v0.18.0, OpenClaw 2026.6.11, Pi 0.84.2, Kilo Code 7.5.6 (the CLI, not the editor extension), and Qwen Code 0.22.3. Persistent shortcuts are journaled and reversible with caveman disable <agent>.
OpenClaw, for the record, is a lobster. Lobster claw still sharp. Lobster mouth now small.
The default wrap hands the agent the five MCP tools, the browse server when Chrome resolves, command-output shrink on Claude, opencode, Gemini, Hermes, and OpenClaw, and pixel mode on new skill installs. Codex skips the shrink hook because its runtime rejects the rewrite (openai/codex#18491). Turn pieces off in ~/.caveman-cloud/config.json.
Agent not on the list? Point any provider SDK or framework (Vercel AI SDK, LangChain, LiteLLM, OpenAI Agents, CrewAI, PydanticAI) at the local proxy with a baseURL swap: integrations/recipes/. New native agent is usually one JSON profile in agents/profiles/.
Good fit if you read your agent's answers more than you paste them somewhere, run long sessions full of logs and test output, or pay per token and want the reading side shrunk without changing your code.
Skip it if you are billed per request rather than per token (GitHub Copilot premium requests, for one: a shorter answer is the same request), or your workload is pure code generation with almost no prose to cut. The ruleset rides along as input tokens on every call (about 1,000 estimated for the full skill), and on terse one-liner Q&A that can cost more than it saves.
Measure it yourself. Run the same task with and without caveman and compare the provider's billing page. That A/B outranks every number on this page. If caveman loses on your workload, turn it off. Full list of where it loses: docs/HONEST-NUMBERS.md.
One idea everywhere: agent do more with less.
| Repo | What it shrinks | Status |
|---|---|---|
| caveman (you here) | What the agent says (skill) and reads (proxy) | live |
| caveman-browse | What the agent sees in the browser | live |
| caveman-agent-sdk | What your production agent loads, calls, and spends | own repo Β· in dev |
| cavegemma | The compression baked into weights (Gemma fine-tune) | labs |
| caveman-code | The whole agent, end to end | frozen |
| cavemem | What the agent remembers, across sessions | frozen |
| cavekit | The build loop, spec-driven | frozen |
Frozen ones still install and work. Their best ideas moved in here.
Caveman make token small. Caveman Cloud make it provable. Local numbers are inferred, pinned benchmarks benchmark_counterfactual, neither is an invoice. Live traffic behind eval gates with signed receipts earns verified. That's Cloud. Waitlist at caveman.so
Your agent still talks to the provider you chose. The skill and hooks run entirely on your machine, and nothing here needs an account.
The caveman CLI does send anonymous usage stats by default, and here's the honest why: caveman is free, one person maintains it, and those stats are how I find out which commands people actually use and which optimizations run in real workflows. That's what keeps this thing free and pointed in the right direction. Fair trade, we think.
What it sends: which commands ran, plus token counts through and cut. What it never sends: your prompts, your code, your file paths, or anything that could identify you. It tells you all this the first time you run it.
Not into it? One command and it's off forever, no hard feelings:
caveman telemetry off # or set DO_NOT_TRACK=1Exact network, telemetry, and storage boundaries: SECURITY.md.
Split license. Skill and adoption surfaces are MIT. Engine-linked runtime is BSL-1.1 source-available, not OSI Open Source before Change Date.
MIT: the skill, Agent SDK and initializer, the CLI, both client SDKs, contracts, provider catalog, extension shell, and the thin cavemem clients. Free like mammoth on open plain.
BSL-1.1: Engine, Proxy, Cache Engine, rewriter, Browse, MCP server, shrink, cavemem Go core, and shared Go platform. New Engine-linked runtime modules default to BSL-1.1. Read it, fork it, self-host it for your own first-party traffic free, production included. Each version converts to Apache-2.0 on the earlier of 2030-06-21 or four years after it ships. Hosting it for third parties needs a commercial license.
engine/pixel embeds pxpipe (MIT) plus glyph atlases derived from Spleen 5Γ8 (BSD-2-Clause) and GNU Unifont (dual OFL-1.1 / GPLv2-with-font-exception); its NOTICE travels with that source.
"Caveman" and the rock logo are trademarks of Julius Brussee. "Powered by Caveman" is fine when true.
If caveman shows up in your paper, the way it showed up in Adobe's:
@software{brussee2026caveman,
author = {Brussee, Julius},
title = {Caveman: why use many token when few do trick},
year = {2026},
url = {https://github.com/JuliusBrussee/caveman}
}Caveman save you token, save you money. Star cost zero. Fair trade. β
Docs: Technical manual Β· Install matrix Β· Honest numbers Β· Wrap benchmark Β· License Β· Contributing Β· Maintainer guide Β· Issues
MIT skill Β· BSL-1.1 engine. Few token. No lie.


