Glean 拾遗
日刊 /2026-07-25 / Caveman:让 AI 编程助手闭上话痨嘴,输出 token 直降 65% 的压缩技能包

Caveman:让 AI 编程助手闭上话痨嘴,输出 token 直降 65% 的压缩技能包

原文 github.com 收录 2026-07-25 06:00 阅读 10 min
AI 解读

Caveman 是一个安装在 Claude Code、Codex、Cursor 等 30+ AI 编程助手中的 skill/plugin。它通过剥离填充词、保留技术实质的方式,将助手的输出 token 量平均减少 65%,同时保持技术准确性不变。项目提供多级压缩模式(精简/完全/电报式/文言文),并提供 commit 生成、PR 评审、记忆文件压缩、MCP 中间件等附属工具。核心价值在于用更少的上下文污染换取更快的响应速度和更低的 API 成本,尤其适合日常高频与 AI 助手交互的一线开发者。

原文 10 分钟
原文 github.com ↗
§ 1

Caveman is a plugin (or “skill”) for more than 30 AI coding tools — including Claude Code, Codex, Gemini CLI, Cursor, Windsurf, and Cline — that strips the fluff from agent output while keeping all technical substance. It can shrink model responses by roughly 65% on average, making answers terse, direct, and faster to read without compromising accuracy.

Caveman 是面向 30 余款 AI 编程助手(Claude Code、Codex、Gemini CLI、Cursor、Windsurf、Cline 等)的插件 / 技能,核心目标只有一个:砍掉模型回复里的冗余措辞,同时保留全部技术信息。其平均可削减约 65% 的输出 token,让回答像电报一样精炼、易读且不损失准确性。

§ 2

Modern coding agents tend to preface every answer with polite fillers, repetition, and long explanations. This verbosity burns tokens, drains API budgets, slows down iteration, and forces developers to skim through paragraphs of prose to find the fix. Caveman targets the output side of the problem — the “mouth” of the model — and makes it speak in fragments that respect your time and quota.

目前的编程助手习惯用礼貌用语、重复解释和长篇开场白包装答案。这些冗余消耗 token、推高 API 成本、拉低交互速度,开发者不得不从大量文本中挖掘关键信息。Caveman 只针对模型的“嘴巴”——输出部分——将其调整为碎片化的精简表述,既省时间又省额度。

§ 3

Caveman offers four modes: lite drops filler but keeps sentence structure; full (default) transforms output into compact fragments; ultra pushes into telegraphic style; and wenyan uses classical Chinese for even shorter rendering. On top of that, sub-commands handle dedicated tasks:

  • /caveman-commit writes conventional commit messages ≤50 characters.
  • /caveman-review reduces PR comments to one-liners.
  • /caveman-stats reports real session token usage and lifetime savings.
  • /caveman-compress <file> rewrites memory files (CLAUDE.md, project notes) into caveman-speak, cutting input tokens by ~46% on average.

Caveman 提供四档精炼度:lite 去掉赘语但保留句法;full(默认)将回复压缩为短语片段;ultra 进阶至电报风;wenyan 则以文言文给出更短输出。此外,多条子命令覆盖常见场景:

  • /caveman-commit 生成 ≤50 字符的 Conventional Commits 消息。
  • /caveman-review 把 PR 评论精简为一行。
  • /caveman-stats 统计本次会话及历史累计节省的 token 与费用。
  • /caveman-compress <file> 将记忆文件(如 CLAUDE.md)转写成 caveman 风格,平均减少约 46% 的输入 token。
§ 4

The installer places a skill file in each agent's known directory. For Claude Code, a hook also writes a small flag file so the agent sees it on startup and starts speaking caveman from the first message. The stats command reads the session log to count saved tokens and feeds that number into a statusline badge. The caveman-compress sub-skill rewrites memory files so every future session starts with a smaller context — savings that compound over time. Importantly, Caveman only changes output tokens; reasoning/thinking tokens are left untouched.

