Skills compress
📦

compress

Low Risk 📁 Filesystem access⚙️ External commands🔑 Env variables

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.

Supports: Claude Codex Code(CC)
📊 71 Adequate
1

Download the skill ZIP

2

Upload in Claude

Go to Settings → Capabilities → Skills → Upload skill

3

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 Risk
v1 • 4/20/2026

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

8
Files scanned
819
Lines analyzed
6
findings
1
Total audits
Medium Risk Issues (1)
Subprocess Execution with Fallback
The skill uses subprocess.run to execute the 'claude' CLI command as a fallback when the Anthropic Python SDK is unavailable. Arguments are hardcoded with no user input, eliminating command injection risk.
Low Risk Issues (2)
Environment Variable Access for API Configuration
The skill reads ANTHROPIC_API_KEY and CAVEMAN_MODEL environment variables to make API calls. This is expected functionality for an AI tool that compresses files by sending them to Claude.
File Overwrite with Backup Protection
The skill overwrites the original file with compressed content after creating a backup at FILE.original.md. Checks for existing backup to prevent data loss.

Detected Patterns

Sensitive Path Denylist (Protective Pattern)
Audited by: claude

Quality Score

45
Architecture
100
Maintainability
85
Content
50
Community
81
Security
83
Spec Compliance

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

Basic File Compression
Compress my CLAUDE.md file to caveman format
Compress Specific File
Compress the file at /path/to/notes.md using caveman format
Compress Multiple Files
Compress all markdown files in my /docs directory to caveman format
Verify Compression
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

Frequently Asked Questions

What files can I compress?
Only natural language files with extensions like .md, .txt, .markdown, or .rst. Code files such as .py, .js, .json, .yaml, and .env are automatically skipped to preserve functionality.
Is my original file safe?
Yes. A backup is created at FILE.original.md before any modification. If compression fails after retries, the original file is automatically restored. The skill also refuses to proceed if a backup already exists.
Does compression change code blocks or URLs?
No. Code blocks, inline code, URLs, file paths, commands, and technical terms are preserved exactly. Only natural language prose is compressed to caveman format.
What happens if compression fails?
The skill validates the output and retries up to 2 times with targeted fixes. If validation still fails after retries, the original file is restored and the backup is deleted.
Do I need an API key?
The skill first tries the Anthropic Python SDK with ANTHROPIC_API_KEY. If unavailable, it falls back to the Claude CLI which handles its own authentication. Set CAVEMAN_MODEL to override the default claude-sonnet-4-5.
Can I compress files with credentials?
No. The skill refuses to compress files matching patterns like .env, credentials, secrets, .ssh, .aws, .gnupg, and other sensitive paths. Compression sends content to an external API, so sensitive files are blocked as a security measure.

Developer Details

File structure