shrink memory file. save token every session.
A Claude Code skill that compresses your project memory files (CLAUDE.md, todos, preferences) into caveman format — so every session loads fewer tokens automatically.
Claude read CLAUDE.md on every session start. If file big, cost big. Caveman make file small. Cost go down forever.
/caveman-compress CLAUDE.md
CLAUDE.md ← compressed (Claude reads this — fewer tokens every session) CLAUDE.original.md ← human-readable backup (you edit this)
Original never lost. You can read and edit .original.md. Run skill again to re-compress after edits.
Real results on real project files:
| File | Original | Compressed | Saved |
|---|---|---|---|
claude-md-preferences.md | 706 | 285 | 59.6% |
project-notes.md | 1145 | 535 | 53.3% |
claude-md-project.md | 1122 | 687 | 38.8% |
todo-list.md | 627 | 388 | 38.1% |
mixed-with-code.md | 888 | 574 | 35.4% |
| Average | 898 | 494 | 45% |
All validations passed ✅ — headings, code blocks, URLs, file paths preserved exactly.
|
|
Same instructions. 60% fewer tokens. Every. Single. Session.
cp -r ~/.claude/skills/caveman-compress <path-to-skill>
Or if you have the caveman repo:
cp -r skills/caveman-compress ~/.claude/skills/caveman-compress
Requires: Python 3.10+
/caveman-compress <filepath>
Examples:
/caveman-compress CLAUDE.md /caveman-compress docs/preferences.md /caveman-compress todos.md
| Type | Compress? |
|---|---|
.md, .txt, .rst | ✅ Yes |
| Extensionless natural language | ✅ Yes |
.py, .js, .ts, .json, .yaml | ❌ Skip (code/config) |
*.original.md | ❌ Skip (backup files) |
/caveman-compress CLAUDE.md ↓ detect file type (no tokens) ↓ Claude compresses (tokens — one call) ↓ validate output (no tokens) checks: headings, code blocks, URLs, file paths, bullets ↓ if errors: Claude fixes cherry-picked issues only (tokens — targeted fix) does NOT recompress — only patches broken parts ↓ retry up to 2 times ↓ write compressed → CLAUDE.md write original → CLAUDE.original.md
Only two things use tokens: initial compression + targeted fix if validation fails. Everything else is local Python.
Caveman compress natural language. It never touch:
``` fenced or indented)`backtick content`)/src/components/...)npm install, git commit)CLAUDE.md loads on every session start. A 1000-token project memory file costs tokens every single time you open a project. Over 100 sessions that's 100,000 tokens of overhead — just for context you already wrote.
Caveman cut that by ~45% on average. Same instructions. Same accuracy. Less waste.
┌──────────────────────────────────────────┐ │ TOKEN SAVINGS PER FILE ████████ 45% │ │ SESSIONS THAT BENEFIT ████████ 100% │ │ INFORMATION PRESERVED ████████ 100% │ │ SETUP TIME █ 1x │ └──────────────────────────────────────────┘
This skill is part of the caveman toolkit — making Claude use fewer tokens without losing accuracy.