From claude-commands
Runs built-in /context command to fetch real token metrics, analyzes usage patterns for inefficiencies, and provides tailored optimization recommendations.
How this command is triggered — by the user, by Claude, or both
Slash command
/claude-commands:contextecommands/The summary Claude sees in its command listing — used to decide when to auto-load this command
## ⚡ EXECUTION INSTRUCTIONS FOR CLAUDE **When this command is invoked, YOU (Claude) must execute these steps immediately:** **This is NOT documentation - these are COMMANDS to execute right now.** **Use TodoWrite to track progress through multi-phase workflows.** ## 🚨 EXECUTION WORKFLOW ### 🚨 THREE-PHASE EXECUTION WORKFLOW **Action Steps:** 1. Review the reference documentation below and execute the detailed steps. ### 📊 PHASE 1: CONTEXT ESTIMATION (UNIVERSAL COMPOSITION) **Action Steps:** **MANDATORY: Execute Built-in `/context` Command First** 1. **🎯 CALL `/context` COMMAND DIREC...
When this command is invoked, YOU (Claude) must execute these steps immediately: This is NOT documentation - these are COMMANDS to execute right now. Use TodoWrite to track progress through multi-phase workflows.
Action Steps:
Action Steps:
MANDATORY: Execute Built-in /context Command First
/context COMMAND DIRECTLY - Use Claude Code's built-in context analysis/context output (not estimated)/context command output/context command dataAction Steps: Pattern Recognition & Optimization Detection
Action Steps: Tailored Optimization Guidance
Action Steps:
Action Steps:
MANDATORY: Execute /context Command First
/context COMMAND - Get actual context data from Claude Code CLI/context output - Extract real token counts, percentages, breakdowns/context command data/context output/contextAction Steps: Strategic Analysis Based on Phase 1 Results
Action Steps: Actionable Recommendations Delivery
Action Steps:
When /contexte is invoked, MUST EXECUTE ALL THREE PHASES SEQUENTIALLY:
Action Steps:
🎯 EXECUTE BUILT-IN `/context` COMMAND:
1. ALWAYS call `/context` command first to get actual data
2. Extract real token counts from `/context` output
3. Parse actual breakdown (Messages, MCP tools, Memory files, etc.)
4. Use real percentages and usage metrics from `/context`
5. Never estimate or calculate - only use `/context` command data
6. Display actual context status based on `/context` output
Action Steps:
Analyze Phase 1 results for optimization opportunities:
1. Identify specific context-heavy operations from session
2. Suggest context-efficient alternatives for current patterns
3. Recommend Serena MCP opportunities where applicable
4. Provide strategic checkpoint guidance based on usage
5. Offer workflow improvement suggestions tailored to session
Action Steps:
Deliver immediate actionable advice:
1. Specific optimization actions for current session
2. Tool selection hierarchy improvements
3. Session management strategies
4. Future workflow enhancements
5. Next steps for context efficiency
Usage: /contexte or /con
Purpose: First run context estimation, then provide comprehensive analysis with optimization recommendations for Claude Code CLI conversations.
CRITICAL: This command uses Universal Composition - it MUST call the built-in /context command first to get actual data, then provide strategic analysis based on that real data.
❌ NEVER estimate context usage
✅ ALWAYS call /context command first
✅ ALWAYS use actual data from /context output
Execution Method: Three-phase sequential analysis workflow
📊 CONTEXT USAGE ESTIMATION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔹 Estimated Tokens Used: ~15,400 / 500,000 (3.1%)
🔹 Session Complexity: Medium (Score: 34/100)
🔹 Tools Used: 8 operations (4 types)
🔹 Context Status: ✅ HEALTHY
💡 Quick Tip: Consider /checkpoint if planning complex analysis
/contexte # Execute all three phases: Context Estimation → Strategic Analysis → Actionable Recommendations
/con # Alias for /contexte
npx claudepluginhub jleechanorg/claude-commands --plugin claude-commands/contextAnalyzes Claude Code's context configuration for optimization opportunities and applies improvements. Also supports resetting to defaults.
/optimize-contextAnalyzes context window usage against MECW principles, providing token breakdowns, utilization status, and optimization recommendations. Accepts optional path and --detailed flag.
/context-budgetAudits fixed and dynamic context overhead in the current session — scans CLAUDE.md, agents, MCP servers, rules, skills, and history — estimates tokens per component, reports budget usage and headroom, and issues alerts for oversized components or overflow risk.
/cc-budgetCalculates remaining context window after fixed overhead from CLAUDE.md, rules, skills, and MCP schemas. Shows budget summary table and top consumers. Also supports audit, optimize, anchor-plan, simulate.
/claude-pulseDisplays real-time session dashboard with cost analysis, token breakdown, tool performance, context usage, and optimization tips. Also supports configure, stats, setup subcommands.
/context-budgetAnalyzes context window usage across agents, skills, MCP servers, and rules to find optimization opportunities, producing a Context Budget Report with recommendations.