caveman-compress
Compress memory files to reduce token costs
Large memory files like CLAUDE.md waste tokens on every AI session start. This skill compresses them by about 46 percent while keeping all technical content intact.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "caveman-compress". A 706-token CLAUDE.md file with TypeScript preferences, testing guidelines, and project conventions written in full prose.
Expected outcome:
A 285-token compressed version preserving all technical instructions in direct caveman-style prose. Headings, code examples, and URLs remain unchanged. Original saved as CLAUDE.original.md.
Using "caveman-compress". A 1145-token project notes file with architecture descriptions, deployment steps, and team conventions.
Expected outcome:
A 535-token compressed file. All section headings preserved exactly. Code blocks and URLs intact. Redundant explanations condensed to essential facts. Backup saved as project-notes.original.md.
Security Audit
Low RiskStatic analysis flagged 107 potential issues across 10 files with a risk score of 100/100. After semantic evaluation, all flagged patterns are false positives. The external_commands findings (74 locations) are primarily markdown backticks in documentation files misidentified as shell execution. The one real subprocess call in scripts/compress.py uses hardcoded arguments with stdin input and no shell interpolation. Network findings (2 locations) are static URLs in README.md documentation, not runtime requests. Filesystem findings (2 locations) are standard path resolution for a file-processing tool. Environment access findings (9 locations) are legitimate ANTHROPIC_API_KEY and CAVEMAN_MODEL configuration for API usage. The critical heuristic finding about code execution plus network plus credential access is a false positive describing the normal operation of an Anthropic API client. No prompt injection attempts, data exfiltration patterns, or malicious intent detected. The tool has appropriate safeguards including file size limits (500KB), automatic backups, and retry logic with rollback on failure.
Low Risk Issues (3)
Risk Factors
⚙️ External commands (1)
🔑 Env variables (1)
Quality Score
What You Can Build
Reduce recurring session costs
Compress your CLAUDE.md project memory file once. The smaller file loads on every session start, saving tokens every time you work with AI.
Optimize team documentation
Compress shared preference files, style guides, and project conventions. Team members get the same instructions with fewer input tokens per session.
Condense long-term project notes
Compress accumulated todo lists, meeting notes, and decision logs into essential facts. Keep all information without the verbose overhead.
Try These Prompts
Compress the file at CLAUDE.md into caveman format.
Compress these memory files: CLAUDE.md, todos.md, and preferences.txt.
I updated CLAUDE.original.md with new coding standards. Compress it again to replace CLAUDE.md.
Set CAVEMAN_MODEL to claude-haiku and compress CLAUDE.md.
Best Practices
- Edit the .original.md backup file, then recompress. This keeps your source of truth in human-readable format.
- Run compression after major updates to memory files. Fresh edits often add verbose explanations that compress well.
- Review the compressed output before relying on it. Validation checks technical content but style changes may affect nuance.
Avoid
- Do not compress code files, configuration files, or any file with primarily code content. The tool will skip these automatically.
- Do not delete the .original.md backup. It is your human-readable source and recovery point.
- Do not run compression repeatedly on unchanged files. Each run consumes API tokens. Compress only after meaningful edits.