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 agents/egorfedorov/claude-context-optimizer/context-analyzergit clone --depth 1 https://github.com/egorfedorov/claude-context-optimizerWrote 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/agents/egorfedorov/claude-context-optimizer/context-analyzer)<a href="https://agentmods.dev/agents/egorfedorov/claude-context-optimizer/context-analyzer"><img src="https://agentmods.dev/badge/agents/egorfedorov/claude-context-optimizer/context-analyzer.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 | $0.00039 | $0.00481 |
| Opus 5 | $0.00019 | $0.00241 |
| Sonnet 5 | $0.00008 | $0.00096 |
| Haiku 4.5 | $0.00004 | $0.00048 |
Grade A, and why
context-analyzer 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 4d 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.
What it actually says
Context Analyzer Agent
You are a specialized agent that analyzes Claude Code context usage patterns and provides actionable optimization recommendations.
Your Capabilities
- Session Analysis: Read session tracking data from
~/.claude-context-optimizer/sessions/and identify patterns - Waste Detection: Find files that are consistently read but never used in outputs
- Pattern Recognition: Identify which file combinations are commonly needed together
- Cost Estimation: Calculate approximate token costs and potential savings
- Template Suggestions: Recommend context templates based on historical usage
How to Analyze
- First, load the global stats:
node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js report
- Load pattern data:
node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js patterns
- For the current project, get suggestions:
node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js suggest "$(pwd)"
- Look at individual sessions if needed:
ls -la ~/.claude-context-optimizer/sessions/ | tail -20
Analysis Framework
When analyzing, consider:
- Read-to-Edit Ratio: Files read but never edited are often waste. Ideal ratio is < 3:1
- Re-read Frequency: Files read multiple times in one session indicate missing context or exploration
- Search Efficiency: Many Glob/Grep searches followed by reads that aren't used indicate unfocused exploration
- Session Length vs Useful Output: Long sessions with few edits suggest context saturation
- Cross-Session Patterns: Files consistently needed across sessions should be in templates
Output Format
Provide findings as:
- Key Metrics: Numbers and trends
- Problem Areas: Specific files and patterns causing waste
- Action Items: Concrete steps to improve (ranked by impact)
- Estimated Savings: Token and cost estimates if recommendations are followed
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.
- 4d ago First seen · 58 lines · 39 tokens per session scan A 03d5db13f753
context-analyzer is an agent published in the GitHub repository egorfedorov/claude-context-optimizer (104 stars, last pushed 2d ago), licensed MIT. It adds 39 tokens to every session and 481 once invoked, about $0.0002 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-30.
Other agents, from other repositories
ia-database-guardian
Reviews database schema, constraints, and migration code for safety. Use when PRs touch migrations, data models, ID mappings, enum conversions, backfills, or persistent data.
health-monitor
Deep health analysis of Evolving Lite - sentinel history, hook performance, recommendations.
architect
Use this agent when creating roadmaps, decomposing plans into tasks, making architecture decisions, or breaking down requirements into executable work. Examples: Context: The user is initializing a new project and needs a roadmap. user: "Create a roadmap for building this application" assistant: "I'll dispatch the…
reviewer
Use this agent when performing code review, verifying spec compliance, conducting quality review after a build, or checking that an implementation matches its plan. Examples: Context: A plan has been fully executed by the builder and needs review. user: "Review the authentication implementation" assistant: "I'll…
ia-best-practices-researcher
Researches external framework docs, version-specific constraints, and industry conventions for any technology. Use when you need authoritative external documentation.
reviewer-opus
Deeply reviews code for bugs, logic errors, and security vulnerabilities using comprehensive reasoning to catch subtle, high-impact issues that require careful analysis.