Skip to content
Back to skills

Compress

ASecurity

Compress text semantically with iterative validation, anchor checksums, and verified information preservation.

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 6, 2026
testingrustgo

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add clawic/skills --skill compress --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Compress?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Compress
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/clawic-compress/badge)](https://www.skillsdirectory.com/skills/clawic-compress)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Compress
slug: compress
version: 1.0.0
description: Compress text semantically with iterative validation, anchor checksums, and verified information preservation.
homepage: https://clawic.com/skills/compress
metadata:
  clawdbot:
    emoji: 🗜️
    displayName: Compress
---

## ⚠️ Important Limitations

**This is SEMANTIC compression, not bit-perfect lossless.**
- L1-L2: Verified reconstruction, production-ready
- L3-L4: Experimental, may lose subtle information
- **Never use for:** Medical dosages, legal text, financial figures, safety-critical data

---

## The Validation Loop

```
1. Compress original O → compressed C
2. Extract anchors from O (entities, numbers, dates)
3. Reconstruct C → R (without seeing O)
4. Verify: anchors match + semantic diff
5. If mismatch → refine C with missing info
6. Repeat until validated (max 3 iterations)
```

**Convergence = verified. No convergence after 3 rounds = level too aggressive.**

---

## Quick Reference

| Task | Load |
|------|------|
| Compression levels (L1-L4) | `levels.md` |
| Validation algorithm details | `validation.md` |
| Format-specific strategies | `formats.md` |
| Token budgeting and metrics | `metrics.md` |

---

## Compression Levels

| Level | Ratio | Reliability | Use Case |
|-------|-------|-------------|----------|
| L1 | ~0.8x | ✅ High | Production, human-readable |
| L2 | ~0.5x | ✅ Good | System prompts, repeated use |
| L3 | ~0.3x | ⚠️ Moderate | Experimental, review output |
| L4 | ~0.15x | ⚠️ Low | Research only, expect losses |

---

## Anchor Checksum System

Before compression, extract critical facts:
```
[ANCHORS: 3 people, $42,000, 2024-03-15, "Project Alpha"]
```

Reconstruction MUST reproduce these exactly. If anchors mismatch → compression failed.

---

## Core Rules

1. **Always validate** — Never trust compression without reconstruction test
2. **Use anchors** — Extract numbers, names, dates before compressing
3. **Cap at L2 for production** — L3-L4 are experimental
4. **Report confidence** — Include iteration count and anchor match rate
5. **Independent verification** — Consider different model for reconstruction

---

## Cost-Benefit Reality

Each compression costs 3-4 LLM calls. Break-even calculation:
```
break_even_retrievals = compression_tokens / saved_tokens_per_use
```

**Only cost-effective if:** You'll retrieve the compressed content 6-8+ times.

For one-time use → just use the original text.

---

## Before Compressing

- [ ] Content type is NOT safety-critical
- [ ] Target level chosen (L1-L2 recommended)
- [ ] Anchors identified (numbers, names, dates)
- [ ] ROI makes sense (multiple retrievals expected)

Files in this skill

  • SKILL.md2.6 KB
  • _meta.json168 B
  • formats.md3 KB
  • levels.md2 KB
  • metrics.md3.1 KB
  • validation.md2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…