caveman-compress

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

Updated Aug 7, 2026
One-click install
npx skills add https://github.com/Sambhav242005/Major-Project --skill caveman-compress-sambhav242005
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caveman-compress
Source: https://github.com/Sambhav242005/Major-Project/tree/main/.continue/skills/caveman-compress
Command: npx skills add https://github.com/Sambhav242005/Major-Project --skill caveman-compress-sambhav242005

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, and verbose prose inflates token costs each time. This Skill rewrites those files into a terse caveman style while preserving all technical substance, cutting token usage by roughly 46% on average. ## Core Features & Use Cases - Token-reducing compression: Rewrites prose by removing articles, filler, hedging, and pleasantries while keeping meaning intact. - Structure preservation: Headings, code blocks, inline code, URLs, file paths, commands, and YAML frontmatter are preserved exactly, verified by an automated validation pass with up to two targeted fix retries. - Safe backup workflow: The original is saved as FILE.original.md in an out-of-tree data directory before overwriting, and the original is restored automatically if validation fails after retries. - Use Case: Run it on a 700-token CLAUDE.md preferences file and get back a ~285-token version with identical instructions, so every future session loads fewer tokens. ## Quick Start Ask the assistant to run /caveman-compress on your CLAUDE.md file to compress it and create a backup of the original.

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, or invoke the scripts module with python3 -m scripts <filepath>. The skill rewrites the prose into caveman format, validates the output, and stores the original as a .original.md backup in a platform data directory.

What file types can be compressed with caveman-compress?

Natural language files with .md, .txt, .markdown, .rst, .typ, .typst, and .tex extensions are compressible, plus extensionless prose files. Code and config files like .py, .js, .json, .yaml, and .env are detected and skipped.

Does compression preserve code blocks and URLs?

Yes. Fenced code blocks, inline backtick code, URLs, file paths, commands, headings, and YAML frontmatter are preserved exactly. A validation step compares the original and compressed versions and triggers targeted fixes if anything was altered.

Where is the original file backed up after compression?

The original is saved as FILE.original.md in an out-of-tree data directory: $XDG_DATA_HOME/caveman-compress/backups/<parent-dir-name>/ on macOS/Linux, or %LOCALAPPDATA%\caveman-compress\backups on Windows. This prevents skill auto-loaders from re-ingesting the backup.

Why does caveman-compress refuse to compress some files?

Files larger than 500KB, empty files, and files whose names suggest secrets or credentials (like .env, credentials, or id_rsa) are refused. Compression sends content to the Anthropic API, so sensitive-looking files are blocked before any data leaves the machine.

What happens if validation fails after compression?

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