开发框架与工具 · 中文选型解读

caveman

已解读GitHubGo

Caveman是面向大语言模型代理的Token(大模型处理与计费的最小单位)优化工具,可在不损失信息的前提下降低大模型调用的Token消耗。

102.0kstar2 天前更新维护状态许可待核对商用提醒
在 GitHub 查看官方项目
适合解决加快 AI 应用搭建、评测、监控和迭代
更适合负责 AI 产品研发和平台建设的团队
投入判断上手门槛:中。需要研发人员完成集成和维护
一分钟看懂

这个项目值得继续研究吗?

AI 依据上游资料解读 · 2026/8/31

Caveman是面向大语言模型代理的Token(大模型处理与计费的最小单位)优化工具,可在不损失信息的前提下降低大模型调用的Token消耗。

解决什么问题
企业使用大语言模型代理、AI代码助手等工具时,普遍存在Token消耗高、调用成本居高不下的问题,同时冗余内容挤占上下文窗口,也会限制大模型处理长任务的能力。
适合什么团队
适合有大语言模型代理、AI代码助手使用需求,希望降低大模型调用成本、优化长上下文处理效率的企业技术与业务团队。
使用前注意
部署需提前准备Node.js 18及以上运行环境,Proxy运行时采用BSL-1.1许可,商用前需确认许可条款,目前项目处于活跃维护状态。

本页用于缩短初步筛选时间,不构成技术、采购或法律结论。 正式使用前请在真实业务数据上验证,并以官方说明与许可证为准。

项目导读

从官方资料看清能力、部署与采用边界

AI 翻译整理 · 保留官方来源

以下内容依据项目公开 README 或模型卡翻译整理,代码、命令和产品名保持原样。

项目定位

Caveman是一款专门针对大语言模型(LLM)调用场景的Token优化工具,核心目标是在完全不损失信息准确性的前提下,压缩大模型调用的输入、输出Token总量,帮助企业降低大模型使用成本,同时释放更多上下文窗口空间以支撑更长的任务处理流程。它不需要替换企业现有在用的AI代理、代码助手工具,可直接对接30+主流代理产品,适配成本极低。

核心能力

Caveman的核心能力分为两大方向,同时配套了评估、优化等辅助工具:

  1. 输入Token压缩:通过本地运行的Caveman Proxy对传入大模型的内容按类型定向压缩,官方基准测试显示,在Claude Code场景下可减少33.2%的输入Token消耗,且所有压缩内容支持字节级精确恢复,不会丢失原始信息。针对不同内容类型的压缩率范围为:JSON类70%-90%,日志类85%-95%,代码类40%-70%,Diff类60%-80%,搜索结果类80%-95%,文本/HTML类50%-80%。
  2. 输出Token简化:通过原生技能让大模型的回复采用极简表述,仅保留核心信息,同时代码、命令、错误信息完全保留不变。实测相同信息的回复Token量可减少约72%(69Token降至19Token)。
  3. 附加能力:支持像素模式,将技能提示词转为PNG供模型读取,可降低约61%的技能加载Token消耗;提供本地历史分析能力,可扫描本地存储的代理调用历史,定位Token浪费点并给出优化方案,优化操作支持人工确认后再落地。

典型使用方式

你可以根据自身需求选择单独使用某部分能力,也可以组合使用:

  1. 仅优化输出Token:直接安装原生技能即可,执行命令npx skills add JuliusBrussee/caveman,安装完成后支持30+主流代理使用,可通过/caveman lite|full|ultra切换精简档位,也可通过/caveman off随时关闭。
  2. 同时优化输入输出Token:安装Caveman Proxy,执行命令npm install -g @caveman-ai/cli && caveman setup --install,之后通过caveman [代理名](如caveman claude、caveman gemini)启动代理即可,无需修改现有业务代码,所有大模型凭证直接透传至对应厂商,不会泄露。
  3. 先评估优化收益再落地:执行caveman learn扫描本地的代理调用历史,自动生成优化报告,显示各Token消耗点的可优化空间、预估可节省成本,确认方案后可执行caveman learn implement让代理自动落地优化,每一处修改都需要人工确认后才会生效。
  4. 优化技能加载成本:执行caveman convert可将已安装的技能提示词转为像素模式,降低技能每次调用的Token消耗,如有需要也可执行caveman convert --revert一键恢复原始文件。

部署与运行要求

Caveman全量功能运行需要Node.js 18及以上版本,支持Windows、macOS、Linux三大操作系统。所有功能均在本地运行,不需要连接Caveman官方后端,你的业务数据、大模型调用凭证均不会外传,符合数据安全要求。 如果仅使用输出精简技能,不需要全局安装CLI,直接通过npx调用即可,部署门槛更低。

许可证与采用建议

不同组件的许可协议不同:CLI工具、输出精简技能采用MIT许可,可免费商用、修改;Caveman Proxy运行时采用BSL-1.1许可,商用前需确认许可条款符合你的使用场景。 建议首次使用前先执行caveman learn的模拟运行,评估你的实际使用场景下的Token可节省比例,再决定是否全量部署;如果你的团队使用的是Claude Code、Gemini、Cursor等主流代理工具,适配成本几乎为零,可先小范围测试效果后再推广。

可核对的事实层

官方资料与来源

查看来源 →
  • ai
  • anthropic
  • caveman
  • claude
  • claude-code
  • llm
  • meme
  • prompt-engineering
  • skill
  • tokens
默认分支main
关注仓库238
复刻次数5.9k
开放议题381
近期更新2026/8/29
仓库状态未标记归档
上游部署线索
## 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.

```bash
npm install -g @caveman-ai/cli && caveman setup --install
caveman claude        # or codex · gemini · aider · opencode · hermes · openclaw
```

**2 · Save output** — the skill, the original. Your agent *answers* in tight caveman-speak while code, commands, and errors stay exact. MIT, 30+ agents.

```bash
npx skills add JuliusBrussee/caveman
```

<details>
<summary><strong>Other ways in</strong> — full installer with hooks, Windows, one agent only</summary>

The full installer also wires the Claude Code hooks and statusline, finds every supported agent on your machine, and is safe to rerun (Node.js 18+):

```bash
curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/v2.3.1/insta

该片段来自项目 README,仅用于初步判断;实际部署请以官方文档为准。

核对上游原始说明节选

🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman

why use many token when few do trick

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. benchmarkcounterfactual Keep your agent. Brain big. Context small.

See it · Install · Learn · Proxy · Pixel · Wrap · Docs · License

---

See it

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.

npm install -g @caveman-ai/cli && caveman setup --install
caveman claude        # or codex · gemini · aider · opencode · hermes · openclaw

2 · Save output — the skill, the original. Your agent answers in tight caveman-speak while code, commands, and errors stay exact. MIT, 30+ agents.

npx skills add JuliusBrussee/caveman

Other ways in — full installer with hooks, Windows, one agent only

The full installer also wires the Claude Code hooks and statusline, finds every supported agent on your machine, and is safe to rerun (Node.js 18+):

curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/v2.3.1/install.sh | bash

Windows (PowerShell 5.1+):

irm https://raw.githubusercontent.com/JuliusBrussee/caveman/v2.3.1/install.ps1 | iex

One agent only:

# 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. benchmarkcounterfactual

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:

| 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.

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: cavemancompress, cavemanretrieve, cavemanstats, cavemantoonencode, cavemantoondecode.

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.

One install also brings the small tools:

| 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 | T