compress

Compress Markdown memory files while preserving headings, URLs, paths, and code blocks.

Updated Feb 12, 2021
One-click install
npx skills add https://github.com/echowaves/WiSaw.cdk --skill compress-echowaves
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compress
Source: https://github.com/echowaves/WiSaw.cdk/tree/main/.agents/skills/compress
Command: npx skills add https://github.com/echowaves/WiSaw.cdk --skill compress-echowaves

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires subprocess, os, re, typing, pathlib, json, tiktoken, and includes scripts (resource) components.

What problem does it solve?

This Skill compresses natural-language memory files to reduce input token usage while preserving technical meaning, structure, and all URLs.

Core Features & Use Cases

  • Token-saving compression: Converts prose-like Markdown (CLAUDE.md, todos, preferences) into a shorter “caveman” format.
  • Safety guardrails: Refuses to compress files that look like they contain secrets or sensitive credentials to avoid third-party data exfiltration.
  • Validation and targeted recovery: Restores the original on repeated validation failure and attempts targeted fixes without full recompression.

Quick Start

Indent and ask the caveman compress Skill to compress a memory file at path notes/CLAUDE.md.

Frequently Asked Questions about compress

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce Markdown memory file tokens without losing technical substance?

To reduce markdown memory file tokens without losing substance, this Skill compresses natural-language prose into a shorter format. It strictly preserves headings, URLs, file paths, and code blocks while converting text into a condensed structure to maximize model input limits.

When do I need to compress CLAUDE.md notes for model context limits?

You need to compress CLAUDE.md notes when maintaining long-running preferences or todos that exceed model input limits. This process shrinks the token count of natural-language memory files, allowing you to fit more context into the available model input window.

How does token optimization handle file paths and code blocks during markdown compression?

Token optimization during markdown compression handles file paths and code blocks by keeping them completely intact. The process validates the compressed output by checking that headings, URLs, code blocks, and path patterns remain structurally preserved.

Can I safely compress markdown files that might contain sensitive credentials?

You cannot safely compress markdown files with sensitive credentials using this approach, as built-in guardrails refuse to process files that appear to contain secrets. This safety mechanism prevents accidental third-party data exfiltration during token optimization.

What happens to the original file when a markdown compression validation fails?

When markdown compression validation fails, the Skill attempts targeted fixes without full recompression. If repeated validation fails, it restores the original file from a generated FILE.original.md backup to ensure no data is lost.

What is the best way to automate markdown compression for CLI workflows?

The best way to automate markdown compression for CLI workflows is using a script-based approach that backs up the original file as FILE.original.md before processing. This ensures token optimization runs safely while preserving technical structure and URLs.