SkillAtlasSkill 详情

caveman-compress

why use many token when few do trick

审核状态:已审核Quality 80Security 80

复制安装命令

用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。

复制前请先查看来源、License 和安全提示。

项目 README

来源文件:README.md

抓取于 2026年8月29日

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

Caveman - why use many token when few do trick | Product Hunt JuliusBrussee%2Fcaveman | Trendshift

Stars 30+ agents 8 native wrap profiles License

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


See it

🗣️ Normal agent — 69 tokens Caveman agent — 19 tokens

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

Caveman Learn report: TLDR summary and savings cards on the left; ranked token sinks with an expanded fix and a session context depth histogram on the right

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

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

coding agent talks to a local caveman proxy that forwards upstream to the provider with auth passed through byte-exact; a CCR store below the proxy keeps the original bytes and returns a recovery handle to the agent; an MCP toolkit side-channel gives the agent caveman_retrieve, toon encode/decode, and browse

What the engine does to a payload — detect() types each payload, then routes it to a compressor that keeps what answers depend on:

Detected typeKeepsTarget Savings
jsonkeys, structure, error/message subtrees; collapses repetitive arrays70–90%
logerrors, stack traces, first/last lines; drops INFO and progress noise85–95%
codeimports, signatures, types; elides function bodies, syntax stays valid40–70%
difffile/hunk headers and changed lines; elides repeated context60–80%
search-resulttop/bottom hits plus diagnostic/security hits80–95%
text / HTMLheadings, opening/closing context, important sections50–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: caveman_compress, caveman_retrieve, caveman_stats, caveman_toon_encode, caveman_toon_decode.

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 / commandWhat 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-reviewerCompressed subagent presets for locating, editing, and reviewing code.
/caveman-commitTerse Conventional Commit messages.
/caveman-reviewOne-line, actionable review findings.
/caveman-compress <file>Smaller Markdown memory files, with the original backed up.
/caveman-statsLocal session token usage and estimated savings in Claude Code.
/caveman-helpOne-screen reminder of every mode and command.
investigate-first, lean-build, surgical-patch, safe-refactor, migration, verify-and-stopWork patterns that write less code, so the agent bills fewer tokens. Your agent picks these up on its own when a task fits.
/caveman-setup, /caveman-discover, /caveman-learn, /caveman-manage, /caveman-optimize, /caveman-explore, /caveman-evidence-reviewDrive the caveman engine and proxy: set it up, find where tokens go, act on what it finds.
TaskNormalCavemanSaved
Explain React re-render bug118015987%
Fix auth middleware token expiry70412183%
Set up PostgreSQL connection pool234738084%
Explain git rebase vs merge70229258%
Refactor callback to async/await38730122%
Architecture: microservices vs monolith44631030%
Review PR for security issues67839841%
Docker multi-stage build104229072%
Debug PostgreSQL race condition120023281%
Implement React error boundary345445687%
Average121429465%

[!IMPORTANT] Honest number warning. The skill only shrinks output tokens. Input and reasoning tokens are untouched, and the skill itself adds ~1–1.5k input tokens per turn. Whole-session savings run smaller than the output number, and on already-terse workloads they can go net-negative. The real win is readability and speed; cost savings are the bonus. When caveman wins, when it loses, and how to measure it yourself: docs/HONEST-NUMBERS.md.

Wrap any agent

caveman <agent> wraps eight agents natively. Adding one is a data change, a single JSON profile in agents/profiles/, no code.

AgentVendorHow it's wrapped
Claude CodeAnthropicenv vars
OpenAI Codex CLIOpenAIenv vars (API key) · ephemeral CODEX_HOME (ChatGPT login)
Gemini CLIGoogleenv vars
AiderOpenAI/Anthropicenv vars
opencodesstinline config via env, your opencode.json untouched
Hermes AgentNous Research--provider custom + env
OpenClawOpenClawephemeral merged config, your config read-only
Pipi.devbundled native extension, your ~/.pi config untouched

Wrap never edits your own config files. Real sessions round-trip in record mode, tested against Hermes v0.18.0, OpenClaw 2026.6.11, and Pi 0.84.2.

Not on the list? Point any provider SDK or framework (Vercel AI SDK, LangChain, LiteLLM, OpenAI Agents, CrewAI, PydanticAI) at the local proxy with a baseURL swap: integrations/recipes/.

