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 agentmods add skills/rjmurillo/ai-agents/context-optimizernpx skills add rjmurillo/ai-agents --skill context-optimizergit clone --depth 1 https://github.com/rjmurillo/ai-agentsWrote 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/rjmurillo/ai-agents/context-optimizer)<a href="https://agentmods.dev/skills/rjmurillo/ai-agents/context-optimizer"><img src="https://agentmods.dev/badge/skills/rjmurillo/ai-agents/context-optimizer.svg" alt="Measured on agentmods" 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.00103 | $0.04353 |
| Opus 5 | $0.00051 | $0.02176 |
| Sonnet 5 | $0.00021 | $0.00871 |
| Haiku 4.5 | $0.00010 | $0.00435 |
Grade A, and why
context-optimizer 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 2d 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 — 426 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Optimizer
Tooling suite for optimizing Claude Code context placement. Passive context (AGENTS.md, @imports) achieves 100% pass rates versus 53-79% for skills by eliminating decision points.
Triggers
analyze skill placement- classify and validate content as Skill vs Passive Contextcompress markdown- reduce token count for context filesoptimize context- lower API costs and improve agent performanceextract and index- split markdown into detail files with compact indexaudit always-on rules- eval-gated procedure for whether a rule earns its slot, and the doctrine behind it, in rule-audit-procedure.md and model-context-doctrine.md. Also the entry point when a new model ships. Requires a full rjmurillo/ai-agents checkout: the procedure runs this repo's eval harness and rule generator, neither of which ships in a plugin install. The doctrine and the instrument write-ups are readable anywhere; only the commands need the checkout
Process
- Analyze: Run
analyze_skill_placement.pyto classify content - Compress: Run
compress_markdown_content.pyto reduce token counts - Validate: Run
test_skill_passive_compliance.pyto check compliance - Verify: Confirm output JSON contains expected classification and metrics
Verification
- Classification matches expected type (Skill/PassiveContext/Hybrid)
- Compression achieves target reduction (40-80% depending on level)
- Compliance validator returns exit code 0
- Output JSON is valid and contains all required fields
Scripts
| Script | Purpose | Exit Codes |
|---|---|---|
analyze_skill_placement.py |
Classify content as Skill/PassiveContext/Hybrid | 0=success, 1=error |
compress_markdown_content.py |
Compress markdown with token reduction metrics | 0=success, 1=error, 2=config, 3=external |
test_skill_passive_compliance.py |
Validate compliance with decision framework | 0=pass, 1=violations |
extract_and_index.py |
Extract sections into detail files with pipe-delimited index | 0=success, 1=error, 2=config, 3=external |
path_validation.py |
Shared CWE-22 repo-root-anchored path validation | N/A (library module) |
What ships with it
13 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.
- references/claude-code-productivity-patterns.md 2.9 KB
- references/model-context-doctrine.md 19 KB
- references/rule-audit-evidence.md 7.9 KB
- references/rule-audit-instrument.md 20 KB
- references/rule-audit-measurement-discipline.md 8.5 KB
- references/rule-audit-parser-forensics.md 30 KB
- references/rule-audit-procedure.md 36 KB
- references/vibe-engineering.md 3.0 KB
- scripts/analyze_skill_placement.py 12 KB runs code
- scripts/compress_markdown_content.py 17 KB runs code
- scripts/extract_and_index.py 11 KB runs code
- scripts/path_validation.py 3.4 KB runs code
- scripts/test_skill_passive_compliance.py 28 KB runs code
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.
- 2d ago First seen · 426 lines · 103 tokens per session scan A eb0f4a89d3af
context-optimizer is a skill published in the GitHub repository rjmurillo/ai-agents (45 stars, last pushed today), licensed MIT. It adds 103 tokens to every session and 4,353 once invoked, about $0.0005 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-09-03.
Other skills, from other repositories
ci-cd-pipeline-builder
../../../engineering/skills/ci-cd-pipeline-builder/SKILL.md.
capture
../../../productivity/capture/skills/capture/SKILL.md.
chief-of-staff
../../../c-level-advisor/skills/chief-of-staff/SKILL.md.
notion
Use the Notion API to create, read, update Notion pages, data sources (databases), and blocks.
tmux-layout
Use this skill when the operator wants a prepared tmux visualization layout for the session's side-channels (STATE.md tail, CI-watch, events.jsonl tail). Renders a 4-pane default layout or debug layout. Read-only side-channel observability — the coordinator chat stays in the operator's original terminal. Trigger…
create-task
Create and verify recurring or one-shot reminders, scripts, agent jobs, reports, and interactive skill launches.