caveman-compress

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

2|Updated Mar 7, 2025
One-click install
npx skills add https://github.com/AbdelrhmanUZaki/KnowledgeNuggets --skill caveman-compress-abdelrhmanuzaki
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: caveman-compress
Source: https://github.com/AbdelrhmanUZaki/KnowledgeNuggets/tree/main/2-setup/shared/gemini/config/skills/caveman-compress
Command: npx skills add https://github.com/AbdelrhmanUZaki/KnowledgeNuggets --skill caveman-compress-abdelrhmanuzaki

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Long natural language memory files like CLAUDE.md, todos, and preference notes consume excessive input tokens every time they are loaded into an AI context window, increasing cost and reducing available context. ## Core Features & Use Cases - Token-Saving Compression: Rewrites prose into terse caveman-style fragments by removing articles, filler words, hedging, and redundant phrasing. - Safe Content Preservation: Keeps code blocks, inline code, URLs, file paths, commands, technical terms, and markdown structure exactly unchanged. - Automatic Backup and Validation: Saves a human-readable backup as FILE.original.md, validates output, retries targeted fixes up to two times, and leaves the original untouched on failure. - Use Case: Compress a verbose CLAUDE.md project memory file before loading it into an AI session so the same instructions cost far fewer tokens. ## Quick Start Ask the AI to compress your memory file by running the caveman compress command on the target file path, for example compress the file CLAUDE.md in your project root.

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 caveman compress CLI with the absolute file path, for example python3 -m scripts <filepath> from the skill directory. The tool compresses the prose, validates the result, and overwrites the original while saving a backup as FILE.original.md.

What content is preserved when compressing markdown memory files?▼

Code blocks, inline code, URLs, file paths, shell commands, technical terms, proper nouns, dates, version numbers, and environment variables are preserved exactly. Markdown headings, list hierarchy, tables, and YAML frontmatter structure are also kept intact.

Can I compress Python, JSON, or YAML files with this tool?▼

No. The tool only compresses natural language files such as .md, .txt, and extensionless files. It never modifies .py, .js, .json, .yaml, .toml, .env, .sql, .sh, or similar code and config files.

What happens if compression validation fails?▼

The CLI performs targeted cherry-pick fixes with Claude instead of full recompression and retries up to two times. If it still fails, it reports the error and leaves the original file untouched.

How do I restore the original file after compression?▼

A human-readable backup is automatically saved as FILE.original.md before the original is overwritten. Copy or rename that backup file back to the original filename to restore it.