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 h4vzz/awesome-ai-agent-skills --skill context-compressiongit clone --depth 1 https://github.com/h4vzz/awesome-ai-agent-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/h4vzz/awesome-ai-agent-skills/context-compression)<a href="https://agentmods.dev/skills/h4vzz/awesome-ai-agent-skills/context-compression"><img src="https://agentmods.dev/badge/skills/h4vzz/awesome-ai-agent-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/h4vzz/awesome-ai-agent-skills/context-compression"><img src="https://agentmods.dev/badge/skills/h4vzz/awesome-ai-agent-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.00025 | $0.01793 |
| Opus 5 | $0.00013 | $0.00897 |
| Sonnet 5 | $0.00005 | $0.00359 |
| Haiku 4.5 | $0.00003 | $0.00179 |
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 11d 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.
This is a copy
91% identical to context-compression — 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Compression
Context compression is the process of reducing the size of textual context provided to a language model while retaining the information most essential to the task. As conversations grow longer and retrieved documents grow larger, compression becomes critical for staying within token limits and keeping inference costs manageable without sacrificing answer quality.
Workflow
-
Measure the Token Budget: Determine the model's total context window (e.g., 4K, 32K, 128K tokens) and subtract the tokens reserved for the system prompt, instructions, and the model's generation output. The remainder is your available context budget. If the raw context already fits, compression may be unnecessary.
-
Score Information Density: Analyze each paragraph, sentence, or chunk of the raw context and assign an information-density score based on how many task-relevant facts it contains per token. Sentences that are purely stylistic, redundant, or off-topic receive low scores. This can be done heuristically (keyword overlap with the query) or via a lightweight classifier.
-
Select a Compression Strategy: Choose the most appropriate technique based on the compression ratio needed and the nature of the content:
- Extractive summarization — select the most important sentences verbatim.
- Abstractive summarization — rewrite content in fewer words while preserving meaning.
- Key-point extraction — pull out only named entities, facts, and figures.
- Selective pruning — remove low-density sentences, boilerplate, and repeated information.
-
Apply Compression: Execute the chosen strategy. For aggressive compression (>80% reduction), combine techniques — for example, first prune boilerplate, then abstractively summarize the remainder. For moderate compression (40–60%), extractive selection is often sufficient and avoids introducing paraphrasing errors.
-
Validate Information Retention: Compare the compressed output against the original to ensure no critical facts were lost. A quick validation pass can check that key entities, numbers, and conclusions from the original are still present in the compressed version.
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.
- 11d ago First seen · 86 lines · 25 tokens per session scan A d544bc346857
context-compression is a skill published in the GitHub repository h4vzz/awesome-ai-agent-skills (34 stars, last pushed yesterday), licensed MIT. It adds 25 tokens to every session and 1,793 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to context-compression, differing in 2 lines, and is treated as a copy.
Other skills, from other repositories
skills-backup-keeper
Keeps dated backups of the Cowork skills folder and an append-only session journal so work survives crashes, context compaction and skills wipes. Use when the user asks to back up skills, checkpoint or journal the current session, resume where a previous conversation left off, or restore skills from a backup. Also use…
hive.note-taking
Maintain a free-form scratchpad of decisions, extracted values, and open questions so context pruning doesn't lose anything you still need.
notes
Skill "notes" from Pinvou/pinvou-agent, covering ima notes, operations, write rules, examples and response handling.
exploiting-format-string-vulnerabilities
Methodology for exploiting format string bugs where attacker-controlled data reaches the format argument of printf-family functions, enabling stack/memory disclosure (info leaks for ASLR/PIE/canary defeat) and arbitrary write primitives (%n) to hijack control flow via GOT/.finiarray overwrites.
context-engineering
A project documentation framework that records a project's goals, requirements, roadmap, and current state in separate files. It also keeps those documents within set size limits for an AI coding agent.
taiyi-compress
A workflow tool for shrinking large coding-agent conversations and work files into shorter context notes. It can also coordinate separate agents for parallel development and create handoff notes for continuing work in a new session.