compress
Compress Memory Files to Save Tokens
AI memory files grow large and waste input tokens. This skill compresses natural language prose to caveman format, saving 65-75% of tokens while preserving all code, URLs, and technical content.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "compress". 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.
Expected outcome:
Run tests before push to main. Catch bugs early, prevent broken prod deploys.
Using "compress". 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.
Expected outcome:
Microservices architecture. API gateway route all requests to services. Auth service manage user sessions + JWT tokens.
Security Audit
Low RiskStatic analysis produced 53 potential findings, all evaluated as false positives. The subprocess.run call to 'claude' CLI uses hardcoded arguments with no user input. Environment variable access (ANTHROPIC_API_KEY, CAVEMAN_MODEL) is expected functionality for an AI tool. File path references to .env, .aws, .ssh are part of a security denylist that prevents compressing sensitive files. No confirmed security risks found.
Medium Risk Issues (1)
Low Risk Issues (2)
Risk Factors
📁 Filesystem access (3)
⚙️ External commands (1)
🔑 Env variables (1)
Detected Patterns
Quality Score
What You Can Build
Compress Large CLAUDE.md Files
When your CLAUDE.md project memory file grows beyond 5000 tokens, compress it to caveman format to save input tokens on every Claude session while preserving all technical details.
Optimize Todo and Preference Files
Compress personal productivity files like TODO.md, preferences.md, or notes.md that contain natural language instructions, reducing token usage without losing action items or settings.
Prepare Documentation for AI Context
Before pasting documentation into Claude for analysis, compress verbose explanations to caveman format to fit more content within the context window while keeping all technical specifications intact.
Try These Prompts
Compress my CLAUDE.md file to caveman format
Compress the file at /path/to/notes.md using caveman format
Compress all markdown files in my /docs directory to caveman format
Compress README.md and show me the token savings comparison
Best Practices
- Always review the .original.md backup before deleting it to ensure compression quality
- Test compression on non-critical files first to verify the output meets your needs
- Keep original backups of files containing complex code blocks until you validate the compression preserved them exactly
- Use the compression trigger /caveman:compress <filepath> for precise file targeting
Avoid
- Do not compress code files like .py, .js, .json, or .yaml as the skill will refuse them
- Do not compress files containing sensitive credentials, API keys, or passwords
- Do not delete the .original.md backup file until you have verified the compressed version works correctly
- Do not use this skill on binary files or files larger than 500KB