CLAUDE LABJP
TOOLSWAP — Mid-conversation tool changes are in beta: add or remove tools between turns while keeping the prompt cache intact, on Fable 5, Mythos 5, Opus 4.8, and Opus 5FALLBACK — The fallbacks parameter gained a default mode that applies Anthropic's recommended fallback models per refusal category, with server-side fallback also in betaADDDIR — A new DirectoryAdded hook fires right after /add-dir or the SDK register_repo_root request registers a working directory mid-sessionMCPERR — Entries skipped by --mcp-config validation now surface as mcp_server_errors in the headless stream-json init event, and terminal runs print a startup warningFANOUT — Concurrently running subagents are now capped at 20 by default, and hitting --max-budget-usd denies new spawns while halting the background agents already runningOPUS5 — Claude Opus 5 ships with a 1M-token context window, 128K max output, thinking on by default, and the same pricing as Opus 4.8TOOLSWAP — Mid-conversation tool changes are in beta: add or remove tools between turns while keeping the prompt cache intact, on Fable 5, Mythos 5, Opus 4.8, and Opus 5FALLBACK — The fallbacks parameter gained a default mode that applies Anthropic's recommended fallback models per refusal category, with server-side fallback also in betaADDDIR — A new DirectoryAdded hook fires right after /add-dir or the SDK register_repo_root request registers a working directory mid-sessionMCPERR — Entries skipped by --mcp-config validation now surface as mcp_server_errors in the headless stream-json init event, and terminal runs print a startup warningFANOUT — Concurrently running subagents are now capped at 20 by default, and hitting --max-budget-usd denies new spawns while halting the background agents already runningOPUS5 — Claude Opus 5 ships with a 1M-token context window, 128K max output, thinking on by default, and the same pricing as Opus 4.8
Articles/Claude Code
Claude Code/2026-06-12Intermediate

A Three-Tier fallbackModel Setup for Claude Code — Keeping Unattended Runs Alive Through Overload Mornings

How I run Claude Code with a three-tier fallbackModel chain so overnight batches survive overload errors: logging which model actually ran, measuring quality drift on fallback days, and pairing it with deny rules.

claude-code129fallbackmodelautomation98scheduled-jobs2reliability17

Premium Article

One morning this June, my Crashlytics triage report arrived empty. As an indie developer I rely on a headless Claude Code run (claude -p) at 6 a.m. to classify the previous day's crash logs for my apps. That day, the log showed three overloaded_error responses (HTTP 529) in a row — the retry limit had been exhausted and the job had simply given up. It was a blunt reminder of how fragile a retry-only design really is. Unaddressed crashes feed directly into lower AdMob revenue and worse store reviews, which makes this triage the one batch in my operation I least want to lose.

When I tallied the previous 30 days of logs, the morning batch had come up empty on 4 of them — roughly a 13% loss rate. When you are sitting at the keyboard, "wait a bit and try again" solves this. Unattended, no amount of waiting wins against an overload that lasts longer than your retry window. So I moved to a three-tier setup using the fallbackModel setting that recently landed in Claude Code, switching models instead of merely retrying one. This article is a record of that design and what I learned actually operating it.

Where a retry loop alone stopped working

My pre-migration script was the usual exponential backoff:

#!/bin/bash
# Before: retries against the same model only. A long overload kills every attempt.
PROMPT_FILE="$HOME/ops/crashlytics_triage_prompt.md"
for i in 1 2 3; do
  if claude -p "$(cat "$PROMPT_FILE")" > /tmp/triage_result.md 2>/tmp/triage_err.log; then
    exit 0
  fi
  sleep $(( i * 60 ))  # 1 min -> 2 min -> 3 min
done
echo "triage failed after 3 attempts" >&2
exit 1

The flaw is that every retry queues up against the same congestion on the same model. A 529 is server-side overload; some mornings it clears in minutes, other mornings it lingers for half an hour or more. Looking back at the four failed days, all three retries had been spent within six minutes of the first failure — well inside the congestion window, every single time.

What changes with a fallbackModel array

Claude Code's fallbackModel accepts an array of up to three models in settings.json. When the primary cannot respond — overload, model unavailable — execution switches to the next model in line and keeps going. If retrying is rejoining the same queue, falling back is walking over to a different counter that happens to be open. For unattended runs, that difference is decisive.

// After: .claude/settings.json — switch models under overload instead of re-queueing
{
  "model": "claude-fable-5",
  "fallbackModel": ["claude-opus-4-8", "claude-sonnet-4-6"]
}

That is the entire change — the calling script stays untouched. In the 30 days since migrating, the fallback chain fired on 3 mornings, and the number of empty-report days dropped to zero. You cannot prevent 529s, but you can prevent them from costing you results.

One caveat from real operation: fallbackModel responds to overload and availability errors, not to timeouts. With an always-on adaptive-thinking model as the primary, even simple-looking tasks can think longer than expected, which makes wall-clock time harder to predict. I widened my batch-level timeout to 1.5x its previous value. Fallback and timeout are separate insurance policies and need to be designed separately.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A working Fable 5 → Opus 4.8 → Sonnet 4.6 fallbackModel chain and the criteria behind each slot
A bash implementation that extracts the executing model from the stream-json init message and logs it to CSV
A measured 90% classification-agreement rate on a Sonnet 4.6 fallback day, and the two operational rules it produced
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Claude Code2026-07-14
One Day My Push Had an Extra Destination — Guarding Against /commit-push-pr Pushing to Remotes Beyond origin
The July 14 update made /commit-push-pr push to configured push remotes in addition to origin. Convenient, but if you keep a mirror or backup as a second remote, unintended pushes quietly multiply. Here is how to inventory which remotes you can push to, block anything off the allowlist with a pre-push hook, and keep unattended runs safe — with working code.
Claude Code2026-07-03
Five Minutes of Silence, and Something Retries on Your Behalf — Rethinking Retry Ownership After the Streaming Idle Watchdog Became a Default
Claude Code's streaming idle watchdog is now on by default, quietly adding another retrying layer to your stack. This article inventories the four layers (SDK, wrapper, watchdog, scheduler), computes worst-case attempt amplification, and shows how to collapse retry ownership into a single layer.
Claude Code2026-06-14
Running Claude Code Hooks as a Quality Gate Without Breaking Your Pipeline
An implementation note on running Claude Code Hooks as a safety valve for automation: when to block with exit code 2 versus JSON output, how to keep formatters from looping or over-blocking, and how to log every hook firing so misfires are traceable.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →