caveman-compress

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

Updated May 8, 2026
One-click install
npx skills add https://github.com/tomw200082-collab/gt-factory-os-production-brain --skill caveman-compress-tomw200082-collab
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: caveman-compress
Source: https://github.com/tomw200082-collab/gt-factory-os-production-brain/tree/main/.claude/skills/caveman-compress
Command: npx skills add https://github.com/tomw200082-collab/gt-factory-os-production-brain --skill caveman-compress-tomw200082-collab

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 rewrites those files into a terse caveman style that preserves all technical substance while cutting token count by roughly 46% on average. ## Core Features & Use Cases - Token-reducing compression: Rewrites prose by removing articles, filler, hedging, and pleasantries while preserving code blocks, inline code, URLs, file paths, headings, and commands exactly. - Validation with targeted repair: After compression, a local validator checks headings, code blocks, URLs, paths, bullets, and inline code; failures trigger a targeted fix pass (up to 2 retries) rather than full recompression, and the original is restored if validation still fails. - Safe backup handling: The original is saved as FILE.original.md in an out-of-tree data directory ($XDG_DATA_HOME/caveman-compress/backups or %LOCALAPPDATA%) so auto-loaders never re-ingest it, with atomic writes and backup readback verification. - Use Case: Run it on a 700-token CLAUDE.md preferences file and get a ~285-token version that Claude reads every session, with the human-readable original kept safely in the backup directory for future edits. ## Quick Start Ask the assistant to run /caveman-compress on your CLAUDE.md file to shrink it and save tokens in every future session.

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 /caveman-compress followed by the file path, for example /caveman-compress CLAUDE.md. The skill detects the file type, compresses the prose with Claude, validates the output, and writes the compressed version in place while storing the original in an out-of-tree backup directory.

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

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

Does compression preserve code blocks and URLs?▼

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

Where is the original file backed up after compression?▼

The original is saved as FILE.original.md in $XDG_DATA_HOME/caveman-compress/backups/<parent-dir-name>/ on macOS/Linux, or %LOCALAPPDATA%\caveman-compress\backups on Windows. It is kept outside the source directory so skill auto-loaders do not re-ingest it.

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

It refuses files over 500KB, empty files, and files whose names or paths suggest secrets or credentials, such as .env, id_rsa, or anything under .ssh or .aws. Compression sends content to the Anthropic API, so sensitive files are blocked before any data leaves the machine.

What happens if compression validation fails?▼

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