The default wrap hands the agent the whole loadout: the five caveman MCP tools, the browse MCP server when Chrome resolves, command-output shrink through a real hook on Claude, opencode, Gemini, Hermes, and OpenClaw (Codex gets an honest soft note, its runtime rejects the rewrite: openai/codex#18491), and skills-as-images on new skill installs. Turn pieces off in ~/.caveman-cloud/config.json.

The whole cave

One idea. Agent do more with less.

RepoWhat it shrinksStatus
caveman (you here)What the agent says, and now what it readslive
caveman-browseWhat the agent sees in the browserlive
caveman-agent-sdkWhat your production agent loads, calls, and spendsown repo · in dev
cavegemmaThe compression baked into weights (Gemma fine-tune)labs
caveman-codeThe whole agent, end to endfrozen
cavememWhat the agent remembers, across sessionsfrozen
cavekitThe build loop, spec-drivenfrozen

Frozen repos still install and work; they are no longer in active development. Their best ideas live on here: cavemem's compressed-memory core ships inside caveman, and caveman-code's lesson became caveman wrap. Make the agent you already use cheaper instead of replacing it.

Caveman make token small. Caveman Cloud make it provable.

Local runtime results report inferred; controlled benchmark results report benchmark_counterfactual. Neither is a provider invoice. Caveman Cloud is where qualifying live evidence can become verified: baseline in record mode, changes behind eval gates, rollback on quality loss, savings from real traffic with signed receipts. Offline caveman never says verified.

Join the waitlist → caveman.so

Privacy

Your agent still talks to the provider you chose. Local compression needs no Caveman account. The caveman CLI sends anonymous usage stats by default: which commands ran, plus token counts through and cut. Never your prompts, code, or file paths. It says so on first run, and one command turns it off forever: caveman telemetry off (or DO_NOT_TRACK=1). Skill and hooks run locally; the proxy forwards provider traffic; CCR stays in a SQLite file on your disk. Exact network, telemetry, and storage boundaries: SECURITY.md.

License

Split license. Skill and adoption surfaces are MIT. Engine-linked runtime is BSL-1.1 source-available, not OSI Open Source before Change Date.

MIT — the skill, Agent SDK and initializer, the CLI, both client SDKs (TS + Python), contracts, provider catalog, the extension shell, and the thin cavemem clients.

BSL-1.1 — Engine, Proxy, Cache Engine, rewriter, Browse, MCP server, shrink, cavemem Go core, and shared Go platform. New Engine-linked runtime modules default to BSL-1.1. Source-available: read it, fork it, self-host it for your own first-party traffic free, production included. Every BSL version auto-converts to Apache-2.0 on the earlier of 2030-06-21 or four years after that version first ships. Third-party hosted, managed, or embedded service use needs commercial license. BSL text and per-directory map ship with source.

engine/pixel embeds pxpipe (MIT) plus glyph atlases derived from Spleen 5×8 (BSD-2-Clause) and GNU Unifont (dual OFL-1.1 / GPLv2-with-font-exception); its NOTICE travels with that source.

"Caveman" and the rock logo are trademarks of Julius Brussee. "Powered by Caveman" is fine when true.

Star this repo

Caveman save you token, save you money. Star cost zero. Fair trade. ⭐

Star History Chart


Docs: Technical manual · Install matrix · Honest numbers · License · Contributing · Maintainer guide · Issues
MIT skill · BSL-1.1 engine — few token. no lie.
其他

中风险

  • 来源需自行核对维护者身份。
  • 包含脚本或命令调用,安装前请复核。
  • 未检测到明显外部权限要求。
  • 未检测到高风险命令。
  • 扫描发现:3 条。

Codex — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/JuliusBrussee/caveman.git
  3. 将 "skills/caveman-compress" 文件夹复制到 Codex 的 skills 目录中。
  4. 重启 Codex 让新的 skill 生效。

Codex — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Codex 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Codex 让新的 skill 生效。

Claude Code — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/JuliusBrussee/caveman.git
  3. 将 "skills/caveman-compress" 文件夹复制到 Claude Code 的 skills 目录中。
  4. 重启 Claude Code 让新的 skill 生效。

Claude Code — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Claude Code 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Claude Code 让新的 skill 生效。

Cursor — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/JuliusBrussee/caveman.git
  3. 将 "skills/caveman-compress" 文件夹复制到 Cursor 的 skills 目录中。
  4. 重启 Cursor 让新的 skill 生效。

Cursor — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Cursor 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Cursor 让新的 skill 生效。

GitHub Copilot — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/JuliusBrussee/caveman.git
  3. 将 "skills/caveman-compress" 文件夹复制到 GitHub Copilot 的 skills 目录中。
  4. 重启 GitHub Copilot 让新的 skill 生效。

GitHub Copilot — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 GitHub Copilot 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 GitHub Copilot 让新的 skill 生效。

Windsurf — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/JuliusBrussee/caveman.git
  3. 将 "skills/caveman-compress" 文件夹复制到 Windsurf 的 skills 目录中。
  4. 重启 Windsurf 让新的 skill 生效。

Windsurf — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Windsurf 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Windsurf 让新的 skill 生效。
查看 SKILL.md 原文
name: caveman-compress
description: >
  Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format
  to save input tokens. Preserves all technical substance, code, URLs, and structure.
  Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md.
  Trigger: /caveman-compress FILEPATH or "compress memory file"

Caveman Compress

Purpose

Compress natural language files (CLAUDE.md, todos, preferences) into caveman-speak to reduce input tokens. Compressed version overwrites original. Human-readable backup saved as <filename>.original.md, but NOT beside the source file — it lives in an out-of-tree data dir ($XDG_DATA_HOME/caveman-compress/backups/<parent-dir-name>/, or %LOCALAPPDATA%\caveman-compress\backups\<parent-dir-name>\ on Windows) so skill auto-loaders don't re-ingest it as a live file.

Trigger

/caveman-compress <filepath> or when user asks to compress a memory file.

Process

  1. The compression scripts live in scripts/ (adjacent to this SKILL.md). If the path is not immediately available, search for scripts/__main__.py next to this SKILL.md.

  2. From the directory containing this SKILL.md, run:

python3 -m scripts <absolute_filepath>

  1. The CLI will:
  • detect file type (no tokens)
  • call Claude to compress
  • validate output (no tokens)
  • if errors: cherry-pick fix with Claude (targeted fixes only, no recompression)
  • retry up to 2 times
  • if still failing after 2 retries: report error to user, leave original file untouched
  1. Return result to user

Compression Rules

Remove

  • Articles: a, an, the
  • Filler: just, really, basically, actually, simply, essentially, generally
  • Pleasantries: "sure", "certainly", "of course", "happy to", "I'd recommend"
  • Hedging: "it might be worth", "you could consider", "it would be good to"
  • Redundant phrasing: "in order to" → "to", "make sure to" → "ensure", "the reason is because" → "because"
  • Connective fluff: "however", "furthermore", "additionally", "in addition"

Preserve EXACTLY (never modify)

  • Code blocks (fenced ``` and indented)
  • Inline code (backtick content)
  • URLs and links (full URLs, markdown links)
  • File paths (/src/components/..., ./config.yaml)
  • Commands (npm install, git commit, docker build)
  • Technical terms (library names, API names, protocols, algorithms)
  • Proper nouns (project names, people, companies)
  • Dates, version numbers, numeric values
  • Environment variables ($HOME, NODE_ENV)

Preserve Structure

  • All markdown headings (keep exact heading text, compress body below)
  • Bullet point hierarchy (keep nesting level)
  • Numbered lists (keep numbering)
  • Tables (compress cell text, keep structure)
  • Frontmatter/YAML headers in markdown files

Compress

  • Use short synonyms: "big" not "extensive", "fix" not "implement a solution for", "use" not "utilize"
  • Fragments OK: "Run tests before commit" not "You should always run tests before committing"
  • Drop "you should", "make sure to", "remember to" — just state the action
  • Merge redundant bullets that say the same thing differently
  • Keep one example where multiple examples show the same pattern

CRITICAL RULE: Anything inside ... must be copied EXACTLY. Do not:

  • remove comments
  • remove spacing
  • reorder lines
  • shorten commands
  • simplify anything

Inline code (...) must be preserved EXACTLY. Do not modify anything inside backticks.

If file contains code blocks:

  • Treat code blocks as read-only regions
  • Only compress text outside them
  • Do not merge sections around code

Pattern

Original:

You should always make sure to run the test suite before pushing any changes to the main branch. This is important because it helps catch bugs early and prevents broken builds from being deployed to production.

Compressed:

Run tests before push to main. Catch bugs early, prevent broken prod deploys.

Original:

The application uses a microservices architecture with the following components. The API gateway handles all incoming requests and routes them to the appropriate service. The authentication service is responsible for managing user sessions and JWT tokens.

Compressed:

Microservices architecture. API gateway route all requests to services. Auth service manage user sessions + JWT tokens.

Boundaries

  • ONLY compress natural language files (.md, .txt, .typ, .typst, .tex, extensionless)
  • NEVER modify: .py, .js, .ts, .json, .yaml, .yml, .toml, .env, .lock, .css, .html, .xml, .sql, .sh
  • If file has mixed content (prose + code), compress ONLY the prose sections
  • If unsure whether something is code or prose, leave it unchanged
  • Original file is backed up as FILE.original.md before overwriting — in the out-of-tree backup data dir (see Purpose), not beside the source file
  • Never compress FILE.original.md (skip it)

发现问题?提交给管理员复核

评分:

评论 (0)

暂无评论,成为第一个评论者吧!