| name | caveman-prompt-compression |
| description | Token-optimized prompt compression techniques for reducing LLM instruction size while preserving or improving quality |
| version | 1.0.0 |
| category | ai-technique |
| author | Claude MPM Team |
| license | MIT |
| progressive_disclosure | {"entry_point":{"summary":"Compress system prompts 50-77% while maintaining quality through table-first formatting, deduplication, and filler removal","when_to_use":"System prompts >5KB, agent definitions >20KB, high-cost sessions, token budget optimization","quick_start":"1. Merge duplicate sections 2. Convert prose to tables 3. Remove filler 4. Strip verbose examples 5. Remove frontmatter bloat"}} |
| context_limit | 700 |
| tags | ["prompt-optimization","token-reduction","compression","cost-optimization","system-prompt","agent-design"] |
| requires_tools | [] |
Caveman Prompt Compression
Systematic technique for reducing system prompt token count 50-77% while maintaining or improving output quality. Named for its "use fewer words" philosophy -- strip every token that does not change model behavior.
Pilot Results (claude-mpm PR #425)
| Metric | Compressed | Original | Delta |
|---|
| Cost | $4.42 | $6.74 | -34% |
| Tokens | 5.5M | 10.4M | -47% |
| Duration | 7.5 min | 9.5 min | -27% |
| Quality | 4.40/5 | 3.75/5 | +17% |
Why quality improved: Less noise lets the model focus on actual rules. Tables parse unambiguously. Single source of truth eliminates contradictory duplicates.
The 5 Pillars
1. Merge Duplicate Sections
Find repeated rules, prohibitions, or guidelines scattered across sections. Consolidate into a single canonical reference.
Pattern: Search the entire prompt for overlapping instructions. Create one authoritative table, reference it by ID elsewhere.
| Before | After |
|---|
| 4 separate prohibition lists across sections | 1 table (P1-P12) with ID references |
| Same rule stated 3 different ways | Single canonical statement |
| Conflicting versions of same guideline | One source of truth |
Process:
- Extract every rule/instruction into a flat list
- Group by semantic similarity
- Merge duplicates, keeping the most precise version
- Assign IDs (R1, R2... or P1, P2...) for cross-referencing
- Replace original locations with ID references
2. Convert Prose to Tables
Highest-impact technique. Replace verbose paragraph-form rules with compact markdown tables.
Before (prose, ~65 tokens):
When the user mentions a ticket ID like PROJ-123, or an issue URL,
or says 'ticket' or 'issue', you should delegate to the ticketing_agent.
The ticketing_agent has access to mcp-ticketer tools and can look up,
create, and update tickets on behalf of the user.
After (table row, ~20 tokens):