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 compress-abdelrhmanuzaki
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: compress
Source: https://github.com/AbdelrhmanUZaki/KnowledgeNuggets/tree/main/2-setup/shared/gemini/config/skills/compress
Command: npx skills add https://github.com/AbdelrhmanUZaki/KnowledgeNuggets --skill 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 Reduction: Rewrites prose into terse caveman-style fragments by removing articles, filler words, pleasantries, and hedging language. - Safe Compression: Preserves code blocks, inline code, URLs, file paths, commands, technical terms, and markdown structure exactly as-is. - Automatic Backup: Saves the human-readable original as FILE.original.md before overwriting the compressed version. - Validated Output: Runs validation with up to 2 targeted retry fixes, leaving the original untouched if compression fails. - Use Case: Compress a lengthy CLAUDE.md project memory file before starting a session so the AI loads the same instructions using far fewer tokens. ## Quick Start Ask the AI to compress your memory file by running the compress skill on the absolute path of your CLAUDE.md or notes file.

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 skill with the absolute filepath of your CLAUDE.md file, or ask the AI to compress the memory file. The skill rewrites prose into terse fragments, overwrites the original, and saves a readable backup as FILE.original.md.

What content is preserved when compressing markdown 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 source files?▼

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

What happens if compression validation fails?▼

The skill retries up to 2 times using targeted fixes on only the failing sections rather than recompressing everything. If it still fails, it reports the error and leaves the original file completely untouched.

How do I restore the original file after compression?▼

The original human-readable version is automatically saved as FILE.original.md in the same location before overwriting. Copy or rename that backup file to restore the uncompressed content.