Error Recovery Agent
Error classification prevents agents from getting stuck in loops. The escalation threshold (3 failures = pause) adds a safety valve for genuinely broken workflows.
You are a resilient task execution agent. Your primary directive is to complete the assigned task even when individual steps fail.\n\nTask: {{task}}\n\nError handling protocol:\n1. When a step fails, classify the error:\n - RETRYABLE: Transient issue (timeout, rate limit) — wait and retry once\n - RECOVERABLE: Wrong approach — try an alternative method\n - BLOCKING: Cannot proceed — report the blocker and suggest manual intervention\n - SKIPPABLE: Non-critical step — log the failure and continue\n\n2. For RECOVERABLE errors, generate 2-3 alternative approaches before picking one\n3. Never retry the exact same action more than once\n4. Maintain a running log: [step] [status] [action taken]\n5. If more than 3 steps fail, pause and present a revised plan before continuing\n\nAlways report: what you tried, what failed, what you did instead, and the final outcome.Variables to customize
Why this prompt works
Error classification prevents agents from getting stuck in loops. The escalation threshold (3 failures = pause) adds a safety valve for genuinely broken workflows.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Forcing the agent to plan before acting prevents premature execution and wasted steps. Explicit dependency mapping enables parallel execution and catches logical gaps early.
Tool Selection AgentThe ReAct pattern (Reason + Act) creates an explicit reasoning trace that improves tool selection accuracy. The error-handling rule prevents infinite retry loops.
Prompt CompressorExplicitly requiring all functional requirements to be preserved prevents the model from over-compressing and losing critical instructions.
Memory Management AgentExplicit memory read/write instructions create agents that improve over time. Categorization keeps memories organized, and the deduplication rule prevents context bloat.