# What Types of Content Does Caveman Remove During Compression?

> Caveman compress strips natural language prose, preserving code, URLs, file paths, and more. Learn what content Caveman removes during compression.

- Repository: [Julius Brussee/caveman](https://github.com/JuliusBrussee/caveman)
- Tags: explanation
- Published: 2026-07-11

---

**Caveman compress strips free-form natural language prose while preserving all structural and technical elements including code blocks, URLs, file paths, headings, and table layouts.**

The `caveman` tool by JuliusBrussee is a specialized compression utility designed to optimize files for LLM context windows. According to the source code in [`skills/caveman-compress/README.md`](https://github.com/JuliusBrussee/caveman/blob/main/skills/caveman-compress/README.md), the compression algorithm specifically targets natural language content for reduction while maintaining the technical integrity of the document.

## Content Preserved During Compression

When processing files, Caveman explicitly **keeps** the following elements intact to ensure technical accuracy remains usable after compression.

### Code Blocks and Technical Snippets

All code representations remain unchanged. This includes:

- Fenced code blocks (delimited by triple backticks)
- Indented code blocks
- Inline code wrapped in single backticks
- Command-line snippets (e.g., `npm install`, `git commit`)

### URLs, Paths, and Technical References

Caveman preserves navigation and reference metadata:

- URLs and markdown links
- File-system paths (e.g., `/src/components/...`)
- Technical terms, library names, and API references
- Dates, version numbers, and other numeric values

### Structural Elements

Document architecture remains untouched to maintain readability:

- Heading text (exact content left unchanged)
- Table structures (only cell content is shortened, layout retained)

## What Gets Compressed

Caveman targets **natural-language content** for reduction. This includes:

- Plain sentences and paragraphs
- Bullet-point explanations
- Explanatory text between code blocks
- Free-form documentation prose

As implemented in [`skills/caveman-compress/SKILL.md`](https://github.com/JuliusBrussee/caveman/blob/main/skills/caveman-compress/SKILL.md) and documented in [`skills/caveman-compress/README.md`](https://github.com/JuliusBrussee/caveman/blob/main/skills/caveman-compress/README.md), these elements are shortened to reduce token count while preserving semantic meaning.

## Compression Example

The following example demonstrates how Caveman processes a markdown file using the CLI. The command to invoke compression is:

```bash

# Run the compression skill on a project memory file

/caveman-compress CLAUDE.md

```

**Before compression:**

```markdown
I strongly prefer TypeScript with strict mode enabled for all new code. 
Please don't use `any` type unless there's genuinely no way around it, 
and if you do, leave a comment explaining the reasoning. 
Proper types catch bugs early.

```ts
// Example code block
export const foo = (arg: any) => { … }

```

Visit https://example.com for more details.

```

**After compression:**

```markdown
Prefer TypeScript strict mode always. No `any` unless unavoidable — comment why if used. Proper types catch bugs early.

```ts
// Example code block
export const foo = (arg: any) => { … }

```

Visit https://example.com for more details.

```

Notice that the prose sentences have been shortened, but the code block, backticks, URL, and technical terms remain untouched.

## Key Implementation Files

The compression logic is implemented across several files in the JuliusBrussee/caveman repository:

- [`skills/caveman-compress/README.md`](https://github.com/JuliusBrussee/caveman/blob/main/skills/caveman-compress/README.md) – Documents what content is preserved and which file types are processed
- [`skills/caveman-compress/SKILL.md`](https://github.com/JuliusBrussee/caveman/blob/main/skills/caveman-compress/SKILL.md) – Contains the actual skill definition that drives the compression logic
- [`bin/lib/settings.js`](https://github.com/JuliusBrussee/caveman/blob/main/bin/lib/settings.js) – Handles configuration for the Caveman toolkit including compression settings
- [`commands/caveman-compress.md`](https://github.com/JuliusBrussee/caveman/blob/main/commands/caveman-compress.md) – CLI documentation for invoking the compress command

## Summary

- **Caveman removes** free-form natural language, including paragraphs, sentences, and explanatory bullet points
- **Caveman preserves** code blocks, inline code, URLs, file paths, command snippets, technical terms, headings, and table structures
- The compression targets token reduction for LLM processing while maintaining technical document integrity
- Configuration and documentation reside in [`skills/caveman-compress/README.md`](https://github.com/JuliusBrussee/caveman/blob/main/skills/caveman-compress/README.md) and [`skills/caveman-compress/SKILL.md`](https://github.com/JuliusBrussee/caveman/blob/main/skills/caveman-compress/SKILL.md)

## Frequently Asked Questions

### Does Caveman remove code comments during compression?

No. Code comments within code blocks remain intact because Caveman preserves the entire content of fenced and indented code blocks. Only natural language prose outside of code formatting is compressed.

### What file types does Caveman compress?

According to [`skills/caveman-compress/README.md`](https://github.com/JuliusBrussee/caveman/blob/main/skills/caveman-compress/README.md), the specific file types subject to compression are described in the "what files work" section. The tool processes standard documentation formats compatible with the compression skill defined in [`skills/caveman-compress/SKILL.md`](https://github.com/JuliusBrussee/caveman/blob/main/skills/caveman-compress/SKILL.md).

### How does Caveman handle markdown tables?

Caveman preserves table structures and layouts exactly, including the pipe characters and alignment. Only the text content within individual cells is shortened during compression, ensuring the tabular data remains readable and properly formatted.

### Is Caveman compression reversible?

No, the compression is not reversible. The process involves shortening and condensing natural language text, which removes original wording and sentence structure. Always work on copies of files when using `/caveman-compress` to preserve your original documentation.