compress

Compress markdown and text memory files into terse caveman format to reduce input tokens.

Updated Jan 28, 2026
One-click install
npx skills add https://github.com/ttphats/project-detedxs26 --skill compress-ttphats
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: compress
Source: https://github.com/ttphats/project-detedxs26/tree/main/.augment/skills/caveman-compress
Command: npx skills add https://github.com/ttphats/project-detedxs26 --skill compress-ttphats

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Long natural-language memory files (.md, .txt) consume excessive input tokens when loaded into an LLM context. This Skill rewrites prose into terse caveman-style fragments while preserving all technical substance, cutting token usage without losing meaning. ## Core Features & Use Cases - Inline LLM Compression: The agent itself rewrites prose (no external API call), removing articles, filler words, and hedging while keeping code blocks, URLs, paths, and technical terms exactly intact. - Safety Pipeline: Pre-flight detection skips code/config files, a sensitive-path denylist blocks credentials and keys, originals are backed up as <filename>.original.md, and a validator checks headings, code blocks, URLs, and bullet counts after compression. - Benchmarking: A benchmark script measures token savings per file pair using tiktoken (or word count fallback) and reports validation status. - Use Case: You maintain a large CLAUDE.md or project memory file that eats thousands of tokens each session. Run the compress command on it to shrink it by a significant percentage while keeping every command, link, and code snippet verbatim. ## Quick Start Ask the agent to compress a memory file, for example: run /caveman:compress on docs/project-memory.md to shrink its token footprint.

Frequently Asked Questions about compress

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

FAQPage Schema
How do I compress a markdown file to save LLM tokens?▼

Invoke the compress trigger with the target filepath, such as /caveman:compress <filepath>. The agent runs a detection check, backs up the original as <filename>.original.md, rewrites the prose inline, and validates the result before finishing.

What content is preserved when compressing markdown files?▼

Code blocks, inline code, URLs, file paths, commands, technical terms, dates, version numbers, and environment variables are preserved exactly. All markdown headings, bullet hierarchy, numbered lists, tables, and YAML frontmatter structure are also kept intact.

Which file types can be compressed with this approach?▼

Only natural language files with .md, .txt, .markdown, or .rst extensions are compressed. Code and config files such as .py, .js, .ts, .json, .yaml, .toml, .env, .css, and .html are always skipped by the detection logic.

Does compression work on files containing credentials or secrets?▼

No. A sensitive-path denylist refuses files matching credential, secret, password, key, or token patterns, as well as paths inside .ssh, .aws, .gnupg, .kube, and .docker directories. The preflight check rejects these before any modification.

What happens if compression validation fails?▼

The validator compares headings, code blocks, URLs, paths, and bullet counts between original and compressed versions. If errors are found, the agent fixes and re-validates up to two times; if still failing, the original file is restored from the backup.