Agent skill · Caveman
/caveman-compress Shrink CLAUDE.md and memory files without breaking code
This skill runs a bundled Python tool that rewrites the prose of a memory or notes file in terse form, so the agent loads fewer tokens each session. Code blocks, inline code, URLs, paths and version numbers are treated as read-only, the output is validated with up to two targeted retries, and a readable backup is stored outside the project.
Works with
- All detected agents
- Skills only
- Claude Code
- Gemini CLI
- Every agent via script
When to use it
- Your CLAUDE.md or AGENTS.md has grown long and loads into every session.
- You keep a todo or preferences file the agent reads often.
- You want shorter memory files but cannot risk a changed command or path.
How it works
- 1Require a file path
The skill only works on a named file and asks for a path rather than compressing pasted text inline.
- 2Run the script
From the skill folder the agent runs the scripts module on the absolute path, which detects the file type and calls the model to compress it.
- 3Protect the payload
Fenced and inline code, links, paths, commands, headings, list structure and frontmatter are kept as they are.
- 4Validate and back up
Output is checked, failures get targeted fixes, and the original is saved in a backup folder under the user data directory.
What it steers the agent away from
- Editing source, config or lock files such as .py, .json or .yaml.
- Sending files that look like secrets or contain credentials to the provider.
- Leaving the original file damaged when compression keeps failing.
Install this skill
It installs with the Caveman pack.
All detected agents (Caveman CLI)Detects your agents and logins, shows the changes and installs the full set including the proxy.
npx @caveman-ai/cli@latestSkills only (npx skills)Installs just the skills without the proxy; remove them later with npx skills remove.
npx skills add JuliusBrussee/caveman -gClaude Code (plugin)Run in a terminal; the plugin starts caveman in every interactive session.
claude plugin marketplace add JuliusBrussee/caveman && claude plugin install caveman@cavemanClaude Code (inside a session)The same plugin, typed as slash commands in the Claude Code prompt.
/plugin marketplace add JuliusBrussee/caveman
/plugin install caveman@cavemanGemini CLIInstalls caveman as a Gemini CLI extension.
gemini extensions install https://github.com/JuliusBrussee/cavemanEvery agent via script (macOS, Linux)Pinned to v4.1.0; also adds a Claude Code statusline badge and needs Node.js 22.13 or later.
curl -fsSL https://raw.githubusercontent.com/JuliusBrussee/caveman/v4.1.0/install.sh | bashEvery agent via script (Windows)PowerShell 5.1 or later.
irm https://raw.githubusercontent.com/JuliusBrussee/caveman/v4.1.0/install.ps1 | iexCommands come from the author’s README; check it for changes before you run them.
Questions
Where does the backup go?
To a caveman-compress backups folder under XDG_DATA_HOME, or LOCALAPPDATA on Windows, so skill loaders do not pick it up as a live file.
Which provider does it use?
Whichever one the bundled script is set up to call: the claude CLI, Anthropic's API, or an endpoint compatible with OpenAI's API.
More guides from Caveman
/cavecrewDelegate to subagents that report back in a few linesDecides when to hand work to compact investigator, builder or reviewer subagents and what output format each one returns.Read the guide →/caveman-commitWrite short Conventional Commits that explain whyWrites a Conventional Commits message focused on why, with a body only for breaking changes, migrations or security fixes.Read the guide →/caveman-reviewGet code review comments that fit on one lineProduces review comments as one line per finding with line number, problem, fix and an optional severity tag.Read the guide →/cavemanCut agent replies down to the facts without losing anySwitches replies to a terse voice: answer first, no ceremony, short sentences, with code, paths, numbers and negations kept exact.Read the guide →
Also in this pack
/caveman-discoverFinds each LLM job in a repo, proposes workflow labels in a table and adds the label headers after you approve.↗/caveman-evidence-reviewReviews Caveman Cloud cost, score, workflow and trace data read-only, keeping measured, inferred and verified figures apart.↗/caveman-exploreActs as a read-only explorer that searches the repo in parallel and replies with nothing but file and line-range citations.↗/caveman-learnWalks through a caveman learn token report and applies cost fixes one approved edit at a time, reverting any that do not cut tokens.↗/caveman-manageReads the state and results of a Caveman Cloud experiment and recommends one action, while refusing to execute lifecycle changes.↗/caveman-optimizeTurns a Caveman optimization observation you pick into one candidate change tested against a paired baseline evaluation.↗/caveman-setupRoutes an app's LLM calls through the Caveman Cloud gateway in record-only mode and confirms it with one real request.↗/caveman-statsPrints the output and cache-read tokens recorded for this Claude Code session, plus which mode produced them, without guessing savings.↗/investigate-firstGathers evidence and ranks hypotheses before any edit, reporting the cause and proof rather than a fix.↗/lean-buildBuilds a feature as the narrowest complete path that meets acceptance, leaving out optional modes, config and polish.↗/megacaveAnswers in Classical Chinese register while leaving identifiers, commands and error strings in their original script.↗/migrationPlans schema, data or API migrations with forward and rollback paths, and never runs destructive contraction steps unasked.↗
Summary by trendhub. The skill itself lives in JuliusBrussee/caveman/skills/caveman-compress by Julius Brussee (Apache-2.0); read the full, current text there.