Cooldown vs Decision Tree Error Recovery

Heuristic Cooldown (confidence: high)

Used by Claude Code and Cline. Tracks error frequency during execution. When errors exceed a threshold, the agent pauses execution, summarizes what went wrong, and asks the user for guidance. Works well for autonomous agents operating in unpredictable environments where error patterns cannot be anticipated.

Deterministic Decision Tree (confidence: high)

Used by Xcode PreviewAction. A rigid if-then-else tree determines behavior at each branch point. No free-form recovery — every possible state has a defined next action. Works well for narrow, predictable tasks where all failure modes can be enumerated at design time.

Comparison (confidence: high)

DimensionHeuristic CooldownDecision Tree
FlexibilityHigh (handles novel errors)Low (covers only known cases)
PredictabilityLow (may miss threshold)High (deterministic)
ImplementationSimple (track + pause)Complex (enumerate all paths)
AutonomyRequires user guidanceFully self-contained
Best forBroad autonomous agentsNarrow single-purpose tools

Research Gap (confidence: high)

Neither approach handles token pressure gracefully. Cooldown heuristics address error frequency but not context-window saturation. Decision trees cannot adapt to conditions not enumerated at design time. A hybrid approach — heuristic cooldown that also monitors token pressure — is an open research opportunity.

Implications (confidence: high)

The choice depends on the scope of operation. Agents operating in unbounded domains need cooldown heuristics. Tools with a single narrow function (explain code, preview action) can use decision trees. Most tools in the corpus implement neither, relying on the LLM’s inherent error recovery — which is inconsistent.

Links: plan-before-implement-gate, monolithic-prompt-limits, prompt-engineering-research-gaps

Sources

  • [raw/prompts/articles/taxonomy-synthesis-2026-07-16.md]