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 AlirezaSoltaniJazi/Skillnir --skill promptcompressorgit clone --depth 1 https://github.com/AlirezaSoltaniJazi/SkillnirWrote 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/alirezasoltanijazi/skillnir/promptcompressor)<a href="https://agentmods.dev/skills/alirezasoltanijazi/skillnir/promptcompressor"><img src="https://agentmods.dev/badge/skills/alirezasoltanijazi/skillnir/promptcompressor/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/alirezasoltanijazi/skillnir/promptcompressor"><img src="https://agentmods.dev/badge/skills/alirezasoltanijazi/skillnir/promptcompressor.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.00073 | $0.01951 |
| Opus 5.5 | $0.00029 | $0.00780 |
| Sonnet 5.5 | $0.00015 | $0.00390 |
| Haiku 4.5 | $0.00007 | $0.00195 |
Grade A, and why
promptCompressor 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 1mo 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 — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Before You Start
Read LEARNED.md first. It contains corrections and conventions from previous sessions.
Announce skill usage. Always say "Using: promptCompressor skill" at the very start of your response.
When to Use
- Working on
src/skillnir/compressor.py— the core compression module - Debugging or improving compression rules (word sets, phrase replacements)
- Analyzing compression ratios on pipeline prompts
- Adding new protected zone patterns
- Working on the compression toggle in settings
- Reviewing whether compressed prompts preserve meaning
Do NOT Use
- General Python backend — use backendEngineer
- UI/settings page layout — use frontendEngineer
- CI/CD and pre-commit — use devopsEngineer
Architecture
src/skillnir/compressor.py # Core module — compress_prompt()
src/skillnir/backends.py # Integration — build_subprocess_command() + maybe_compress_prompt()
src/skillnir/ui/pages/settings.py # Toggle — compress_prompts config
tests/test_compressor.py # 51 unit tests
Data flow: Pipeline prompt string -> build_subprocess_command() (subprocess backends) or maybe_compress_prompt() (Claude SDK backend) -> compress_prompt() -> compressed string -> CLI subprocess / SDK call
Integration points: Two call sites in backends.py, both gated on compress_prompts=True in AppConfig: build_subprocess_command() compresses inline for subprocess backends; maybe_compress_prompt() is the shared wrapper for the async-SDK path and is called from generator.py, docs_compressor.py, docs_optimizer.py, rule_generator.py, wiki_generator.py, and skill_generator.py.
Compression Algorithm
Applied in order:
- Detect protected zones — code blocks, inline code, JSON templates, URLs, file paths, markdown headers, YAML frontmatter, table rows, indented code blocks
- Replace verbose phrases — "in order to" -> "to", "due to the fact that" -> "because" (~30 pairs)
- Remove stop words — articles, auxiliaries, intensifiers, fillers (outside protected zones)
- Collapse whitespace — normalize spaces and blank lines
What ships with it
5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 1mo ago Changed · +16 lines d3c070f5d6b6
- 2mo ago First seen · 144 lines · 73 tokens per session scan A 1afa669e9164
promptCompressor is a skill published in the GitHub repository AlirezaSoltaniJazi/Skillnir (9 stars, last pushed 12d ago), licensed MIT. It adds 73 tokens to every session and 1,951 once invoked, about $0.0003 per session on Opus 5.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.
promptCompressor compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| promptCompressorAlirezaSoltaniJazi/Skillnir | Skill | 9 | 12d ago | MIT | A | 73 | Claude Code |
| llm-app-patternsdavila7/claude-code-templates | Skill | 33k | yesterday | MIT | A | 54 | Claude Code, Codex |
| prompt-engineerJeffallan/claude-skills | Skill | 12k | 7d ago | MIT | A | 93 | Claude Code |
| prompt-optimizationlangwatch/langwatch | Skill | 5.0k | yesterday | Apache-2.0 | A | 105 | Claude Code, Codex |
| omh-model-optimizationrlaope/oh-my-hermes | Skill | 5.2k | yesterday | MIT | A | 84 | Claude Code, Codex |
| ideogram4digitalsamba/claude-code-video-toolkit | Skill | 2.5k | yesterday | MIT | A | 99 | Claude Code |
| prompt-library-for-startupsaws/agent-toolkit-for-aws | Skill | 3.4k | yesterday | Apache-2.0 | A | 228 | Claude Code |