From scaffolding
Analyzes Claude Code's context configuration for optimization opportunities and applies improvements. Also supports resetting to defaults.
How this command is triggered — by the user, by Claude, or both
Slash command
/scaffolding:contextThe summary Claude sees in its command listing — used to decide when to auto-load this command
# /context Command Analyze and optimize Claude Code's context configuration. ## Usage ## Modes ### analyze (default) Reviews context files and reports optimization opportunities without making changes. **Checks**: - Token count in CLAUDE.md - Stale or outdated information - Redundant/duplicated content - Import chain depth - Knowledge-core.md size **Output**: ### optimize Automatically applies optimizations: - Archives outdated content - Removes duplicates - Consolidates sections - Updates imports **Safety**: Creates backup before changes ### reset Restores template files and cl...
Analyze and optimize Claude Code's context configuration.
/context [analyze|optimize|reset]
Reviews context files and reports optimization opportunities without making changes.
Checks:
Output:
Context Analysis Report
=======================
Total tokens: XXXX
Stale content: X sections
Redundant: X items
Potential savings: XX%
Recommendations:
1. Archive section X to knowledge-core.md
2. Remove duplicate Y
3. Consolidate imports Z
Automatically applies optimizations:
Safety: Creates backup before changes
Restores template files and clears customizations.
Use for: Starting fresh projects
Warning: Requires confirmation
| Trigger | Command |
|---|---|
| Every 50 messages | /context analyze |
| After major refactoring | /context analyze |
| When analysis shows 15%+ savings | /context optimize |
| Task switching | /context optimize |
| New project | /context reset |
Based on Anthropic research:
npx claudepluginhub komluk/scaffolding --plugin scaffolding/contexteRuns built-in /context command to fetch real token metrics, analyzes usage patterns for inefficiencies, and provides tailored optimization recommendations.
/analyze-contextAnalyzes Claude Code chat history for context window usage, identifying top consumers and providing optimization recommendations in a markdown report.
/context-optimizerDiagnoses context window usage issues, audits MCPs and CLAUDE.md, applies fixes like compaction and disabling unused tools, sets auto-compaction, and reports optimized state.
/fold-promptAnalyzes codebase to discover technology stack, coding conventions, and standards, then optimizes CLAUDE.md for token efficiency and progressive context loading.
/optimize-contextAnalyzes context window usage against MECW principles, providing token breakdowns, utilization status, and optimization recommendations. Accepts optional path and --detailed flag.
/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.