Claude Code v2.1.166: Improved fallbacks, session hardening, and bug fixes
This patch for Claude Code introduces a `fallbackModel` setting to automatically retry with alternative models on overload or unavailability, enhancing resilience. It also hardens cross-session messaging by stripping user authority from relayed messages and adds improved error handling for API rejections. These changes benefit users relying on Claude Code for coding assistance, particularly in complex or unstable environments, by ensuring more consistent operation and fixing several bugs affecting IDE integration and terminal handling.
- →Configure fallback models for improved availability
- →Glob pattern support for deny rules and improved tool handling
- →Hardened cross-session messaging by removing user authority
- →Disable 'thinking' on models that use it by default
- →Automatic retries on fallback model for API rejections
Features (1) ›
- Configure fallback models for improved availability
A new `fallbackModel` setting allows users to specify up to three fallback models. These models are automatically tried in order when the primary model is overloaded or unavailable, increasing session resilience. The `--fallback-model` option now also applies to interactive sessions.
Enhancements (5) ›
- Glob pattern support for deny rules and improved tool handling
The deny rule tool-name position now supports glob patterns like `"*"` to deny all tools. Allow rules reject non-MCP globs, and unknown tool names in deny rules will now warn at startup, improving configuration flexibility and clarity.
- Hardened cross-session messaging by removing user authority
Messages relayed via `SendMessage` from other Claude sessions no longer carry user authority. Receivers will refuse relayed permission requests, and auto mode will block them, enhancing security and preventing unauthorized actions across sessions.
- Disable 'thinking' on models that use it by default
Settings like `MAX_THINKING_TOKENS=0`, `--thinking disabled`, and the per-model thinking toggle now disable the 'thinking' feature on models that use it by default via the Claude API. This change does not affect third-party providers.
- Automatic retries on fallback model for API rejections
Claude Code now retries a turn once on the fallback model when the API rejects an unexpected non-retryable error. Certain errors like authentication, rate-limits, request size, and transport errors will still surface immediately.
- Announce target version during `claude update`
The `claude update` command now announces the target version before downloading, improving transparency and user awareness of the update process.
https://github.com/anthropics/claude-code/releases/tag/v2.1.166
Related releases
- Anthropic Python SDK v0.122.0 Adds Dream Creation Output Behavior, Fixes Bugs Anthropic Python SDK Releases ·
- Claude Code Patch Fixes MCP OAuth Sign-In Issue Claude Code Releases ·
- Claude Code v2.1.229 Delivers Stability Fixes and Developer Workflow Improvements Claude Code Releases ·
- Anthropic Claude claude-sonnet-4-5-20250929 reaches end of life in 49 days endoflife.date ·
- Anthropic Claude claude-haiku-4-5-20251001 reaches end of life in 65 days endoflife.date ·
- Claude Code v2.1.228: Bug Fixes and Improvements Claude Code Releases ·