When a question describes one of these failure modes, the right answer almost always points to the matching pattern.
| If the question describes… | …the answer is |
| Critical sequence violated (e.g., refund before customer verified) | Programmatic prerequisite (hook) |
| Tool selection unreliable for ambiguous requests | Expand tool descriptions first; then 4–6 few-shot examples with reasoning |
| Bad escalation calibration | Explicit criteria + few-shot — not sentiment, not self-reported confidence |
| Multi-concern requests with redundant fetching | Decompose into distinct concerns, investigate in parallel with shared context, synthesize |
| Output gaps vary case-by-case (different things missing each time) | Self-critique step (evaluator-optimizer) — not few-shot |
| Prose has been interpreted differently each iteration | 2–3 concrete input/output examples |
| Critical facts lost to summarization | Case facts block outside the summarized history |
| Self-review misses subtle issues | Independent second instance (no shared reasoning context) |
| CI hangs on interactive input | -p / --print flag |
| Need structured output for CI tooling | --output-format json + --json-schema |
| Team-wide slash command needed | .claude/commands/ in project repo |
| Personal customization without affecting teammates | ~/.claude/skills/ with a different name |
| Conventions span multiple directories | .claude/rules/ with YAML paths: globs |
| Multi-agent topic coverage gap | Coordinator decomposition — not subagent execution |
| Subagent failure | Structured error context: failure type + attempted query + partial results + alternatives |
| Multi-file PR producing inconsistent depth | Per-file passes + separate cross-file integration pass |
| Round-trip overhead from coordinator delegation | Scoped cross-role tool for the common case (e.g., verify_fact) |
| Generic tool being misused outside its specialty | Replace with constrained alternative (fetch_url → load_document) |
| "Lost in the middle" on aggregated input | Key findings at top + explicit section headers |