caveman-compress

Compress natural language memory files into caveman format to reduce input tokens.

3|Updated Apr 8, 2025
One-click install
npx skills add https://github.com/ZanzyTHEbar/dragonarchy --skill caveman-compress-zanzythebar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caveman-compress
Source: https://github.com/ZanzyTHEbar/dragonarchy/tree/main/packages/opencode/.config/opencode/skills/caveman-compress
Command: npx skills add https://github.com/ZanzyTHEbar/dragonarchy --skill caveman-compress-zanzythebar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires anthropic, tiktoken, and includes scripts (resource) components.

What problem does it solve? Project memory files like CLAUDE.md, todos, and preferences load on every AI session start, and large files consume input tokens repeatedly. This Skill compresses those natural language files into a terse caveman format, cutting token usage by roughly 46% on average while preserving all technical substance. ## Core Features & Use Cases - Token-Reducing Compression: Rewrites prose by removing articles, filler, hedging, and pleasantries while keeping meaning intact. - Strict Preservation: Code blocks, inline code, URLs, file paths, commands, headings, and technical terms are preserved exactly, enforced by automated validation. - Safe Backup Workflow: The original file is saved as FILE.original.md before overwriting, and the original is restored automatically if validation fails after retries. - Use Case: Run it on a 1000-token CLAUDE.md once, and every subsequent session loads the compressed version, saving hundreds of tokens per session. ## Quick Start Ask the AI to compress your CLAUDE.md memory file with the caveman compress command to shrink it and create a readable backup.

Frequently Asked Questions about caveman-compress

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress a CLAUDE.md file to save tokens?

Run the compress command with the file path, such as /caveman:compress CLAUDE.md. The skill detects the file type, compresses the prose with Claude, validates the output, and writes the compressed version while saving the original as CLAUDE.original.md.

What file types can be compressed with caveman-compress?

Natural language files like .md, .txt, .markdown, .rst, and extensionless prose files are compressed. Code and config files such as .py, .js, .json, .yaml, and .sh are detected and skipped, as are .original.md backup files.

Does compression preserve code blocks and URLs?

Yes. Code blocks, inline code, URLs, file paths, commands, headings, and technical terms are preserved exactly. A validation step compares the original and compressed output and triggers targeted fixes if any of these elements are altered.

What happens if compression validation fails?

The skill retries with targeted fixes up to two times, patching only the reported errors without recompressing. If validation still fails, the original file content is restored and the backup is removed, leaving your file untouched.

Do I need an API key to run the compression?

If ANTHROPIC_API_KEY is set, the skill uses the Anthropic Python SDK directly. Otherwise it falls back to the claude CLI, which uses your existing Claude desktop authentication. Files larger than 500KB are rejected before any API call.