caveman--caveman-compress

Compress markdown memory files into terse caveman format to reduce repeated input tokens.

Updated Dec 3, 2025
One-click install
npx skills add https://github.com/hhenrichsen/dots --skill caveman-caveman-compress-hhenrichsen
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: caveman--caveman-compress
Source: https://github.com/hhenrichsen/dots/tree/main/dot_skills/caveman/caveman-compress
Command: npx skills add https://github.com/hhenrichsen/dots --skill caveman-caveman-compress-hhenrichsen

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Large project memory files like CLAUDE.md, todo lists, and preference notes are loaded into every AI session, repeatedly consuming input tokens. This Skill rewrites supported natural-language files into a terse caveman style while preserving code blocks, URLs, headings, and file paths, and keeps a human-readable backup for editing. ## Core Features & Use Cases - Token Reduction: Compresses .md, .txt, .rst, .typ, .typst, and .tex files by removing filler words, hedging, and redundant phrasing, averaging about 46% fewer tokens on benchmark fixtures. - Structural Validation: Verifies that headings, fenced and indented code blocks, inline code, URLs, and file paths survive compression exactly, with up to two targeted fix retries before aborting safely. - Safe Backups: Stores the original as a byte-for-byte .original.md backup in an out-of-tree data directory so skill auto-loaders never re-ingest it, and refuses sensitive filenames like credentials or secrets. - Use Case: A developer with a 1,000-token CLAUDE.md runs the skill once; every subsequent session loads the compressed version, cutting recurring input token cost while the editable original stays in the backup directory. ## Quick Start Ask the AI to run /caveman-compress on your CLAUDE.md file to shrink it and create a readable backup.

Frequently Asked Questions about caveman--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 /caveman-compress followed by the file path, such as /caveman-compress CLAUDE.md. The skill compresses the prose in place and saves the original as a .original.md backup in an out-of-tree data directory.

What file types can be compressed with caveman-compress?▼

It compresses natural-language files: .md, .txt, .markdown, .rst, .typ, .typst, .tex, and extensionless prose files. Code and config files like .py, .js, .json, and .yaml are detected and skipped automatically.

Does compression preserve code blocks and URLs in markdown?▼

Yes. Fenced and indented code blocks, inline backtick code, URLs, file paths, headings, and commands are preserved exactly. A validator compares original and compressed output and triggers targeted fixes if anything is lost.

Where is the original file backup stored after compression?▼

Backups go to $XDG_DATA_HOME/caveman-compress/backups/<parent-dir-name>/ on macOS and Linux, or %LOCALAPPDATA%\caveman-compress\backups\ on Windows. Keeping them out of the source tree prevents auto-loaders from reading them twice.

Why does caveman-compress refuse to compress some files?▼

It refuses files over 500KB, files that are not valid UTF-8, empty files, and filenames that look sensitive such as credentials, secrets, passwords, or SSH keys, since compression sends content to the Anthropic API.

What are the limitations of caveman file compression?▼

Compression only works on natural-language prose and requires an Anthropic API key or the claude CLI. Benchmarks show about 46% token reduction on fixtures, but structural validation does not guarantee semantic equivalence on all files.