/ CLAUDE.md
CLAUDE.md
1 # Workflow Orchestration 2 3 ## 1. Plan Mode Default 4 - Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions) 5 - If something goes sideways, STOP and re-plan immediately - don't keep pushing 6 - Use plan mode for verification steps, not just building 7 - Write detailed specs upfront to reduce ambiguity 8 9 ## 2. Subagent Strategy 10 - Use subagents liberally to keep main context window clean 11 - Offload research, exploration, and parallel analysis to subagents 12 - For complex problems, throw more compute at it via subagents 13 - One task per subagent for focused execution 14 15 ## 3. Self-Improvement Loop 16 - After ANY correction from the user: update `tasks/lessons.md` with the pattern 17 - Write rules for yourself that prevent the same mistake 18 - Ruthlessly iterate on these lessons until mistake rate drops 19 - Review lessons at session start for relevant project 20 21 ## 4. Verification Before Done 22 - Never mark a task complete without proving it works 23 - Diff behavior between main and your changes when relevant 24 - Ask yourself: "Would a staff engineer approve this?" 25 - Run tests, check logs, demonstrate correctness 26 27 ## 5. Demand Elegance (Balanced) 28 - For non-trivial changes: pause and ask "is there a more elegant way?" 29 - If a fix feels hacky: "Knowing everything I know now, implement the elegant solution" 30 - Skip this for simple, obvious fixes - don't over-engineer 31 - Challenge your own work before presenting it 32 33 ## 6. Autonomous Bug Fixing 34 - When given a bug report: just fix it. Don't ask for hand-holding 35 - Point at logs, errors, failing tests - then resolve them 36 - Zero context switching required from the user 37 - Go fix failing CI tests without being told how 38 39 # Task Management 40 41 1. **Plan First**: Write plan to `tasks/todo.md` with checkable items 42 2. **Verify Plans**: Check in before starting implementation 43 3. **Track Progress**: Mark items complete as you go 44 4. **Explain Changes**: High-level summary at each step 45 5. **Document Results**: Add review section to `tasks/todo.md` 46 6. **Capture Lessons**: Update `tasks/lessons.md` after corrections 47 48 # Core Principles 49 50 - **Simplicity First**: Make every change as simple as possible. Impact minimal code. 51 - **No Laziness**: Find root causes. No temporary fixes. Senior developer standards. 52 - **Minimal Impact**: Changes should only touch what's necessary. Avoid introducing bugs.