Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add irfad7/claude-power-skills --skill context-compressiongit clone --depth 1 https://github.com/irfad7/claude-power-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/irfad7/claude-power-skills/context-compression)<a href="https://agentmods.dev/skills/irfad7/claude-power-skills/context-compression"><img src="https://agentmods.dev/badge/skills/irfad7/claude-power-skills/context-compression/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/irfad7/claude-power-skills/context-compression"><img src="https://agentmods.dev/badge/skills/irfad7/claude-power-skills/context-compression.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00070 | $0.00983 |
| Opus 5 | $0.00035 | $0.00491 |
| Sonnet 5 | $0.00014 | $0.00197 |
| Haiku 4.5 | $0.00007 | $0.00098 |
Grade A, and why
context-compression scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Compression — 3-Layer Pipeline
You are a context compression engine. When conversations grow long, you systematically reduce context size while preserving all decision-critical information.
When To Trigger
- Conversation exceeds ~50 turns
- User mentions context is getting long or responses are degrading
- You notice you're losing track of earlier decisions
- User explicitly asks for compression
- Before a complex multi-step task that needs headroom
The Three Layers
Layer 1: MicroCompact (Light Touch)
Goal: Remove noise without losing any information.
Do this:
- Strip redundant confirmations ("Yes, that looks good", "Sure, I'll do that")
- Collapse repeated tool outputs into summaries ("Read 12 files — all TypeScript, avg 200 lines")
- Remove failed attempts that were superseded by successful ones
- Collapse verbose error messages into one-line summaries
- Remove conversational filler ("Let me think about this...", "Great question...")
Compression ratio: ~30-40% reduction Information loss: Zero
Layer 2: AutoCompact (Structural)
Goal: Restructure retained information for density.
Do this:
- Convert sequential discoveries into a structured summary:
## What We Know - The API uses Express with 14 endpoints - Auth is JWT-based, tokens expire in 24h - Database is Postgres via Drizzle ORM - Tests use Vitest, 73% coverage ## Decisions Made - Using server components by default - API routes return { data } or { error } - Commit style: conventional commits ## Current Task - Building the user dashboard - Blocked on: auth middleware refactor - Next step: implement session management - Group related file reads into summaries
- Merge multiple rounds of the same type of work into outcomes
- Replace code snippets with references ("see src/auth.ts:45-67")
Compression ratio: ~60-70% reduction Information loss: Minimal — details available via file re-reads
Layer 3: Full Compact (Aggressive)
Goal: Maximum compression. Only essential state survives.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 125 lines · 70 tokens per session scan A bebacd2c8918
context-compression is a skill published in the GitHub repository irfad7/claude-power-skills (4 stars, last pushed 1mo ago), licensed MIT. It adds 70 tokens to every session and 983 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
report
Writes the session final report to a file, then prints only the path and a one-line summary. Fires when the prompt contains "Report per memstack:report", and also when the prompt begins with a standing trigger configured through MEMSTACKREPORTONTASKPROMPTS or MEMSTACKREPORTTRIGGERS. Dormant otherwise.
compress
Use when the user says 'tokenstack', 'compression', 'token savings', 'proxy status', or asks about context window usage.
token-optimization
Use when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity. Covers TokenStack, the built-in compression proxy that shrinks Claude Code tool output before it reaches the Anthropic API. Do NOT use for…
state
Use when the user says 'update state', 'project state', 'where was I', or at session start to load current context.
grimoire
Use when the user says 'update context', 'update claude', 'save library', or after significant project changes.
project-butler
A project-memory workflow that keeps a code project’s rules, current structure, documents, logs, tasks, and handoff notes organized.