implement
Quick command to invoke code-implementer to execute implementation with self-correction (up to 3 intelligent retries).
Analyze and optimize context configuration. Reviews CLAUDE.md, knowledge-core.md, and active context for optimization opportunities. Helps prevent context rot (39% improvement, 84% token reduction).
How it fires
How this command gets triggered: by you, by Claude, or both.
/contextContext preview
What this command does when you run it.
Analyze and optimize context configuration. Reviews CLAUDE.md, knowledge-core.md, and active context for optimization opportunities. Helps prevent context rot (39% improvement, 84% token reduction).
name: context description: Analyze and optimize context configuration. Reviews CLAUDE.md, knowledge-core.md, and active context for optimization opportunities. Helps prevent context rot (39% improvement, 84% token reduction).
Analyze and optimize your Claude Code context configuration using Anthropic's context engineering principles.
/context # Analyze mode (default) /context analyze # Same as default /context optimize # Actively optimize context /context reset # Reset to templates
When you run `/context` or `/context analyze`:
1. **Read context files**
2. **Analyze token count and relevance**
3. **Identify optimization opportunities**
4. **Report findings**
When you run `/context optimize`:
1. **Run analysis** (as above)
2. **Archive stale information**
3. **Prune redundant context**
4. **Update CLAUDE.md**
5. **Report token savings**
When you run `/context reset`:
1. **Confirmation prompt**
2. **Restore templates** (if confirmed)
3. **Fresh start**
📊 Context Analysis ## Current Configuration **Memory Hierarchy**: - Enterprise: Not configured - Project: ./CLAUDE.md (450 tokens) - User: ~/.claude/CLAUDE.md (120 tokens) - Imports: 3 files (280 tokens) **Total Context**: 850 tokens **Files Analyzed**: - ✓ CLAUDE.md (450 tokens) - ✓ knowledge-core.md (320 tokens) - ✓ @.claude/templates/agents-overview.md (100 tokens) - ✓ @.claude/templates/skills-overview.md (90 tokens) - ✓ @.claude/templates/workflows-overview.md (90 tokens) ## Optimization Opportunities ### 1. Stale Information in CLAUDE.md (120 tokens) **Section: "Python Development"** - Last used: 30 days ago - Recommendation: Archive to knowledge-core.md (project now uses TypeScript) **Section: "Deployment to Heroku"** - Last used: 45 days ago - Recommendation: Archive to knowledge-core.md (now using Vercel) **Section: "Generic Testing Tips"** - Recommendation: Remove (not project-specific, Claude already knows this) ### 2. Redundant Content (80 tokens) **Duplicated Information**: - Git workflow mentioned in 3 places (CLAUDE.md, workflows-overview.md, agents-overview.md) - Recommendation: Keep in workflows-overview.md only, import elsewhere ### 3. Missing Modularity **Large CLAUDE.md File**: - Could be split into modular imports - Recommendation: Create `project-architecture.md`, import with `@.claude/project-architecture.md` ## Potential Savings **If all recommendations applied**: - Stale information removal: 120 tokens (14% reduction) - Redundancy elimination: 80 tokens (9% reduction) - Modularity improvements: 50 tokens (6% reduction) **Total Potential Savings**: 250 tokens (29% reduction) **Expected Impact**: - Performance improvement: ~39% (Anthropic research on context engineering) - Token reduction in long sessions: ~84% - Clearer, more focused context - Better agent decision-making ## Recommendations **Immediate Actions**: 1. Run `/context optimize` to automatically apply changes 2. Review knowledge-core.md after optimization to ensure important information preserved **Periodic Maintenance**: - Run `/context analyze` every 50 messages or major task switch - Archive completed work to knowledge-core.md - Keep CLAUDE.md project-specific (remove generic advice) **Best Practices**: - Be specific: "Use 2-space indentation for JS" not "Format code properly" - Use structure: Organize with clear markdown headings - Review periodically: Update as project evolves
✅ Context Optimized ## Changes Applied ### 1. Archived Stale Information **To knowledge-core.md**: - "Python Development" section → `## Historical: Python Setup (archived 2025-10-18)` - "Deployment to Heroku" section → `## Historical: Heroku Deployment (archived 2025-10-18)` ### 2. Removed Redundant Content **From CLAUDE.md**: - Removed generic testing tips (not project-specific) - Removed duplicate git workflow (kept import from workflows-overview.md) ### 3. Improved Modularity **Created**: - `.claude/project-architecture.md` (150 tokens) - Moved architecture details from CLAUDE.md - Imported in CLAUDE.md with `@.claude/project-architecture.md` **Updated CLAUDE.md**: - Replaced verbose architecture section with import - Clearer structure with focused sections ## Results **Before Optimization**: - Total tokens: 850 - Stale information: 120 tokens (14%) - Redundant content: 80 tokens (9%) **After Optimization**: - Total t
A small, portable workflow for an agent you already use: research what is uncertain, plan proportionally, act, verify, and retain useful knowledge. Start with INSTALL.md.
Quick command to invoke code-implementer to execute implementation with self-correction (up to 3 intelligent retries).
Quick command to invoke implementation-planner to create surgical, reversible implementation plans with rollback procedures.
Quick command to invoke docs-researcher for rapid documentation research. Fetches version-accurate, authoritative sources and…