From 8b4ac8ac51587e51574de210001684b1b4190b83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivett=20=C3=96rd=C3=B6g?= Date: Wed, 29 Jul 2026 16:50:51 +0200 Subject: [PATCH] Add Escalate When Stuck pattern Co-Authored-By: Claude Opus 5 --- documents/patterns/escalate-when-stuck.md | 28 +++++++++++++++++++++++ documents/relationships.mmd | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 documents/patterns/escalate-when-stuck.md diff --git a/documents/patterns/escalate-when-stuck.md b/documents/patterns/escalate-when-stuck.md new file mode 100644 index 0000000..b19d7ce --- /dev/null +++ b/documents/patterns/escalate-when-stuck.md @@ -0,0 +1,28 @@ +--- +authors: [ivett_ordog] +--- + +# Escalate When Stuck + +## Problem +Most of any task is routine work a cheap model handles fine. Occasionally it hits a wall: loops on a failing test, patches symptoms instead of causes, contradicts itself. Running the strongest model on the whole task to cover those rare moments is wasteful — but letting the cheap model thrash wastes even more (see Sunk Cost). + +## Pattern +Default to the cheap model, and define escalation triggers: + +- Two failed attempts at the same problem +- Reverting or contradicting its own changes +- The agent declaring uncertainty + +On a trigger, consult the stronger model as an advisor: hand it the goal, the attempts so far, and the errors. The advisor diagnoses and plans; the cheap model resumes with the advice. + +Escalation can be automatic (instruct the agent to ask for help when stuck) or manual (you notice the thrashing and bring in the stronger model yourself). + +Same economics as a senior engineer on call: you don't have them type everything — you make them easy to ask. + +The complementary pattern is Smart Plan, Cheap Execution: there the smart model leads from the start; here it's only consulted when needed. + +## Example +Sonnet implements a database migration. After the second failed attempt on the same failing test, it spawns a subagent on the strongest model with the diff, the error, and "what am I missing?" The advisor spots the wrong assumption — an ORM lifecycle detail — and Sonnet applies the correction and finishes. + +In Claude Code, subagents can run a different model than the main loop, so this works in both directions: a cheap main loop escalating to a smart subagent, or cheap workers under a smart orchestrator. diff --git a/documents/relationships.mmd b/documents/relationships.mmd index 34c46ce..e480562 100644 --- a/documents/relationships.mmd +++ b/documents/relationships.mmd @@ -68,6 +68,8 @@ graph LR patterns/context-management -->|uses| patterns/extract-knowledge patterns/context-management -->|uses| patterns/knowledge-checkpoint patterns/smart-plan-cheap-execution -->|uses| patterns/knowledge-checkpoint + patterns/escalate-when-stuck -->|solves| anti-patterns/sunk-cost + patterns/smart-plan-cheap-execution <-->|similar| patterns/escalate-when-stuck patterns/context-management -->|uses| patterns/focused-agent patterns/context-management -->|uses| patterns/semantic-zoom patterns/context-management -->|uses| patterns/noise-cancellation