What we do
Caveman cuts the cost of every agent turn.Caveman Cloud shows what every run costs, finds the waste, and improves it on Autopilot.
Agents you run
- Claude Code
- Codex
- OpenCode
- and more
Agents you build
- { }Your app
- TypeScript · Python
Caveman
Reads less · Says less · Picks the model
Tested fixes ↑
Models
- Anthropic
- OpenAI
- Gemini
Caveman Cloud
- Finds waste live
- Tests each fix
- Proves the saving
01Free and open source
All of CavemanCaveman
For the agents you run, and the ones you build.
- For
- Developers. No caveman experience required.
- Runs
- Entirely locally, or in your production apps.
- Works with
- 30+ coding agents, and the TypeScript or Python app you build.Claude CodeCodexOpenCodeGemini CLITypeScriptPython
- Price
- $0Adaptive model selection needs a free Caveman account.
Caveman / Agents you run
Claude Code, Codex, OpenCode. Any model.Half the bill.
Keep the agent you use. Caveman trims what every turn reads and writes, and hands each task to the cheapest model that gets it right.
- Fig 1.1SCANNER
HOVER TO SCRUBtest.log · 18,240 → 201 tok Reads less.
Logs, test output, JSON and diffs shrink before the model reads them. The original stays on disk if it asks.
33.2% fewer input tokenswhole sessions, 18 of 18 answers right
- Fig 1.2SHREDDER
HOVER TO FEED FASTERwords 30 → 8 Says less.
Answers drop the filler. Code, commands and errors come back byte for byte.
65% less readable output≈ −10% of total tokens on long-horizon coding tasks
- Fig 1.3GATE
HOVER TO SLOW TIMErate 1.00× Picks the model.
Adaptive model selection gives every turn the cheapest model and effort that gets it right. Hard work still gets the frontier one.
0.46× the cost per taskSWE-Interact + SWE-Together, 85 paired tasks vs always-Opus, same solve rate
Caveman / Agents you build
You built your agent.Keep every part of it.
Caveman sits where tool results become model input. Your framework still runs the show. Your provider still gets the call.
- Smaller tool results. Eligible logs, JSON, diffs and documents shrink before the model call.
- The original stays in reach. In supported agent loops, the model can ask for the exact original.
- Nothing else changes. A local runtime runs beside your app. Same framework, provider, keys and saved history.
1import { streamText } from "ai";2import { createMiddlewareRuntime } from "@caveman-ai/sdk/middleware";3import { withCaveman } from "@caveman-ai/middleware/ai-sdk";4 5const runtime = createMiddlewareRuntime({6 endpoint: "http://127.0.0.1:8787",7 mode: "compress",8});9await runtime.ready();10 11const scope = {12 namespace: "my-app",13 session_id: conversationId,14 branch_id: "main",15 cache_epoch: "0",16};17 18const result = streamText(19 withCaveman(existingOptions, { runtime, scope }),20);$npm install @caveman-ai/middleware @caveman-ai/sdk
$npm i -g @caveman-ai/cli && CAVEMAN_MODE=compress caveman start
Vercel AI SDK · OpenAI · Anthropic · Google GenAI · LangChain · Strands · Mastra · MCP
Caveman / What people said
It started as a joke that made agents talk like cavemen.Then it went to #1 on Hacker News and #1 on GitHub Trending.
- GitHub stars, live
- 108,463
- points on Hacker News
- 904
- on GitHub Trending
- #1
- Free and open source
- Apache-2.0
“It is fun, and it costs you nothing measurable in quality.”
“A senior OpenAI employee has contributed code to the project, simply called ‘caveman.’”
“Turns out, you can understand the caveman output just fine.”
“The Elastic-Caveman initiative has successfully optimized AI response size without compromising quality or functionality.”
Verbatim excerpts, each linked to its source. Community reactions are not benchmarks.
02Free to start
All of Caveman CloudCaveman Cloud
See what every agent run costs, cut the waste, and improve on Autopilot.
- For
- The company paying for the agents
- Runs
- Hosted, or in your VPC on Enterprise
- Works with
- Coding agents, your own SDK calls, LiteLLM
- Price
- $0For one person, no card needed. Team is $300 a month after a 7-day free trial.
01Analytics
See what every agent costs.
One bill, split by agent, model and day.

