caveman-compress

Compress natural-language markdown memory files while preserving URLs, headings, code blocks, and file paths.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

It reduces the token cost of loading large natural-language project memory files on every Claude session by compressing them into shorter “caveman” phrasing while preserving meaning and structure.

Core Features & Use Cases

  • Compresses memory files: Shrinks natural-language markdown files such as CLAUDE.md, todos, and preferences to lower context tokens.
  • Preserves critical structure: Keeps headings, tables, lists, URLs/links, commands, inline code, fenced code blocks, and file paths unchanged.
  • Validated retries with guardrails: Validates outputs and uses targeted fixes (no full recompression) when validation fails; aborts and restores the original after repeated failure.
  • Safety checks: Refuses files that look sensitive (e.g., keys, credentials, common secret filenames/paths) to avoid sending sensitive content to an external API boundary.

Quick Start

Use the caveman-compress skill to compress your CLAUDE.md by telling an AI assistant: /caveman-compress CLAUDE.md

Frequently Asked Questions about caveman-compress

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

FAQPage Schema
How do I reduce input tokens spent loading markdown memory files for every Claude session?

You can reduce input tokens by compressing markdown memory files into shorter phrasing while preserving headings, code blocks, URLs, and file paths. This lowers the context token cost of loading files like CLAUDE.md at every Claude session start.

What is the best way to compress markdown context without breaking code blocks and file paths?

Compress markdown context safely by applying targeted compression that explicitly preserves critical structure. It keeps headings, tables, lists, fenced code blocks, inline code, commands, and file paths unchanged while shortening surrounding natural-language text.

Does markdown compression overwrite my original files or keep a backup?

Markdown compression overwrites the original file but first creates a FILE.original.md backup. It validates the output and uses targeted repair retries, aborting and restoring the original file if validation repeatedly fails.

Can I compress CLAUDE.md files that contain sensitive credentials or API keys?

You should not compress files containing sensitive credentials. The compression process refuses files that look sensitive, including keys, credentials, and common secret filenames or paths, to avoid sending sensitive content to an external API boundary.

Do I need anthropic and tiktoken dependencies to optimize Claude memory context?

Yes, optimizing Claude memory context requires the anthropic and tiktoken dependencies. These libraries handle natural-language compression processing and validate token savings for markdown files loaded during repeated AI assistant sessions.