caveman-compress

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

Updated Jul 23, 2025
One-click install
npx skills add https://github.com/derrik-fleming/dotfiles --skill caveman-compress-derrik-fleming
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: caveman-compress
Source: https://github.com/derrik-fleming/dotfiles/tree/main/private_dot_agents/skills/caveman-compress
Command: npx skills add https://github.com/derrik-fleming/dotfiles --skill caveman-compress-derrik-fleming

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 preference notes are loaded into context on every session start, so large files repeatedly consume input tokens. 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 redundant phrasing while keeping meaning intact. - Strict preservation rules: Code blocks, inline code, URLs, file paths, commands, headings, and technical terms are never modified. - Validation with targeted fixes: A local validator checks headings, code blocks, URLs, paths, and bullets; if errors are found, only the broken parts are patched via a targeted fix pass, with up to 2 retries and automatic restore of the original on failure. - Safe backup workflow: The original content is saved as FILE.original.md before overwriting, and existing backups are never overwritten. - 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 automatically. ## Quick Start Ask the assistant to compress your CLAUDE.md memory file with the caveman-compress skill, for example by saying "compress memory file CLAUDE.md".

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, or ask to compress a memory file. The skill detects the file type, compresses the prose with Claude, validates the output, and writes the compressed version with a .original.md backup.

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, .ts, .json, .yaml, .toml, and .sh are detected and skipped, as are existing .original.md backups.

Does compression preserve code blocks and URLs?▼

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

What happens if compression validation fails?▼

The skill sends only the listed validation errors to Claude for a targeted fix without recompressing, retrying up to 2 times. If it still fails, the original file content is restored and the backup is removed, leaving your file untouched.

Can I recover the original file after compression?▼

Yes. Before overwriting, the original content is saved as FILE.original.md next to the compressed file. You can read or edit that backup at any time and re-run the compression after making edits.

What are the limitations of caveman file compression?▼

Files larger than 500KB are rejected before any API call. Compression requires either an ANTHROPIC_API_KEY for the Anthropic SDK or the claude CLI for authentication, and only natural language content is modified.