caveman

JuliusBrusseeApache-2.0活跃维护

给编码 Agent 用的代理和技能,让模型用「原始人式」极简表达回答,砍掉约 65% 的 token 消耗。

🪨 why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.

v4.1.0发布于 2026-11-08 04:17 UTC118,879star +828 / 7 天6,915fork同步于 2026-11-10 23:18 UTC

怎么上手

由 README 提炼,执行前请确认
npx @caveman-ai/cli@latest
硬件要求按 README 说明

README 未说明显存或 GPU 要求;安装需要 Node.js 22.13+,支持 Mac、Linux、Windows,在本地用你自己的密钥和 Claude Pro/Max 登录运行。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

给编码 agent 用的省 token 技能与代理,让 agent 少说少读,代码保持原样

给编码 Agent 用的代理和技能,让模型用「原始人式」极简表达回答,砍掉约 65% 的 token 消耗。

核心能力

  • 用穴居人式简短回答压缩输出,代码与命令逐字保留
  • 在模型读取前压缩日志、JSON、CSV、测试输出等大文件
  • Auto 模式按任务难度自动选模型和推理强度
  • Blocks 代码模式复用已写脚本,避免重复生成
  • 支持 30+ 种 agent,一条命令自动识别并配置

容易踩的坑

需要 Node.js 22.13+,旧版本安装的副本会覆盖新版,需显式加 @latest;npm 12 及以上默认禁止 git 安装,旧版一行命令会失败;Auto 模式需要注册账号(免费),只想要简短回答可单独装 skill 而不装代理。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v4.1.0
  1. v4.1.0Caveman 4.1.0最新正式版2026-11-08 · 2026-11-08 04:17 UTC

    Caveman 4.1.0 is a maintenance release: bug fixes across compress, OpenCode, Hermes, Pi, the proxy and the hooks, a recovery store that no longer fills up and stops compressing, and a few small switches people asked for. caveman-compress now refuses a file with a key or token in it, and installs from skill hubs again.

    Action needed

    • forward_headers under a providers.<name> block now stops the proxy from starting. Before, it was silently ignored: no headers were forwarded and the only symptom was an upstream 401. Configure that upstream as a compat mount instead: compat.<name> with base_url and forward_headers, plus wire_dialect: anthropic if it speaks the Anthropic protocol (see docs/technical/configuration.md) (#1458).
    • caveman-compress refuses a file whose text holds a credential, such as a private key block or a cloud, Git host or model API token. Compression sends the file to your model provider, so move the secret into an env var or secret manager first. The error names the line, never the secret. Placeholders like sk-... or $OPENAI_API_KEY still compress (#1471).

    Changed

    • Old recovery handles can now expire. The recovery store used to keep every compressed original forever, so it filled up and compression stopped (#1370). When a write would exceed the store's cap, it now frees room: typed objects of sessions idle 14 days (archived) or 30 days (any) are expired, oldest first, until the store is at 80%. Retrieving an expired handle answers cave_expired_recovery, and each expiry is logged in proxy.log. Blob recoveries never expire (#1481).

    New

    • caveman-proxy recovery-store status|check|repair for a damaged ccr.db. A damaged store now refuses writes instead of staying corrupt across upgrades; reads keep working. Repair copies only rows whose bytes still match their hash, and moves the damaged files aside untouched. caveman status and caveman doctor point at it (#1369, #1481).

    • Turn off the per-prompt reminder with CAVEMAN_REINFORCE=0, or "reinforce": false in ~/.config/caveman/config.json or a repo's .caveman.json. The full ruleset is still sent at session start (#1468).

    • --hook-node node makes installed hooks find Node through PATH at run time instead of pinning the install-time path, for people who switch Node versions (#1452). The default is unchanged, because apps started outside a terminal don't see the shell's PATH.

    • The installer falls back to Bun when Node is absent. Node stays first (#570, #1344 by @cyrus-za).

    • caveman learn scans Pi sessions, and honors PI_CODING_AGENT_DIR / PI_CODING_AGENT_SESSION_DIR (#1317 by @tranducquy0).

    • caveman mem can revert a memory to an earlier value, and supersede --stdin takes replacements too large for a command line (#1386 by @PARTHDESHMUKH2005). The client checks that the installed binary supports --stdin first, so an older binary can no longer store the literal text --stdin as the fact.

    Fixed

    caveman-compress

    • Hermes' skill hub blocked the install with a DANGEROUS verdict that --force can't override. Every finding was a false match, and the matched text is respelled with identical behavior (#1464).
    • Backups are keyed on the file's full path, so two projects' CLAUDE.md no longer share one backup slot. A run that dies before writing removes its backup and staging file, so the next run doesn't abort.
    • Validation now refuses commentary appended after the body (#1433). The prompt keeps the verb that carries an instruction (#1434). Frontmatter stays local on both passes (#1359 by @leninworld). Trailing punctuation on URLs and paths no longer fails validation (#1356 by @Pharex38). Credential dotfiles and bare dotfiles like .env are refused by name (#1357 by @Pharex38, #1363).

    OpenCode

    • OpenCode 2: the shrink plugin is generated for the API the installed major actually loads (#1445). OPENCODE_CONFIG_DIR is honored everywhere (#1441). Deleted
  2. middleware-python-v1.0.1caveman-middleware 1.0.12026-11-08 · 2026-11-08 04:09 UTC
    查看更新说明
    • Security: the litellm extra excludes litellm 1.107.0, which upstream reported compromised (security incident, 2026-10-21), and 1.106.0 to 1.106.2, which import the optional mcp package on ordinary tool calls. The extra also requires a patched filelock (4.2.1 or later).
    • anthropic 2.x is inside the supported range (>=1.0,<3). Before this, the latest SDK passed content through with an unsupported_version warning.

    Verify this release

  3. middleware-ts-v1.1.0@caveman-ai/middleware 1.1.02026-11-08 · 2026-11-08 04:09 UTC
    查看更新说明
    • Security: the MCP adapter now requires @modelcontextprotocol/sdk 1.32.0 or later. Earlier releases followed redirects to any origin and handed it custom headers, and on 307/308 the request body including OAuth tokens (GHSA-6prh-2h8m-c8cw). With 1.30.x or 1.31.x installed, MCP results pass through uncompressed and a warning names the advisory and the version to upgrade to.
    • @anthropic-ai/sdk 0.132.0 through 0.137.0 and the 1.x major (tested 1.0.0 and 1.1.0) are inside the supported range (>=0.124.0 <2). Before this, the latest SDK passed content through with an unsupported_version warning.
    • Mastra: call options forward again across @mastra/core's vendored @ai-sdk/provider types, which lagged the real package and failed tsc.

    Verify this release

  4. bin-v4.1.02026-11-07 · 2026-11-07 03:39 UTC
    查看更新说明

    Signed Caveman runtime companions for macOS, Linux, and Windows. The binaries are licensed under the Apache License 2.0 (LICENSE, NOTICE); see LICENSING.md and the attached third-party notices. The ghcr.io caveman-proxy image is still built without cgo, so its code compressor handles Go source only; the caveman-proxy and caveman-engine binaries here also compress TypeScript, JavaScript, Python, Rust, Java and C/C++.

  5. bin-v4.0.22026-10-23 · 2026-10-23 05:22 UTC
    查看更新说明

    Signed Caveman runtime companions for macOS, Linux, and Windows. The binaries are licensed under the Apache License 2.0 (LICENSE, NOTICE); see LICENSING.md and the attached third-party notices. The ghcr.io caveman-proxy image is still built without cgo, so its code compressor handles Go source only; the caveman-proxy and caveman-engine binaries here also compress TypeScript, JavaScript, Python, Rust, Java and C/C++.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    why many token when few do trick

    Caveman make your AI agent say less and read less. Code stay exact. Brain still big.

    Cited by Adobe Research · A/B tested by JetBrains · Remade for Elasticsearch on Elasticsearch Labs #1 on Hacker News · #1 on GitHub Trending · "No way this actually works." ThePrimeagen

    Install · Six rocks · Proof · Say less · Read less · Auto · Blocks · Commands · Caveman Cloud


    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, so React re-renders. Wrap the prop in useMemo.

    Same fix. 63 token become 20. Brain still big.

    Pick your club:

    SkillSame answerTokens
    /cavemanNew object ref each render, so React re-renders. Wrap the prop in useMemo.20
    /ultracaveInline object prop, new ref, re-render. useMemo.14
    /megacave新參照致重繪。useMemo。13

    Token counts: tiktoken o200k.

    Install

    npx @caveman-ai/cli@latest
    

    One command. Mac, Linux, Windows. Caveman find your agents and your logins, show what it change. Press Enter. Done. Needs Node.js 22.13+.

    After that, plain claude stays caveman'd. So do Codex, Gemini CLI, OpenCode, and 30+ more. It runs on your machine, with your keys and your Claude Pro/Max login. One rock. That it.

    Had caveman before 4.0? Say @latest, or the old copy on your machine wins. Already set up? caveman setup opens the screen again. Only want shorter answers? Get just the skill.

    Six rocks, one install

    New in 4.0: caveman is six parts. All on after install. Each has its own switch.

    RockWhat it doesMeasured
    Say lessAgent answers short. Code stays exact63 → 20 tokens, same fix
    Read lessLogs, JSON, CSV, test output shrink before the model reads them33.2% fewer input tokens per session
    Auto · newPicks the model and the effort for each ask54% cheaper than Opus at xhigh, same score
    Blocks · newCode mode: agent keeps the scripts it writes and runs them again397 → 76 tokens for one test run
    Waste fixesFinds where your tokens go and fixes it. New: keeps the prompt cache warm while you pauseNot measured yet
    BrowseWeb pages come back compressed129.8× smaller page

    caveman status shows what is on. caveman off browse turns one off. Only Auto needs an account, and it is free. 4.0.0 release notes

    Proof

    Outside labs first. Ours come with each rock below. Nothing rounded up. Red rows stay red.

    WhoSetupResult
    Adobe Research, CAVEWOMAN paper (cites this repo)Caveman-style output, eight models, five datasetsCost cut 1.4 to 2.4× per model, up to 3×
    Elastic, Elasticsearch LabsCaveman mode remade for Elasticsearch, eight live MCP scenarios63.6% fewer response tokens. "Zero information loss."
    JetBrains86 real coding tasks, paired A/BNo measurable quality loss (p = 0.82). 8.5% fewer output tokens

    Two findings shaped caveman. Adobe: cavemanning your prompt makes answers worse, so caveman never touches your prompt. JetBrains: agent sessions are mostly code and tool calls, which the voice leaves alone. So caveman grew rocks that shrink what the agent reads and what it runs on.

    Say less: the caveman voice

    A voice, not broken grammar. Every reply follows the same structure.

    RuleWhat it means
    Answer first[thing] [action] [reason]. [next step]. No greeting, no "let me", no recap
    One idea per sentenceBuilt on ASD-STE100, the controlled English of aircraft maintenance manuals: 20 words max, active voice, one term per thing
    Meaning never droppedArticles can go. not, never, no, only never go. Numbers and units stay exact
    Payload verbatimCode, commands, paths, and error messages untouched, character for character
    No theaterNo "me think". No chatter between tool calls. If caveman phrasing isn't shorter, plain wins
    Knows when to stopSecurity warnings, irreversible actions, and confused users get full sentences. Then grunt resumes
    Your prompts stay yoursNever rewritten. Research say that backfire

    Ten dev questions on claude-opus-5-5:

    InstructionOutput tokens
    None6,983
    Answer concisely.4,334
    /caveman4,119
    /ultracave2,693

    "Be concise" is the real baseline; new models already know it. On top of it, /caveman cuts 3% more at the median and /ultracave 35% more. Measured on the 3.1.0 rules, not yet re-run. The rules cost about 1,160 tokens of input, and if you pay per request (GitHub Copilot), shorter answers save nothing. Harness · Every case where caveman loses

    Only want this rock? The skill alone, no proxy:

    npx skills add JuliusBrussee/caveman -g
    

    Type /caveman ($caveman in Codex) if it doesn't start on its own. Say stop caveman to go back.

    Claude on the web, the phone app, or Cowork? No terminal. Add caveman to your Claude account once, in Customize > Plugins: steps. Not tested end to end yet.

    # Claude Code plugin, auto-starts every interactive session, subagents too
    claude plugin marketplace add JuliusBrussee/caveman && claude plugin install caveman@caveman
    
    # Gemini CLI
    gemini extensions install https://github.com/JuliusBrussee/caveman
    
    # Every agent on your machine at once, plus the Claude Code statusline badge (Node.js 22.13+)
    curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/v4.1.0/install.sh | bash
    

    Already inside Claude Code? Same rock, slash form. Type these where you talk to Claude:

    /plugin marketplace add JuliusBrussee/caveman
    /plugin install caveman@caveman
    

    Windows, PowerShell 5.1+:

    irm https://raw.githubusercontent.com/JuliusBrussee/caveman/v4.1.0/install.ps1 | iex
    

    On npm 12 or newer, new npm block git install. One-liners above handle it themselves from v3.2.0 on. Old one-liner pinned to v3.1.0 or older still fail there: use one above, or this: npx --allow-git=root -y github:JuliusBrussee/caveman#v4.1.0

    Changed your mind: npx -y github:JuliusBrussee/caveman -- --uninstall (on npm 12+, add --allow-git=root too)

    Only grabbed the skill? npx skills remove JuliusBrussee/caveman -g take it back out.

    Install broke? Open your agent in this repo and say "Read CLAUDE.md and INSTALL.md, install caveman for me." Agent fix own brain.

    Read less: 33.2% fewer input tokens

    The voice shrinks what the agent says. This shrinks what it reads. Same answers: 18 of 18 right.

    File typeThe file, through cavemanFile savedWhole Claude Code session, 3 runsSession saved
    CSV28,041 → 31498.9%165,823 → 74,48455.1%
    Logs22,810 → 34898.5%148,807 → 74,06850.2%
    YAML20,447 → 17899.1%132,124 → 71,02746.2%
    Test output18,806 → 20398.9%150,377 → 108,51427.8%
    JSON18,837 → 28198.5%147,975 → 108,93926.4%
    HTML21,670 → 21,670none yet140,687 → 154,6419.9% worse
    All six130,611 → 22,99482.4%885,793 → 591,67333.2%

    The file is each test file through today's compressor alone. The session is the whole agent run, which also carries the system prompt and tools, so it moves less. Honest part: the session run is from August 2026 on an older engine, HTML has no compressor yet so it lost, and each test file hides one record in 61 to 72 KB of noise. Yours will vary. Headroom on the same suite: 15 of 18 right, 6.7% fewer tokens. Method

    Every original stays on your disk. The agent can pull it back any time.

    Auto: 54% cheaper, same score

    New model in your agent's picker. Pick Auto and caveman chooses the model and the effort for each ask. Hard ask, big brain. Easy ask, save rocks.

    SetupTasks solvedCost per tryMedian time
    Opus 5.5, xhigh effort, every ask44.3%$7.8335.2 min
    Auto, Claude models only43.7%$3.5915.9 min
    Auto, plus OpenAI and open models42.9%$3.4716.7 min

    Auto costs 0.46× what Opus 5.5 at xhigh costs. That is 54% saved, in under half the time. 85 real coding tasks from SWE-Interact and SWE-Together, one try each. Honest part: the run is half done, the 0.5-point score gap is too small to tell apart at this size (±7), and most of the saving is Auto lowering effort on easy asks. Already on Opus at medium? Expect less; not measured yet. Full table and limits

    caveman login                  # free account. Auto shows up in the model picker
    caveman providers add openai   # optional: give Auto more models, on your own key
    

    Works in Claude Code, OpenCode, and Codex on a ChatGPT login, with API keys, Claude Pro/Max, or ChatGPT. Any other model you pick runs as picked. Not signed in: no Auto, nothing sent. What Auto sends

    Blocks: code mode, script written once

    skills.sh for code mode. Code mode is the agent writing a script instead of making tool call after tool call (Cloudflare, Anthropic). Problem: agent write same script every session, throw it away, write it again. Blocks keep it in your repo, check it every pull request, hand it back.

    InputRawWhat agents type nowBlock
    go test -v ./..., 326 tests10,561397 · | tail -2076 · test-summary
    1.4 MB JSON file251,893236 · their own heredoc227 · json-peek
    366-line Go file3,111250 · grep -n489 · grep-defs

    Tokens the agent reads back. In one week, agents on one machine wrote the same script 394 times. Purdue measured the habit at up to 9.57% of task cost. grep-defs loses to a bare grep; row stays. Method

    Comes with caveman. Eight blocks ready: json-peek · jsonl-stats · test-summary · first-error · wait-for · grep-defs · http-json · replace-in-file. When the agent starts typing a script a block already covers, it gets one line: use the block. Never denies or rewrites a command.

    caveman-blocks scan    # what your agents retyped this month. Script text never leaves your machine
    caveman-blocks init    # rules and block index into this repo's AGENTS.md
    

    Pre-release (v0.1.0-rc.5). Python only, no sandbox yet. Own repo, own stars: caveman-ai/blocks

    Smaller rocks

    RockWhat it doesMeasured
    caveman learnRanks where your tokens go, from agent history already on disk. caveman learn implement applies fixes one diff at a time, only on your yesNot yet
    Warm cache · newStep away and the provider forgets your session, so the next ask pays full price. Caveman keeps Anthropic's prompt cache warm while you pause, only when your own history says you come back in time. Every warm is listed in caveman statsNot yet
    caveman browse <url>A compressed web page for the agent121 tokens instead of 15,704 for a Playwright snapshot of a 200-row table. Tiny forms lose 2.3×. Bench
    /caveman-compress <file>Shrinks memory files like CLAUDE.md, keeps a backup4,138 tokens instead of 6,198 across five files, 22.8% to 49.1% each, every heading, code block, and path intact. Bench
    MiddlewareSame shrinking inside the Vercel AI SDK, LangChain, OpenAI, or Anthropic call you already make. TypeScript · Python · Every framework · One container for the teamNot yet

    Commands

    In your terminal:

    caveman claude                # start an agent on caveman: codex · gemini · opencode · aider · kilo · qwen · hermes · openclaw · pi
    caveman status                # what is on, which agents it reaches, one next step
    caveman on browse             # switch one rock on or off: output · input · waste-fixes · routing · scripts · browse
    caveman login                 # free account, turns on Auto
    caveman learn                 # where your tokens go
    caveman trial -- claude       # A/B a real session on your own work
    caveman shrink -- pnpm test   # compress noisy command output
    caveman convert --dry-run     # pixel mode: skills the model reads as images
    caveman stats                 # your token history
    caveman doctor                # one problem per line, with its fix
    

    In your agent:

    CommandWhat it does
    /caveman · /ultracave · /megacaveThe voice, the grunt, the 文言文. /caveman status shows the mode, /caveman off stops it
    /caveman-commitOne-line Conventional Commit
    /caveman-reviewOne finding per line: L42: 🔴 null deref. Guard it.
    /caveman-compress <file>Shrinks memory files and backs up the original
    /caveman-statsReal token usage for this Claude Code session
    /caveman-helpEvery mode and command on one screen
    cavecrewSubagents that find, edit, and review code, then report back in caveman
    investigate-first · lean-build · surgical-patch · safe-refactor · migration · verify-and-stopWork patterns that write less code. Your agent picks them up when a task fits
    caveman-setup · caveman-discover · caveman-learn · caveman-manage · caveman-optimize · caveman-explore · caveman-evidence-reviewDrive the proxy from inside your agent

    Caveman Cloud

    Everything above is for the coding agent you use. Caveman Cloud is for the agents you build.

    You ship an agent. Every run costs money. Is it good? Is it cheap? Which change made it worse? Cloud answers.

    Cloud doesWhat you get
    ObservabilityEvery run traced to the work and what it cost. Sets itself up from your repo, your keys, and the logs or OpenTelemetry you already have
    EvalsGrades how good the answers are, on your own tasks, from your real traffic
    AutopilotProposes a cheaper change, tests it on your recorded work, ships only when the evals say answers are still as good. You approve the pull request
    ProofEvery number says if it is measured, inferred, or verified. A saving counts only after real traffic shows it

    In the wild

    ThePrimeagen: "No way this actually works." Watch

    Adobe Research: CAVEWOMAN, arXiv, June 2026

    JetBrains: "It is fun, and it costs you nothing measurable in quality." Read

    Elastic: elastic-caveman on Elasticsearch Labs, April 2026

    Hacker News: #1, 904 points

    GitHub Trending #1 overall, July 2026 · Trendshift #1 repo of the day, April 2026 · Product Hunt #8 of the day

    Started as a joke in April 2026. Now past 100,000 stars. Joke got serious. Voice did not.

    Star History Chart

    Privacy

    • The skill runs on your machine and sends nothing. One exception: /caveman-compress sends the file you compress to your configured model provider.
    • The CLI sends usage stats by default: commands run, token counts, caveman-blocks commands and usage counts, a random install ID, OS, and IP. Never your prompts, code, file paths, or scripts you wrote. One person maintains this for free, and those stats show what to build next. Off for good, Blocks included: caveman telemetry off or DO_NOT_TRACK=1.
    • Auto, only once you sign in and pick it: each ask sends Caveman Cloud your latest ask (with whatever your agent attaches to it, such as CLAUDE.md, memory or @-mentioned files), the one before it, and the end of the agent's last reply, plus each request's tool names, effort, a few agent headers, and the previous request's token counts. On the Free plan Caveman may keep it to improve routing. caveman off routing stops it.
    • Where requests go: from your machine to your provider, or to another provider you added with caveman providers add, on your own key. Only a request routed to a Caveman Cloud model passes through Caveman Cloud, whole (system prompt, tool results, code), on your Caveman project's stored key, billed to that project. caveman providers cloud off stops that.

    The full list, and how to delete sent telemetry: SECURITY.md.

    License

    Apache-2.0, whole repo. Read it, fork it, ship it, host it. Free like mammoth on open plain. Older releases and third-party notices: LICENSING.md. "Caveman" and the rock logo are trademarks of Julius Brussee.

    Cite

    @software{brussee2026caveman,
      author = {Brussee, Julius},
      title  = {Caveman: why many token when few do trick},
      year   = {2026},
      url    = {https://github.com/JuliusBrussee/caveman}
    }
    

    🪨 Caveman save you token. Star cost zero. Fair trade.