安装脚本会在每个助手的技能目录中写入一份技能文件。针对 Claude Code,还额外通过钩子写入一个标志文件,让助手从第一条消息就开始使用 caveman 风格。/caveman-stats 命令读取会话日志统计节省量并刷新状态栏铭牌。/caveman-compress 子技能则重写记忆文件,使得后续每次对话都自带更小的上下文。关键设计原则:Caveman 只改模型输出的“嘴巴”,不碰推理(思考)所需的 token。

§ 5

Prerequisite: Node.js ≥18.

macOS / Linux / WSL:

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

Windows (PowerShell 5.1+):

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

The script detects installed agents automatically; missing ones are skipped. After installation, type /caveman or say “talk like caveman” to activate. Revert to normal with “normal mode”.

环境要求:Node.js ≥18。

macOS / Linux / WSL:

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

Windows (PowerShell 5.1+):

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

脚本会自动检测已安装的助手,跳过不存在的。安装完成后输入 /caveman 或说“talk like caveman”即可激活;用“normal mode”恢复常规输出。

§ 6

Caveman shines during coding sessions, PR reviews, technical Slack threads, and any workflow where output length dominates cost and reading time. It is especially powerful when combined with memory-file compression because both input and output tokens shrink. The plugin does not touch the model's reasoning process, so complex architectural discussions may still require long internal reasoning chains even if the final answer looks short. It also won't help if the bottleneck is input context (unless you use caveman-compress), and the savings vary by prompt type — from 22% on refactoring tasks to 87% on explanatory answers.

Caveman 最适合高频技术对话场景:写代码、PR 评审、Slack 技术讨论等输出冗长、时间敏感的工作流。将它与记忆文件压缩配合使用时,输入和输出 token 会同时缩减,收益叠加。需要注意:插件完全不干涉模型的推理过程,复杂架构讨论即使最终回答很短,内部推理链依然会消耗大量 token。如果瓶颈在输入上下文侧,需要单独启用 caveman-compress。文案类 vs 重构类问题的节省幅度差异较大(22%–87%),并非所有场景都能获得同比例节约。

§ 7

Real token counts from the Claude API across 10 representative prompts:

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%

The evaluation harness compares caveman against a baseline of “answer concisely,” not against a verbose default, so the delta is honest.

使用 Claude API 实测 10 个代表性提示词的 token 消耗:

任务 原始 Caveman 节省比例
解释 React 重渲染 bug 1180 159 87%
修复 auth 中间件 token 过期 704 121 83%
搭建 PostgreSQL 连接池 2347 380 84%
解释 git rebase vs merge 702 292 58%
回调重构为 async/await 387 301 22%
架构:微服务 vs 单体 446 310 30%
安全 PR 评审 678 398 41%
Docker 多阶段构建 1042 290 72%
调试 PostgreSQL 竞态条件 1200 232 81%
实现 React 错误边界 3454 456 87%
平均 1214 294 65%

评估框架将 Caveman 与“回答请简洁”基线对比,而非与冗长默认输出对比,因此数据保守可信。

§ 8

Caveman is part of a family of tools that apply the same minimal-output philosophy across the development stack:

  • caveman-code — a full terminal coding agent built from the ground up for terse interaction.
  • cavemem — cross-agent memory that stays compact across sessions.
  • cavekit — spec-driven build loops that reduce guesswork.
  • cavegemma — a Gemma 4 31B model fine-tuned on caveman-style pairs, baking compression directly into the weights. Together, they form a pipeline where the spec drives the build, the model thinks in compressed form, and every tool speaks only what's necessary.

Caveman 背后是一套贯彻“少即是多”的工具链,将压缩思维从输出层延伸到更多环节:

  • caveman-code:一个从底层就追求精简交互的终端编程助手。
  • cavemem:跨会话的紧凑记忆管理,减少重复上下文。
  • cavekit:用规格说明书驱动构建循环,减少模型猜测。
  • cavegemma:用 caveman 风格问答对微调的 Gemma 4 31B 模型,把压缩逻辑写入权重。 它们可按流水线组合:规格驱动构建 → 模型内部以压缩方式思考 → 每个工具只说必要的话。
打开原文 ↗