Skip to main content

Claude Code · Week 24 Digest

Claude Code Week 24: fallbackModel, Safe Mode, and /cd for Production Resilience

Claude Code's June 2026 Week 24 update shipped four features that matter most to teams running agents at scale: fallbackModel chains, --safe-mode troubleshooting, /cd workspace switching, and nested sub-agents five levels deep.

3fallback models configurable in sequence before any error surfaces
By Skills-Hub Team · Anthropic ecosystem coverage8 min read
Claude CodeProductionWeek 24

Most Claude Code releases earn a changelog entry and move on. Week 24 (June 8–12, 2026, versions 2.1.166–2.1.176) quietly shipped four features that close the gaps teams were working around in production: rate limits killing overnight runs, mysterious behavior triggered by a rogue hook, the cache-busting tax of switching directories mid-session, and sub-agent pipelines hitting an artificial depth ceiling. Every team running Claude Code at scale should update and configure all four this week.

3

fallback models in chain

tried in order before any error surfaces

5

sub-agent nesting levels

background chains capped at depth 5

0

cache tokens rebuilt on /cd

prompt cache fully preserved mid-session

The four features that shipped

The Week 24 digest covers everything in detail, but the four headline items are:

  • fallbackModel — configure up to three backup models tried in order when the primary model is rate-limited or unavailable.
  • --safe-mode — launch Claude Code with all customizations bypassed: CLAUDE.md files, hooks, plugins, and bundled skills are all disabled.
  • /cd — move the current session to a different working directory without rebuilding the prompt cache.
  • Nested sub-agents — sub-agents can now spawn their own sub-agents, with background chains capped at five levels deep.

These are not cosmetic. Let's walk each one in depth.

fallbackModel: never get rate-limited mid-session

Before Week 24, a rate limit on your primary model meant one thing: the session stopped and you waited. For interactive sessions that's annoying. For overnight agent runs or CI pipelines, it meant a failed job and a morning full of re-runs.

fallbackModel changes this. You configure a ranked list of up to three backup models in .claude/settings.json. When the primary model returns a rate-limit or availability error, Claude Code transparently retries with the next model in the chain—no session restart, no lost context, no user prompt required.

.claude/settings.json
{
  "model": "claude-opus-4-8",
  "fallbackModel": [
    "claude-sonnet-4-6",
    "claude-haiku-4-5-20251001"
  ]
}

The fallback is transparent to skills and sub-agents—a running pipeline won't know the switch happened unless you check the session log. Crucially, the prompt cache is preserved across the switch, so you don't pay re-tokenization costs when the fallback takes over.

For teams on Bedrock or Vertex, combine fallbackModel with the multi-region routing that landed in Week 23—auto mode is now available on third-party providers for Opus 4.7 and 4.8. Together they produce genuinely resilient agent runs that can survive both model-level and region-level outages without intervention.

--safe-mode: the troubleshooter's best friend

Claude Code loads a lot of configuration at startup: project and user-level CLAUDE.md files, hooks, plugins, MCP servers, and bundled skills. When something misbehaves—unexpected behavior, a session loop, a crash at startup—diagnosing whether the issue is Claude itself or a piece of configuration was previously slow and painful.

--safe-mode solves this cleanly. The flag bypasses every customization layer and starts a vanilla session:

Terminal
# launch without any customizations
claude --safe-mode

# combine with a specific model for tighter isolation
claude --safe-mode --model claude-sonnet-4-6

If the problem disappears in safe mode, the culprit is in your configuration stack. Bisect by re-enabling layers one at a time: hooks first (the most common source of infinite loops), then plugins, then CLAUDE.md, then bundled skills.

/cd: workspace switching without cache penalty

Before this update, switching working directories mid-session meant starting a new session (losing context) or shelling out with cd(which works for shell commands but doesn't update Claude's understanding of the working tree). Neither option was good.

/cdsolves this properly. It moves the session root to a new directory, updates Claude's file-system context, and—critically—does not rebuild the prompt cache. Accumulated context stays intact.

Claude Code session
# you're debugging a Fastify route in apps/api
/cd ../web

# now in apps/web — Claude understands the new directory tree
# all prior context preserved, no re-tokenization cost

The canonical use case is monorepo work: debug a backend issue, then switch to the frontend to wire the UI change, without opening a second session and re-establishing context. It works equally well for multi-repo setups where both repos are checked out locally.

Nested sub-agents go five levels deep

The original sub-agent implementation limited nesting to one level: a parent could spawn children, but children could not spawn grandchildren. For most workflows that was sufficient. For deep recursive analysis—drill from repo to module to file to function to test case—it was a hard constraint.

Week 24 removes that constraint. Sub-agents can now spawn their own sub-agents, with background chains capped at five levels deep. The cap is deliberate: unconstrained nesting would make token accounting and failure tracing intractable.

.claude/agents/deep-analyzer.md
---
name: deep-analyzer
description: Recursively analyzes a module, spawning child analyzers per file.
tools:
  - Read
  - Bash
---

Analyze $1 at three levels: module summary → per-file findings →
per-function hotspots. Spawn a file-analyzer sub-agent for each
source file. Each file-analyzer may spawn a function-analyzer for
functions with cyclomatic complexity > 10.

Depth constraint: file-analyzers are level 2, function-analyzers
are level 3. Do not spawn further. Report findings up the chain
with structured JSON summaries.

One practical change the new depth enables: sub-agents can now implement the specialist + critic pattern recursively. A domain specialist at level 2 can spin up its own adversarial reviewer at level 3 without burdening the top-level orchestrator. This is particularly useful for security audits and migration pipelines where you want adversarial review built in at every layer.

The production-grade setup

Combine all four features and you get a setup meaningfully more robust than anything possible before Week 24. Here is the baseline configuration we now ship for any autonomous agent running overnight or in CI:

.claude/settings.json — production baseline
{
  "model": "claude-opus-4-8",
  "fallbackModel": [
    "claude-sonnet-4-6",
    "claude-haiku-4-5-20251001"
  ],
  "autoMode": true,
  "disableBundledSkills": false,
  "hooks": {
    "PreToolCall": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "echo "[tool] $CLAUDE_TOOL_NAME" >&2"
          }
        ]
      }
    ]
  }
}

When something misbehaves with this config, the debugging flow is now clean:

  1. Run claude --safe-modeto confirm the issue isn't from a hook or plugin.
  2. If safe mode is clean, re-enable hooks first and inspect PreToolCall stderr output.
  3. Switch directories with /cd rather than restarting—your debug context stays intact.
  4. If the primary model rate-limits mid-debug, fallbackModel keeps the session alive automatically.
Sub-agents can spawn their own sub-agents (background chains are capped at five levels deep); --safe-mode starts Claude Code with all customizations disabled for troubleshooting; and fallbackModel configures up to three fallback models tried in order.
, Anthropic · Claude Code changelog, Week 24

Update to the latest release to get all four features:

Terminal
npm install -g @anthropic-ai/claude-code@latest
claude --version  # expect 2.1.176 or higher

If you are building multi-level sub-agent pipelines, browse the composition catalog at skills-hub.ai/browse?category=combo for published pipelines that already use the five-level depth correctly, or install the fallback-model-setup skill to audit and configure your project automatically.

Written by

Skills-Hub Team

Anthropic ecosystem coverage

Skills-Hub is the open registry for AI coding skills, 4,400+ SKILL.md files synced daily from Anthropic, Google, Microsoft, and 90+ official sources. Free + MIT.

Continue reading