compress

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

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/kaitoartz/dotfiles --skill compress-kaitoartz
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: compress
Source: https://github.com/kaitoartz/dotfiles/tree/main/dot_agents/skills/compress
Command: npx skills add https://github.com/kaitoartz/dotfiles --skill compress-kaitoartz

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Long memory files like CLAUDE.md, todos, and preferences consume large amounts of input tokens every time they are loaded into context, increasing cost and reducing available context window. ## Core Features & Use Cases - Caveman Compression: Rewrites prose in markdown and text files into terse caveman-speak while preserving code blocks, URLs, headings, file paths, and commands exactly. - Validation with Retry: Automatically validates that headings, code blocks, and URLs survived compression, and applies targeted fixes with up to 2 retries before restoring the original. - Safe Overwrite with Backup: Saves the human-readable original as FILE.original.md before overwriting, refuses to compress code, config, or sensitive files like credentials and keys. - Use Case: Your CLAUDE.md has grown to thousands of tokens of verbose instructions. Run the compress command to shrink it into dense caveman format, cutting token usage while keeping every code snippet and link intact. ## Quick Start Ask the AI to compress your memory file by saying "compress memory file CLAUDE.md" or by invoking /caveman:compress with the target filepath.

Frequently Asked Questions about 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, for example /caveman:compress CLAUDE.md, or ask to compress a memory file. The script rewrites prose into caveman format, overwrites the original, and saves a readable backup as CLAUDE.original.md.

What file types can be compressed with caveman format?▼

Only natural language files are compressed: .md, .txt, .markdown, .rst, and extensionless prose files. Code and config files like .py, .js, .json, .yaml, .env, and .sh are detected and skipped automatically.

Does compression modify code blocks or URLs in markdown?▼

No. Code blocks, inline backtick code, URLs, file paths, commands, and headings are preserved exactly. A validation step compares the original and compressed versions and triggers targeted fixes if any of these elements changed.

What happens if compression validation fails?▼

The tool retries up to 2 times by sending only the validation errors to Claude for targeted fixes, without recompressing the whole file. If it still fails, the original content is restored and the backup is removed.

Why does the tool refuse to compress some text files?▼

Files whose names or paths suggest secrets or credentials, such as .env, credentials.md, or files under .ssh or .aws, are refused because compression sends contents to the Anthropic API. Rename the file if it is a false positive.

Can I recover the original file after compression?▼

Yes. Before overwriting, the original is saved as FILE.original.md in the same directory. The tool also aborts if a backup already exists, preventing accidental loss of a previous original.