Omni Compression
Configure RTK (command output), Caveman (prose), and stacked compression modes. Manage language packs, custom rules, and test prompt compression reducing tokens by 60–90%.
Get the complete skill folder, including its scripts and reference files.
When to use this skill
Use Omni Compression when an AI agent needs a reusable SKILL.md workflow for this job: Configure RTK (command output), Caveman (prose), and stacked compression modes. Manage language packs, custom rules, and test prompt compression reducing tokens by 60–90%.
When not to use it
Skip Omni Compression when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.
How to install
Where will you use it?
mkdir -p ~/.claude/skills/omni-compression # Save SKILL.md to ~/.claude/skills/omni-compression/SKILL.md
- Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/omni-compression/SKILL.md. For a shared project, commit the folder at .claude/skills/omni-compression/ instead.
- Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
- For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.
Full install guide for Claude, Cursor, and Codex →
Try a starter prompt
After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.
Use the Omni Compression skill for this task: Use Omni Compression when this documented workflow matches the task. Confirm any required inputs or files before making changes.
What supports this recommendation?
71/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.
- Documentation
- 77/100
- Practical detail
- 68/100
- Source evidence
- 63/100
- Source signals
- 72/100
Model compatibility evidence
- claudeuntested
No model-specific signal or recorded compatibility test was found.
- chatgptuntested
No model-specific signal or recorded compatibility test was found.
- geminiuntested
No model-specific signal or recorded compatibility test was found.
- copilotuntested
No model-specific signal or recorded compatibility test was found.
- llamauntested
No model-specific signal or recorded compatibility test was found.
- perplexityuntested
No model-specific signal or recorded compatibility test was found.
- mistraluntested
No model-specific signal or recorded compatibility test was found.
- grokuntested
No model-specific signal or recorded compatibility test was found.
Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.
What this skill does
<!-- generated by src/lib/agentSkills/generator.ts; manual edits will be overwritten -->
## Overview
Configure RTK (command output), Caveman (prose), and stacked compression modes. Manage language packs, custom rules, and test prompt compression reducing tokens by 60–90%.
## Authentication
All requests require a valid Bearer token or session cookie. Obtain a token via `POST /api/auth/login` or configure `REQUIRE_API_KEY=false` for local development.
## Endpoints
### GET /api/settings/compression
Get global compression settings
```bash curl http://localhost:20128/api/settings/compression \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ```
### PUT /api/settings/compression
Update global compression settings
Partial update: only the sent top-level keys change. `engines` merges by engine id — an entry overwrites only the fields it sends, engines left out are kept as-is, and until an engines row is stored the merge base is the map derived from the legacy per-engine settings.
```bash curl -X PUT http://localhost:20128/api/settings/compression \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ```
### GET /api/settings/compression/mcp-accessibility
Get the MCP tool-output accessibility (trimming) config
```bash curl http://localhost:20128/api/settings/compression/mcp-accessibility \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ```
### PUT /api/settings/compression/mcp-accessibility
Update the MCP tool-output accessibility (trimming) config
Partial-merge update. Numeric floors (e.g. a maxTextChars below the truncation-tail reserve) are folded back to the safe defaults server-side, so the response reflects the effective config.
```bash curl -X PUT http://localhost:20128/api/settings/compression/mcp-accessibility \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ```
### POST /api/compression/preview
Preview compression for a message payload
```bash curl -X POST http://localhost:20128/api/compression/preview \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ```
### GET /api/compression/language-packs
List Caveman compression language packs
```bash curl http://localhost:20128/api/compression/language-packs \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ```
### GET /api/compression/rules
List Caveman compression rule metadata
```bash curl http://localhost:20128/api/compression/rules \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ```
### POST /api/compression/compare
POST compression › compare
```bash curl -X POST http://localhost:20128/api/compression/compare \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ```
### POST /api/compression/compare/verify
POST compression › compare › verify
```bash curl -X POST http://localhost:20128/api/compression/compare/verify \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ```
### GET /api/compression/engines
GET compression › engines
```bash curl http://localhost:20128/api/compression/engines \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ```
### POST /api/compression/retrieve
POST compression › retrieve
```bash curl -X POST http://localhost:20128/api/compression/retrieve \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" \ -H "Content-Type: application/json" \ -d '{}' ```
### GET /api/settings/compression/rules
GET settings › compression › rules
```bash curl http://localhost:20128/api/settings/compression/rules \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ```
### GET /api/settings/compression/run-telemetry
GET settings › compression › run telemetry
```bash curl http://localhost:20128/api/settings/compression/run-telemetry \ -H "Authorization: Bearer $OMNIROUTE_TOKEN" ```
## Payloads
See the full OpenAPI specification at `GET /api/openapi/spec` or `docs/openapi.yaml` for detailed request/response schemas.
<!-- skill:custom-start --> <!-- Migrated from skills/omniroute-compression/SKILL.md (preserved curated content) -->
# OmniRoute — Compression
Requires `OMNIROUTE_URL` and `OMNIROUTE_KEY`. See [entry-point SKILL](https://raw.githubusercontent.com/cheaper-inference/OmniRoute/main/skills/omni-auth/SKILL.md) for setup.
## Overview
OmniRoute compresses token payloads before forwarding to providers. No code changes required — set it once, it applies to all requests transparently.
| Engine | Best for | Typical savings | | ------------------------- | ------------------------------------ | --------------- | | RTK | Terminal / build / test / git output | 60–90% | | Caveman | Human prose, chat history | 46% input | | Stacked (`rtk → caveman`) | Mixed coding sessions | 78–95% | | MCP accessibility filter | Browser/accessibility tool results | 60–80% |
## Get current settings
```bash curl $OMNIROUTE_URL/api/settings/compression \ -H "Authorization: Bearer $OMNIROUTE_KEY" ```
## Enable RTK (best for coding agents)
```bash curl -X PUT $OMNIROUTE_URL/api/settings/compression \ -H "Authorization: Bearer $OMNIROUTE_KEY" \ -H "Content-Type: application/json" \ -d '{ "mode": "rtk", "enabled": true }' ```
## Enable stacked mode (maximum savings)
```bash curl -X PUT $OMNIROUTE_URL/api/settings/compression \ -H "Authorization: Bearer $OMNIROUTE_KEY" \ -H "Content-Type: application/json" \ -d '{ "mode": "stacked", "enabled": true, "stackedPipeline": ["rtk", "caveman"] }' ```
## Enable Caveman (prose / chat)
```bash curl -X PUT $OMNIROUTE_URL/api/settings/compression \ -H "Authorization: Bearer $OMNIROUTE_KEY" \ -H "Content-Type: application/json" \ -d '{ "mode": "standard", "enabled": true }' ```
Caveman intensities: `lite` (safe), `standard` (balanced), `aggressive` (long sessions), `ultra` (context recovery).
## Preview compression before enabling
```bash curl -X POST $OMNIROUTE_URL/api/compression/preview \ -H "Authorization: Bearer $OMNIROUTE_KEY" \ -H "Content-Type: application/json" \ -d '{ "mode": "rtk", "text": "$ npm test\n> jest\n\nPASS src/a.test.ts (2.1s)\nPASS src/b.test.ts (1.8s)\n..." }' ```
Response includes `compressed`, `original_length`, `compressed_length`, `savings_pct`.
## MCP accessibility-tree filter (browser agent use)
When OmniRoute is used with browser/Playwright MCP tools, it automatically compresses verbose accessibility-tree tool results. Enabled by default; configure thresholds:
```bash curl -X PUT $OMNIROUTE_URL/api/settings/compression \ -H "Authorization: Bearer $OMNIROUTE_KEY" \ -H "Content-Type: application/json" \ -d '{ "mcpAccessibility": { "enabled": true, "collapseThreshold": 30, "maxTextChars": 50000 } }' ```
`collapseThreshold`: collapse sibling lines when ≥ N repeats (default 30). `maxTextChars`: hard truncate after N chars with navigation hint (default 50000).
## Language packs (Caveman)
Caveman supports language-aware rules for pt-BR, es, de, fr, ja:
```bash curl -X PUT $OMNIROUTE_URL/api/settings/compression \ -H "Authorization: Bearer $OMNIROUTE_KEY" \ -H "Content-Type: application/json" \ -d '{ "mode": "standard", "cavemanConfig": { "language": "pt-BR", "autoDetectLanguage": true } }' ```
## Via MCP
``` omniroute_compression_status → current settings + savings analytics omniroute_compression_configure → update mode/threshold/language omniroute_set_compression_engine → switch engine at runtime ```
## Disable compression
```bash curl -X PUT $OMNIROUTE_URL/api/settings/compression \ -H "Authorization: Bearer $OMNIROUTE_KEY" \ -d '{ "enabled": false }' ```
## Errors
- `400 invalid mode` → use `off`, `lite`, `standard`, `aggressive`, `ultra`, `rtk`, or `stacked` - `400 invalid stackedPipeline` → array must contain valid engine ids (`rtk`, `caveman`) <!-- skill:custom-end -->
Intended uses
- Use Omni Compression when this documented workflow matches the task.
Implementation notes
- Review the source instructions and adapt inputs before running the workflow.
Try it, then tell us how it went
A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.