Caveman Compress

Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format

What Is This

Caveman Compress is a technical skill for the Happycapy Skills platform that efficiently reduces the token count of natural language memory files by converting them into a compressed "caveman" format. This skill is designed to process files such as CLAUDE.md, todos, and user preferences, transforming verbose content into a minimal, direct style while retaining all technical substance, code snippets, URLs, and file structure. The compression process overwrites the original file and stores a human-readable backup as <filename>.original.md for reference and rollback.

Why Use It

Large memory files in natural language can quickly exhaust input token limits for LLM-based systems, resulting in higher costs and reduced performance. By compressing these files into a concise format, Caveman Compress helps users maximize information density, reduce memory footprint, and maintain essential technical details. This enables more efficient use of LLM context windows and improves the responsiveness and accuracy of automated agents or assistants that rely on these files.

How to Use It

Triggering the Skill

There are two primary ways to activate Caveman Compress:

  • Use the command:

    /caveman:compress <filepath>

    Replace <filepath> with the absolute path to the target file.

  • Issue a natural language request such as "compress memory file" to the platform.

Compression Workflow

  1. Locate the Skill Directory
    Ensure the SKILL.md and the scripts/ folder are in the same directory. Identify that directory before proceeding.

  2. Run the Compression Script
    Navigate to the directory and execute the compression script using:

    cd <directory_containing_SKILL.md> && python3 -m scripts <absolute_filepath>

    Replace <absolute_filepath> with the path to the file you want to compress.

  3. Automated Process

    • The CLI detects the file type (without using tokens).
    • The content is sent to Claude for compression into caveman format.
    • Output is validated for correctness and structure (again, without expending tokens).
    • If errors occur, Claude is prompted for targeted fixes (no full recompression), with up to two retries.
    • The compressed file overwrites the original, and a backup is saved as <filename>.original.md.

Example

Suppose you have a verbose CLAUDE.md file:

Original:

## User Preferences

The user prefers to receive concise, well-formatted responses. It would be good to ensure all links are included. Please make sure to avoid unnecessary repetition.

## Tasks

- Write a summary of recent project updates.
- Review the code for errors and suggest improvements.
- Share any useful resources or URLs.

After Compression:

## User Preferences

User prefer concise, formatted responses. Ensure all links included. Avoid repetition.

## Tasks

- Summarize recent project updates.
- Review code for errors, suggest improvements.
- Share useful resources, URLs.

When to Use It

Caveman Compress is optimal when:

  • You need to store or process large natural language files in LLM workflows but are constrained by input token limits.
  • You want to preserve all technical information, code, and links while eliminating filler words and redundant phrasing.
  • You require a reversible process that allows rollback to the original file if necessary.
  • You want consistency and predictability in compressed file structure and content.

Typical use cases include preparing memory files for LLM agents, compressing todo lists for automated processing, or minimizing the size of preference/configuration files without loss of detail.

Important Notes

  • Compression Rules:
    The skill aggressively removes articles (a, an, the), filler words (just, really, basically), pleasantries (sure, happy to), hedging phrases, and redundant phrasing. All technical content, code blocks, and URLs are retained for integrity.

  • Backups:
    The original file is always backed up as <filename>.original.md before overwriting, ensuring reversibility.

  • Language and Format:
    Output is strictly English with no emojis or non-ASCII characters. File headers, code, and structure are preserved.

  • Limitations:
    The skill does not compress code or technical structures, only natural language. It is not intended for binary files or formats other than Markdown or simple text.

  • Error Handling:
    If the compressed output contains errors or corruptions, the skill attempts targeted fixes via Claude, retrying up to two times before returning a result.

  • Professional Use:
    This skill is designed for users who need efficient, non-destructive, and reversible file compression in technical environments. Always review the compressed file and backup after processing.

For more information, visit the source repository: caveman-compress on GitHub.