Caveman:把 Agent 輸出壓掉約 65% Token 的 Claude Code Skill¶
整理自官方 repo 與外部介紹(見文末),2026-06-19。
⚠️ 文中 token 節省百分比皆為作者 repo 與第三方文章的 benchmark 宣稱值,非本庫獨立複現,當「量級參考」看。
一句話¶
Caveman 是一個 Claude Code skill(也相容 Codex、Gemini、Cursor、Windsurf、Cline、Copilot 等 30+ agent),讓 agent 講話像穴居人——丟掉客套與贅字、只留實質,藉此大幅砍掉 output token。標語:「why use many token when few token do trick」。
解決什麼痛點¶
Claude 預設語氣是給「人」看的:溫暖、有 hedging、結構化。但在 agent 對 agent、內部 pipeline、批次處理 這類「輸出是給程式讀」的場景,那種語氣是浪費——既燒額度又沒必要。Caveman 給模型「可以不客套、只留乾貨」的許可。
機制¶
指示 agent:
- 丟 filler、保留實質、用句子片段(fragments)
- 程式碼、指令、錯誤字串、語言原樣保留(不壓壞技術內容)
- 拿掉冗長解釋,但維持正確性
對 Claude Code 還會在每個 session 寫一個 flag 檔,讓 agent 自動採用壓縮風格,不必每次下 /caveman。
範例輸出風格:Function take input. Return sorted list. Use quicksort. Fast. Done.
Token 節省(作者 benchmark 宣稱)¶
- output 平均 −65%(範圍 22–87%)
- 重點澄清:只動 output token,thinking / reasoning token 不受影響——是讓「輸出」精簡,不是讓「推理」變笨
- 記憶檔壓縮(
caveman-compress)對 memory 檔約 −46%
指令¶
| 指令 | 用途 |
|---|---|
/caveman [lite\|full\|ultra\|wenyan] |
切換壓縮強度 |
/caveman-commit |
精簡的 conventional commit |
/caveman-review |
一行式 PR comment |
/caveman-stats |
追蹤 token 節省 |
/caveman-compress <file> |
重寫 / 壓縮記憶檔 |
安裝¶
# macOS / Linux / WSL
curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/main/install.sh | bash
# Windows PowerShell
irm https://raw.githubusercontent.com/JuliusBrussee/caveman/main/install.ps1 | iex
需 Node ≥ 18,約 30 秒裝好。License:MIT。GitHub 約 74.6k★。
什麼時候用 / 不要用¶
| ✅ 適合 | ❌ 不適合 |
|---|---|
| agent 對 agent、內部 pipeline | 面向客戶 / 使用者的輸出 |
| 自動化 code review、CI/CD | 給新手的完整解釋、文件生成 |
| 批次處理、log / 錯誤 triage | 法律 / 醫療 / 合規等需精確措辭 |
| 快速原型回饋迴圈 | 需細膩、有保留語氣的對話 |
注意:壓縮偶爾會把「必要的限定條件 / context」一起剝掉,複雜推理的輸出要留意。
為什麼對量化 / 個人開發工作流有用¶
- 直接打輸出端 token 成本,和本庫已收錄的 9Router(token saver) 是互補路線(9Router 砍 input + 路由;Caveman 砍 output style)。
- 適合掛在「資料 pipeline、批次回測報告、agent 自動化」這種輸出被程式或自己快速掃過的場景;面向報告 / 對外內容則關掉。