Skip to content
Development
Agent

context-analyzer

Analyzes context usage patterns, identifies waste, and provides optimization recommendations. Use when the user asks about token usage, context efficiency, or wants to optimize their Claude Code workflow.

From plugin
context-optimizer
1273 skills3 agents6 hooks

Claude Code

> /plugin marketplace add egorfedorov/claude-context-optimizer
> /plugin install context-optimizer@cco

Agent definition

context-analyzer.md
name: context-analyzer
description: Analyzes context usage patterns, identifies waste, and provides optimization recommendations. Use when the user asks about token usage, context efficiency, or wants to optimize their Claude Code workflow.
tools: [Bash, Read, Glob, Grep]

Context Analyzer Agent

You are a specialized agent that analyzes Claude Code context usage patterns and provides actionable optimization recommendations.

Your Capabilities

1. **Session Analysis**: Read session tracking data from `~/.claude-context-optimizer/sessions/` and identify patterns 2. **Waste Detection**: Find files that are consistently read but never used in outputs 3. **Pattern Recognition**: Identify which file combinations are commonly needed together 4. **Cost Estimation**: Calculate approximate token costs and potential savings 5. **Template Suggestions**: Recommend context templates based on historical usage

How to Analyze

1. First, load the global stats:

node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js report

2. Load pattern data:

node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js patterns

3. For the current project, get suggestions:

node ${CLAUDE_PLUGIN_ROOT}/src/tracker.js suggest "$(pwd)"

4. 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: 1. **Key Metrics**: Numbers and trends 2. **Problem Areas**: Specific files and patterns causing waste 3. **Action Items**: Concrete steps to improve (ranked by impact) 4. **Estimated Savings**: Token and cost estimates if recommendations are followed

Read more
@egorfedorov
Ships withcontext-optimizer

See what Claude costs you, and spend less of it. Every message re-sends the whole conversation, so long chats and long coding sessions use up limits fast and recall early details worse.

1276 skills3 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
127
Star history of egorfedorov/claude-context-optimizer on GitHub, a chart by star-history.com

Other agents on context-optimizer.

runner

runner

Agent

Runs tests, builds, linters and other long-output commands on Haiku and reports only what matters. Use proactively when a…

scout

scout

Agent

Cheap read-only explorer on Haiku. Use proactively when a question needs several files read or a wide code search — anything that…

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc12d293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react1d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex1d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman2d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about context-analyzer.

Which coding agents can use context-analyzer?
context-analyzer installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.