This week, a long-form technical article fully dissected Claude Code's error-handling source code. The headline number is 10: the withRetry() function retries up to 10 times, with a 500ms base wait. We've noticed the real dividing line in the Agent race isn't how smart the model is — it's engineering depth.

What This Is

On the surface, Agents (programs that let AI break down tasks, call tools, and work continuously) are "AI doing things by itself," but every step can break: network jitter, truncated model responses, context overflow, users hitting Ctrl+C mid-run, failed tool calls. The developer sorted errors into 6 categories: 3 trigger automatic retry or rerouting, 3 refuse retry and halt immediately to surface to humans. The article lists the exact source location, handling action, and typical error code for each error type.

Industry View

The supportive camp's verdict: this is what "enterprise-grade" Agent should look like — swallowing 99% of transient failures so users never feel a hiccup. Two source-code details worth flagging: consecutive 529s (Anthropic's service-overload error code) auto-switch to a backup model; when model output exceeds length limits, the system first resends the same input at 64000 tokens, and if still truncated, appends a continuation message.

But the dissenting view deserves hearing too: stacking retries to 10 only suppresses intermittent failure rates. Tool-call failures, user-initiated interruptions, and runtime exceptions must halt — you can't let the Agent "pretend nothing happened and keep going." That's a product-philosophy question, not pure engineering. The more realistic worry: the more aggressive the retry strategy, the higher the risk of Token-bill blowouts. Cursor and Devin have both been roasted by users over "a simple task burning through tens of dollars."

Impact on Regular People

For enterprise IT: when evaluating AI coding tools, "how it handles errors" should be written into procurement requirements — it reflects real production environments far better than benchmark scores alone.

For individual workers: when an Agent hits an interruption or failure mid-task, jot down the error code and repro path yourself. Don't let the Agent retry indefinitely — that just drives costs up.

For consumer markets: consumers won't feel these engineering details directly, but the reason enterprises pay a premium for Claude Code is precisely this "silent self-repair" capability.