:: MODULE_02
Quick reference tables
Situation-action lookup for common Claude Code scenarios. Find your situation, apply the recommended action.
Debugging & logging
| Situation | Recommended action |
|---|---|
| Claude does something wrong |
/log_error → fork → interview → capture verbatim prompt → rewind
|
| Claude does something right |
/log_success → capture prompt → extract template → consider promoting to CLAUDE.md
|
| Same error keeps recurring | Review error logs → identify pattern → create hook or add to CLAUDE.md |
| Claude hallucinating APIs |
Use Context7 MCP for current documentation → category: hallucination
|
Workflow execution
| Situation | Recommended action |
|---|---|
| Need reliable workflow execution |
Use /command with deterministic wrapping, not natural language
|
| Repetitive multi-step task |
Create command in .claude/commands/ → document purpose + workflow
|
| Different phases need different models | Implement model routing in command definition |
| Tasks can run in parallel | Design command to spawn independent subagents → maintain isolated contexts |
Permission & context management
| Situation | Recommended action |
|---|---|
| Claude requesting excessive permissions |
Implement hooks + --dangerously-skip-permissions for safe autonomy
|
| Need to block dangerous operations |
Create pre-execution hooks in .claude/hooks/ → pattern match blocked commands
|
| Context getting bloated |
Use /compact at natural boundaries → consider subagent delegation
|
| CLAUDE.md exceeds 50 lines | Audit weekly → move rarely-used instructions to skills → keep only essentials |
| Switching between projects |
/clear with repo-specific config → clean context transition
|
Recovery & restoration
| Situation | Recommended action |
|---|---|
| Bugs polluted the context | Double-escape → restore conversation only (preserves correct code) |
| Need full rollback | Double-escape → full restore (reverts conversation + code) |
| Claude going in circles | Fork conversation → rephrase approach → try different angle |
| Ending session cleanly |
/handoff {NOTES} → explicit priority notes for next session
|
Multi-agent patterns
| Situation | Recommended action |
|---|---|
| Complex reasoning task | Force Opus subagent → add "Always launch opus subagents" to config |
| Subagent producing poor results | Check model selection → likely model mismatch → upgrade to Opus |
| Errors compounding across agents | Implement deterministic verification between handoffs → don't trust claims |
| Subagent handling too many tasks | Split into multiple focused agents → one objective per agent |
Input optimization
| Situation | Recommended action |
|---|---|
| Typing prompts feels slow | Use reprompter tool → voice input → automated structure → keybind activation |
| Unsure what to ask for | Model interview approach → "Interview me about what I want" → let model surface requirements |
| Prompt too vague | Add XML structure → role assignment → specific examples → clear constraints |
| Same prompt type needed repeatedly | Extract template → store in success logs → promote to skill if valuable |