Tool error handling — CCA-F Exam Prep

×
L2.070
REAL STORYA developer's phone at 3:14 AM showing a PagerDuty alert: 'CRITICAL: API spend $200 in 2 minutes. Agent loop detected.' Behind it, a laptop screen showing 47 identical failed API calls in a log viewer. Each line: '500 Internal Server Error.' Red everywhere.

A payment API went down for 90 seconds. Claude retried 47 times. Cost: $200.

A fintech startup had a Claude agent that processed refunds. Tuesday at 3am, the payment gateway returned a 500 error. The agent's tool call failed. So Claude did what it was designed to do -- try to accomplish the task.

It called the tool again. 500. Again. 500. 47 times in 2 minutes. Each call included the full conversation context, so tokens compounded with every retry.