Claude went down: how to keep coding agents running when one LLM provider fails
I’m Denis Shokhirev, an Agentic AI Systems Architect based in Freiburg im Breisgau, Germany, and at DennisCraft AI Studio I ship production AI systems for DACH B2B clients using Claude, Supabase, n8n, Doppler, and self-hosted Postgres. The ugly moment is never the conference demo; it’s a weekday production window when a coding agent already owns a branch, reviewers are waiting on a patch, and one model provider goes dark. If your coding agents depend on a single LLM vendor, provider failure tur
I’m Denis Shokhirev, an Agentic AI Systems Architect based in Freiburg im Breisgau, Germany, and at DennisCraft AI Studio I ship production AI systems for DACH B2B clients using Claude, Supabase, n8n, Doppler, and self-hosted Postgres. The ugly moment is never the conference demo; it’s a weekday production window when a coding agent already owns a branch, reviewers are waiting on a patch, and one model provider goes dark.
If your coding agents depend on a single LLM vendor, provider failure turns into blocked pull requests, engineers waiting for retries, and rushed manual workarounds. In regulated European environments, you also can’t just “send it to any model.” You need traceability, bounded access, deterministic verification, and a failure mode that degrades service instead of stopping delivery. Here is the architecture pattern I use to keep coding agents moving when Claude is unavailable for some period of time.
1. Treat model availability like any other external dependency
A lot of teams still design coding agents as if the model were an internal primitive: prompt in, patch out. That assumption breaks the first time you hit provider downtime, a hard rate limit, or a long tail of timeouts. A model API should be treated more like any other external service dependency: variable latency, partial failures, changing limits, and occasional degraded behavior.
This is not speculation. Anthropic’s API documentation explicitly covers errors, rate limits, and operational handling patterns: https://docs.anthropic.com/ . OpenAI’s Cookbook also documents retry and backoff strategies for production API clients: https://cookbook.openai.com/ . If the vendors themselves document failure handling as part of normal usage, then a single-provider coding workflow is not lean engineering; it is an outage waiting to happen.
What should fail over, and what should never change
I separate the pipeline into layers and only allow provider switching in some of them:
| Layer | Can fail over? | Must remain stable |
|---|---|---|
| Task planning | Yes | Task identity and audit trail |
| Patch generation | Yes | Repo scope and write constraints |
| Code verification | No | semgrep, bandit, gitleaks, policy gates |
| Patch application | Partly | Human approval for risky changes |
That distinction matters. A provider fallback is useful only if the control plane stays deterministic. If switching models changes your safety checks, your logging, or your approval path, you did not add resilience. You added another uncontrolled path into production.
2. Route by capability and task type, not by favorite vendor
The most useful abstraction I’ve found is not “Claude primary, something else backup.” It is a task profile. A small TypeScript refactor, a SQL migration, and a documentation diff should not share the same route, timeout, or escalation path. They have different context needs, different error costs, and different review requirements.
from dataclasses import dataclass
@dataclass
class ModelRoute:
provider: str
model: str
max_retries: int
timeout_sec: int
ROUTES = {
"small_refactor": [
ModelRoute("anthropic", "claude-3-5-sonnet-latest", 2, 45),
ModelRoute("openai", "gpt-4o", 2, 45),
],
"sql_migration": [
ModelRoute("anthropic", "claude-3-5-sonnet-latest", 1, 60),
ModelRoute("openai", "gpt-4.1", 1, 60),
],
}In practice, my orchestrator in n8n or in a custom worker does not think in brand terms. It evaluates task type, current provider health, and the allowed latency budget. If the primary route fails, the task moves to the next route with the same contract and the same controls. No Slack panic, no engineer manually copy-pasting prompts across tabs.
Normalize the prompt contract before you normalize the vendors
This is the part teams often skip. If the same task is expressed differently for each provider, failover becomes unstable. I use one normalized task contract: objective, repo boundaries, output format, disallowed actions, and file scope. The provider-specific adapter only handles transport and schema translation. That reduces the chance that a backup model explains what it would change instead of producing an actionable patch.
3. Failover without deterministic verification creates quiet production risk
The dangerous version of “resilience” is getting any output from a backup model and calling that success. Availability problems quickly become quality problems. A fallback model can generate code that compiles, but still introduces secret exposure, poor input handling, or unsafe SQL patterns.
That is why I keep verification provider-agnostic and machine-enforced. semgrep checks rule-based patterns, bandit covers Python security issues, gitleaks looks for secrets, and repo path policies prevent the agent from editing outside its assigned area. OWASP’s Top 10 for LLM Applications, updated in 2025, calls out issues such as insecure output handling and excessive agency: https://genai.owasp.org/ . For coding agents, the practical reading is simple: model output cannot be trusted just because it came from the same workflow.
#!/usr/bin/env bash
set -euo pipefail
changed_files=$(git diff --name-only origin/main...HEAD)
echo "$changed_files" | grep -E '^(src|db|migrations)/' >/dev/null
semgrep --config p/owasp-top-ten .
bandit -r src -q
gitleaks detect --no-banner --source .
python -m pytest -q
echo "verification passed"If any check fails, I do not let the task bounce forever between providers. I mark it needs_human_review and persist all artifacts: the task contract, raw model response, diff, and scan results. That is useful for incident analysis, but also for compliance and internal change review.
4. Keep agent state outside the model context window
A surprising number of coding agents fail over poorly because their state lives inside conversation history. Once the original provider times out, the next model inherits an incomplete or distorted version of the task and starts repeating steps, reopening files, or producing conflicting edits.
In production, I keep the state machine in Postgres or Supabase on top of Postgres: task_id, repo, branch, stage, selected_provider, attempt_count, artifact references, and approval state. The model only gets the slice of context required for the next step. That means switching providers does not mean losing memory. It only means assigning the next action to a different executor.
version: "1"
task:
id: "AGENT-4821"
type: "small_refactor"
repo: "billing-service"
branch: "agent/AGENT-4821"
policy:
writable_paths: ["src/", "tests/"]
require_human_approval: true
runtime:
provider_order: ["anthropic", "openai"]
max_total_attempts: 3This design also helps with GDPR-sensitive environments because you know exactly which data is leaving your controlled infrastructure and which artifacts remain in your own systems. For DACH B2B work, that is often the difference between an acceptable architecture review and a blocked rollout.
5. What actually holds up in production
The pattern that keeps working is boring in the best sense. First, all coding tasks go through a shared queue instead of directly from an IDE to one model API. Second, routing is driven by task type and provider health. Third, every generated patch hits the same deterministic verification layer. Fourth, risky changes require human approval. Fifth, every state transition and artifact is logged in Postgres.
None of that makes failure disappear. What it does is make failure manageable. Instead of “Claude is down, so engineering stops,” you get “some tasks fail over, some enter review, throughput drops, but delivery continues.” In a real business, that difference matters more than any benchmark screenshot.
FAQ
Do I always need two LLM providers?
If coding agents affect delivery or customer-facing systems, yes, you should at least have a tested secondary path. It does not need to carry equal traffic, but it must be real and exercised before an incident.
Are retries enough?
No. Retries help with short transient failures, but they do not solve prolonged outages, severe rate limiting, or quality drift. You need routing, persisted state, and deterministic gates.
What matters more: a backup model or static analysis?
Static analysis and policy gates matter more. A backup model without verification only helps you ship bad code faster.
Where should agent state live?
In a transactional system like Postgres. It gives you replayability, audit history, and a clean interface to orchestrators such as n8n.
Should the fallback provider receive the full original context?
Only the minimum needed for the next step. Sending all raw context to every backup path increases both data exposure and behavioral variability.
Which stage in your LLM pipeline causes the most pain during provider outages right now: routing, state persistence, static analysis, or human review? I’d genuinely like to compare that with what I’m seeing in production systems.
I run a free 30-min stack audit for DACH founders building AI in regulated markets. DM me on LinkedIn or write to @ger_dennis_ai.
I build agents like this for businesses in Germany and the EU.
Tell me in two sentences what eats your team’s time – reply within 24 hours.
Turn your process into an AI system
Production quality. DACH B2B focus.