caveman-compress

Compress natural-language memory files into caveman format while preserving code blocks, URLs, and headings.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Large Claude memory files like CLAUDE.md, todos, and preferences consume tokens on every session start, increasing cost and slowing context loading.

Core Features & Use Cases

  • Compress natural-language memory files into a shorter “caveman” format to reduce input tokens.
  • Preserve structure and substance by keeping code blocks, inline code, URLs, headings, and file paths unchanged.
  • Validate and self-correct by checking for mismatches and applying targeted fixes only when validation fails.
  • Safety guardrails that reject files likely containing secrets/credentials or data larger than 500KB to avoid accidental exfiltration.

Quick Start

Ask your AI to run the command to compress a memory file, for example: /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 Claude memory token costs for loaded markdown files?▼

You can reduce Claude memory token costs by compressing natural-language memory files like CLAUDE.md into a shorter caveman format. The process overwrites the original file with a compressed version while preserving code blocks, URLs, and headings exactly to maintain structure.

What is caveman format compression for markdown context files?▼

Caveman format compression is a token optimization technique that shortens natural-language memory files loaded at Claude session start. It reduces input tokens by rewriting text into a dense format while keeping code blocks, inline code, URLs, and file paths unchanged.

Does memory compression preserve markdown code blocks and URLs?▼

Yes, memory compression preserves markdown code blocks and URLs exactly. The validation process checks for mismatches and applies targeted fixes only if validation fails, ensuring inline code, file paths, and headings remain unchanged during token optimization.

How do I backup files before compressing Claude preferences?▼

To backup files before compressing Claude preferences, the skill automatically writes a human-editable FILE.original.md backup before overwriting the original file. This ensures you can always revert to the uncompressed natural-language version if needed.

What are the limitations of compressing markdown memory files?▼

Limitations of compressing markdown memory files include a 500KB file size limit to prevent accidental data exfiltration. Additionally, safety guardrails will reject files likely containing secrets or credentials to avoid compromising sensitive information during token optimization.

Can I use tiktoken for Claude Code context cost optimization?▼

Yes, you can use tiktoken alongside anthropic dependencies for Claude Code context cost optimization. This combination enables the script to accurately measure token reduction when natural-language memory files are compressed into the caveman format.