- 1What your agents cost over the last 30 days.
- 2Each colour is one agent. Taller bar, bigger bill.
- 3Money Caveman saved you. Green means verified.
02Traces
Every request, on the record.
Look up any call your agents made, and what it cost.

- 1Every single request your agents made.
- 2See which ones failed, and what each cost.
03Team
See who uses what.
Spend for each coding agent, across everyone on your team.

- 1How much your team uses each coding agent.
- 2What each coding agent costs you.
04Improvements
Caveman finds the waste.
Every fix it suggests says what it would save you.

- 1Caveman spotted waste and put a price on it.
- 2It tries the fix on your old requests first.
- 3Autopilot tries fixes on a little traffic, undoes bad ones. You approve.
05Evals
Evals so easy, a caveman could do it.
Your own requests become tests, and every change gets graded.

- 1Your real requests become tests.
- 2Every change gets graded before it ships.

- 3Pass the checks and Autopilot unlocks.

Caveman Cloud / Govern
Set the limits.Keep the record.
Soft and hard caps per project, rate limits per key and workflow, and rules that mask or block what should never reach a model. Changes land in the audit log.
Open governance in the demo

One place for the controls.
Keys, model access, guardrails and data retention, with the month’s budget beside them.
Budgets that warn the owner
Cross a soft cap or reach a hard cap, and owners and admins get an Inbox item and an email.

An audit log for every change
Budgets, guardrails, keys and roles: who changed what, and when.
Getting started
Before you install.
What to try first, what stays in place, and how to check the result.
What does Caveman do?
Caveman helps AI agents do the same work with fewer tokens. It asks for shorter replies, compresses eligible context and keeps the original available for recovery. Start with the part that matches your workload, then compare completed tasks before and after.
Find the right cost reductionCan I keep my coding agent?
Yes. Caveman wraps supported agents including Claude Code, Codex, and Gemini CLI. Shorter replies also work in agents such as Cursor. Support for shorter replies and for context compression differs by agent, so check the setup guide for yours before installing.
Check your agent's setupDo I need a Caveman account?
The local CLI, shorter replies and context compression work without a Caveman account. You still need the credentials or subscription required by your model provider or coding agent. Adaptive model selection needs a free account. Caveman Cloud needs an account, which you can open at app.caveman.so/signup.
Set up the local toolsWill fewer tokens lower my bill?
It depends on how you pay. Fewer billable tokens can reduce metered API spend, but cached input, retries, and recovery calls affect the result. A flat monthly subscription may cost the same. Compare total cost per successful task and check provider billing before claiming savings.
Measure cost per successful taskCan I use Caveman with my existing AI gateway?
Often, yes. Gateways handle jobs such as credentials, routing, and traffic policies. Caveman's local tools can reduce eligible context before it reaches a gateway. Compatibility depends on the API path and recovery support. Each switching guide covers a bounded trial, validation, and rollback.
Compare your current stackCaveman / Savings
Put a dollar on it.Your team. Your spend.
Estimate · saved per month
$104,394 a year · bill $12,500 → $3,801
How we count
Each layer has its own basis, below. Here the layers are multiplied, one after another. They were not measured together.
- Reads less 33.2%
- Fewer input tokens. Whole sessions, 6 tasks, 18 of 18 answers right.
- Says less ≈10%
- 65% fewer readable output tokens on a 10-prompt benchmark. Readable output is a small part of a long coding task, so the calculator counts ≈10% of total tokens on long-horizon coding tasks, our own estimate.
- Picks the model 0.46×
- The cost per task, with adaptive model selection. Measured on SWE-Interact and SWE-Together: 85 paired agentic coding tasks, routed Claude Code vs always-Opus 5.5 at max effort, same solve rate. Interim run, list-price estimates.
- Keeps the script up to 9.57%
- Of task cost. Purdue's published ceiling for the share spent rewriting scripts. Blocks is pre-release.
Assumes 80% of agent spend is input tokens and 20% is output. If your team already runs models cheaper than Opus at max effort, routing saves less.
$12,500 × (0.8 × 0.668 + 0.2) × 0.9 × 0.46 = $3,801
The new Caveman
Get the full optimization stack.
Reads less. Says less. Picks the model. Keeps the script. One install, in the agent you already run.
Caveman Cloud for your team · Free to start
