caveman-compress

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

Updated Aug 6, 2026
One-click install
npx skills add https://github.com/ferrarifankid04/ai-skills-public --skill caveman-compress-ferrarifankid04
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caveman-compress
Source: https://github.com/ferrarifankid04/ai-skills-public/tree/main/antigravity/caveman/plugins/caveman/skills/caveman-compress
Command: npx skills add https://github.com/ferrarifankid04/ai-skills-public --skill caveman-compress-ferrarifankid04

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Long natural language memory files like CLAUDE.md, todos, and preference notes consume large amounts of input tokens every time an AI agent loads them, inflating cost and context usage without adding information. ## Core Features & Use Cases - Token-Saving Compression: Rewrites prose into terse caveman-style fragments while preserving code blocks, inline code, URLs, file paths, headings, and YAML frontmatter exactly. - Validated In-Place Overwrite: Backs up the original to a platform-aware backup directory, overwrites the source file, then validates headings, code blocks, URLs, and inline code with up to two Claude-assisted fix retries. - Safety Guardrails: Detects and skips code/config files, refuses sensitive files (credentials, keys, .env, SSH paths), and restores the original if validation fails after retries. - Use Case: A developer with a 2,000-word CLAUDE.md runs the skill to shrink it to a fraction of its size, cutting token usage on every session while keeping all commands and links intact. ## Quick Start Ask the agent to compress your memory file by saying: compress my CLAUDE.md file with caveman-compress.

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 the skill with the file path, for example /caveman-compress CLAUDE.md, or ask the agent to compress the memory file. The script detects the file type, compresses the prose with Claude, validates the output, and overwrites the original while saving a backup.

What file types can be compressed with caveman compression?

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

Does compression preserve code blocks and URLs?

Yes. Code blocks, inline backtick code, URLs, file paths, headings, and YAML frontmatter are preserved exactly. A validation step compares the original and compressed versions and triggers targeted fixes if any of these elements are lost or altered.

Where is the original file backed up before overwriting?

The original is saved as FILE.original.md in a platform-aware backup directory outside the source tree: %LOCALAPPDATA%\caveman-compress\backups on Windows, or $XDG_DATA_HOME/caveman-compress/backups (defaulting to ~/.local/share) elsewhere.

Why does compression refuse to run on some files?

The skill refuses files whose names or paths suggest secrets or PII, such as credentials, .env, SSH keys, or files under .ssh, .aws, or .gnupg, because compression sends content to the Anthropic API. It also rejects empty files and files over 500KB.

What happens if validation fails after compression?

The skill sends the specific validation errors to Claude for targeted fixes and retries up to two times. If validation still fails, the original file is restored from the backup and the backup is removed, leaving your file untouched.