caveman-compress

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

1|Updated Apr 23, 2026
One-click install
npx skills add https://github.com/tkogut/agents-os-core --skill caveman-compress-tkogut
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: caveman-compress
Source: https://github.com/tkogut/agents-os-core/tree/main/vault/.agents/skills/caveman-compress
Command: npx skills add https://github.com/tkogut/agents-os-core --skill caveman-compress-tkogut

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 compresses those natural-language files into a terse caveman format while preserving code blocks, URLs, headings, and file paths exactly, cutting token usage by roughly 40-60% on benchmarked fixtures. ## Core Features & Use Cases - Token-reducing compression: Rewrites prose by removing articles, filler, hedging, and redundant phrasing while keeping technical terms, commands, and structure intact. - Safe in-place overwrite with backup: The original is saved byte-for-byte to an out-of-tree data directory as <filename>.original.md, and the compressed output is written atomically only after validation passes. - Structural validation with targeted repair: Headings, code blocks, URLs, file paths, and inline code are verified after compression; only failing sections are sent back for targeted fixes, with up to two retries. - Use Case: A developer with a 1,100-token CLAUDE.md runs the skill once, reducing it to about 640 tokens so every subsequent session starts with a smaller context footprint. ## Quick Start Ask the AI to run /caveman-compress on your CLAUDE.md file to shrink it and keep 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 /caveman-compress followed by the file path, for example /caveman-compress CLAUDE.md. The skill compresses the prose in place and saves the original as CLAUDE.original.md in an out-of-tree backup directory.

What file types can caveman-compress handle?▼

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

Does compression preserve code blocks and URLs?▼

Yes. Fenced and indented code blocks, inline backtick code, URLs, file paths, headings, and commands are preserved exactly. A validator compares these elements between original and compressed output and rejects the result if any are lost or altered.

Where is the original file backed up after compression?▼

The original is saved to $XDG_DATA_HOME/caveman-compress/backups/<parent-dir-name>/ on macOS and Linux, or %LOCALAPPDATA%\caveman-compress\backups\ on Windows. Keeping it outside the source tree prevents skill auto-loaders from re-ingesting the backup.

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

It refuses files over 500KB, files that are not valid UTF-8, and files whose names or paths suggest secrets or credentials, since content is sent to the Anthropic API. It also aborts if the compressed output is not smaller than the input.

Does caveman-compress require an API key?▼

If ANTHROPIC_API_KEY is set, it uses the Anthropic Python SDK directly. Otherwise it falls back to the claude CLI, which uses existing Claude desktop authentication, so no separate key is required.