Original skill made agents say less. Caveman 2 makes them read less too. 33.2% fewer provider-reported input tokens in a pinned Claude Code benchmark.benchmark_counterfactual
Keep your agent. Brain big. Context small.
The reason your React component is re-rendering is likely because you're creating a new object reference on each render cycle. When you pass an inline object as a prop, React's shallow comparison sees it as a different object every time, which triggers a re-render. I'd recommend using useMemo to memoize the object.
New object ref each render. Inline object prop = new ref = re-render. Wrap in useMemo.
Install
Two products. Pick one or both.
1 · Save input — Caveman Proxy shrinks what your agent reads before every provider call, with byte-exact recovery. BSL-1.1 runtime, MIT CLI.
# Claude Code
claude plugin marketplace add JuliusBrussee/caveman && claude plugin install caveman@caveman
# Gemini CLI
gemini extensions install https://github.com/JuliusBrussee/caveman
# Codex, Cursor, Windsurf, Cline, and other skills-compatible agents
npx skills add JuliusBrussee/caveman --skill '*' -a codex --yes# replace codex with your agent profile
Full 30+ agent matrix, dry run, flags, verification, and uninstall: INSTALL.md.
Where your tokens go
You have months of agent history on disk. caveman learn reads it and scores your setup. Local, read-only, no account.
caveman learn # Claude Code + Codex + Gemini CLI + opencode; aider via CAVEMAN_AIDER_ROOT
The report shows your Cave Score, every token sink ranked by flow with a one-line fix behind each row, how deep each session ran into its context window, a replay of what the fixes would have cut from your past sessions, and a list-price illustration of what the ranked sinks cost over 30 days.
caveman learn implement # hand the plan to Claude Code or Codex
learn implement opens your own agent with the plan and the caveman-learn skill, which instructs it to propose each fix as a diff, apply only on your yes, re-measure, and revert anything that did not lower tokens per turn. Caveman never makes your agent dumber to make it cheaper.
Caveman Proxy
One command wraps your agent and routes provider traffic through a local proxy powered by Caveman Engine. In a pinned 54-run Claude Code benchmark it used 33.2% fewer provider-reported input tokens than direct Claude Code while passing all 18 exact-answer checks. Method, per-case results, and limits.benchmark_counterfactual
No code change, no Caveman backend: the proxy forwards each request to your chosen provider, and recovery copies stay on your disk. Claude Pro/Max OAuth credentials pass through to Anthropic as-is.
caveman claude # Claude Code + Codex + Gemini CLI + opencode; aider via CAVEMAN_AIDER_ROOT
What the engine does to a payload — detect() types each payload, then routes it to a compressor that keeps what answers depend on:
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.
The same engine powers a set of verbs:
caveman learn # scan your real agent history → score + ranked token sinks
caveman learn implement # fix the findings with your own agent, consent-gated per edit
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 # what caveman actually did, by content type
The MCP server exposes five tools to any MCP host: caveman_compress, caveman_retrieve, caveman_stats, caveman_toon_encode, caveman_toon_decode.
On browse (needs Chrome): a focused query against a 200-row operations table costs 121 tokens, 129.8× smaller than the Playwright ARIA baseline of 15,704. Full method: browse/BENCHMARK.md.
Pixel mode
Skills as images
Full circle: the engine now compresses the thing caveman started as. Every fat skill you install re-loads its whole prompt body on every invocation, and you pay that tax forever. caveman convert renders each installed SKILL.md body to PNG pages in place. Frontmatter stays text, so discovery and triggering work exactly as before; the model reads the body as an image.
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.md
Measured on the caveman skill itself: 1,069 → 415 est. tokens, −61%. Convert only fires when pages beat the text; any failure leaves the skill byte-identical and names the gate that said no. New skills installed through caveman skills install auto-pixel by default (--no-pixel to opt out).
The skill
The original, and still the fastest way to feel caveman. MIT forever. Works in Claude Code, Codex, Gemini, Cursor, Windsurf, Cline, Copilot, and 30+ other agents.
Type /caveman if your agent does not activate it automatically. Switch with /caveman lite|full|ultra|wenyan-lite|wenyan-full|wenyan-ultra; turn it off with /caveman off or normal mode.
Drive the caveman engine and proxy: set it up, find where tokens go, act on what it finds.
Task
Normal
Caveman
Saved
Explain React re-render bug
1180
159
87%
Fix auth middleware token expiry
704
121
83%
Set up PostgreSQL connection pool
2347
380
84%
Explain git rebase vs merge
702
292
58%
Refactor callback to async/await
387
301
22%
Architecture: microservices vs monolith
446
310
30%
Review PR for security issues
678
398
41%
Docker multi-stage build
1042
290
72%
Debug PostgreSQL race condition
1200
232
81%
Implement React error boundary
3454
456
87%
Average
1214
294
65%
[!IMPORTANT]
Honest number warning. The skill only shrinks output tokens. Input and reasoning tokens are untouched, and the skill itself adds ~1–1.5k input tokens per turn. Whole-session savings run smaller than the output number, and on already-terse workloads they can go net-negative. The real win is readability and speed; cost savings are the bonus. When caveman wins, when it loses, and how to measure it yourself: docs/HONEST-NUMBERS.md.
Wrap any agent
caveman <agent> persistently enables supported native integration, then launches agent. caveman wrap <agent> runs ephemeral session. Adding one is a data change, a single JSON profile in agents/profiles/, no code.
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
Google
env vars
Aider
OpenAI/Anthropic
env vars
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
caveman wrap never edits host config files. Persistent shortcut writes are journaled and reversible with caveman disable <agent>. Real sessions round-trip in record mode, tested against Hermes v0.18.0, OpenClaw 2026.6.11, and Pi 0.84.2.
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/.
The default wrap hands the agent the whole loadout: the five caveman MCP tools, the browse MCP server when Chrome resolves, command-output shrink through a real hook on Claude, opencode, Gemini, Hermes, and OpenClaw (Codex gets an honest soft note, its runtime rejects the rewrite: openai/codex#18491), and skills-as-images on new skill installs. Turn pieces off in ~/.caveman-cloud/config.json.
Frozen repos still install and work; they are no longer in active development. Their best ideas live on here: cavemem's compressed-memory core ships inside caveman, and caveman-code's lesson became caveman wrap. Make the agent you already use cheaper instead of replacing it.
Caveman make token small. Caveman Cloud make it provable.
Local runtime results report inferred; controlled benchmark results report benchmark_counterfactual. Neither is a provider invoice. Caveman Cloud is where qualifying live evidence can become verified: baseline in record mode, changes behind eval gates, rollback on quality loss, savings from real traffic with signed receipts. Offline caveman never says verified.
Your agent still talks to the provider you chose. Local compression needs no Caveman account. The caveman CLI sends anonymous usage stats by default: which commands ran, plus token counts through and cut. Never your prompts, code, or file paths. It says so on first run, and one command turns it off forever: caveman telemetry off (or DO_NOT_TRACK=1). Skill and hooks run locally; the proxy forwards provider traffic; CCR stays in a SQLite file on your disk. Exact network, telemetry, and storage boundaries: SECURITY.md.
License
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 (TS + Python), contracts, provider catalog, the extension shell, and the thin cavemem clients.
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. Source-available: read it, fork it, self-host it for your own first-party traffic free, production included. Every BSL version auto-converts to Apache-2.0 on the earlier of 2030-06-21 or four years after that version first ships. Third-party hosted, managed, or embedded service use needs commercial license. BSL text and per-directory map ship with source.
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.
Star this repo
Caveman save you token, save you money. Star cost zero. Fair trade. ⭐