aggregate-logs
CommandGenerate LEARNINGS.md from skill execution logs over a configurable time window.
Analyze context window usage against MECW principles and recommend reductions
> /plugin marketplace add athola/claude-night-market
name: optimize-context description: Analyze context window usage against MECW principles and recommend reductions usage: /optimize-context [path]
Analyzes context window usage and provides optimization recommendations based on Maximum Effective Context Window (MECW) principles.
# Analyze current session context /optimize-context # Analyze specific skill or directory /optimize-context skills/my-skill # Deep analysis with recommendations /optimize-context --detailed
1. **Context Pressure Assessment**: Evaluates current context utilization 2. **MECW Compliance Check**: Validates against MECW principles 3. **Optimization Recommendations**: Suggests specific improvements 4. **Token Budget Analysis**: Breaks down token usage by component
| Utilization | Status | Action | |-------------|--------|--------| | < 30% | Optimal | No action needed | | 30-50% | Good | Monitor growth | | 50-70% | Warning | Consider optimization | | > 70% | Critical | Immediate action required |
/optimize-context # Output: # Context Optimization Report # ========================== # Current Usage: 45% (Good) # Estimated Tokens: 12,500 # # Recommendations: # - Consider extracting code examples to scripts/ # - 3 skills exceed recommended token budget /optimize-context skills/context-optimization --detailed # Full breakdown with per-module analysis
For reading context in headless/automated Claude Code sessions:
# Get context breakdown with JSON output claude -p "run /context" --verbose --output-format json # Two-call pattern for reliable execution # (Claude doesn't always execute /context on first prompt) SESSION_ID=$(claude -p "ready" --output-format json | jq -r '.session_id') claude --continue "$SESSION_ID" -p "/context" --verbose --output-format json
**Key flags:**
**Example JSON output:**
{
"context": {
"total_tokens": 45000,
"usage_percent": 22.5,
"breakdown": {
"system": 8000,
"conversation": 32000,
"tools": 5000
}
}
}Works with conservation plugin skills:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/growth_analyzer.py "${1:-.}"A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Generate LEARNINGS.md from skill execution logs over a configurable time window.
Analyze skill file complexity metrics and generate modularization recommendations for splitting or progressive loading.
Generate context optimization report for skill directories
Create slash commands with brainstorming and best practices
Scaffold new Claude Code skills with brainstorming, TDD methodology, and proper frontmatter and module structure.
Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.