Anthropic: Claude Code v2.1.166 — fallback models and hardened cross-session security
Anthropic has released Claude Code v2.1.166 with a new fallbackModel setting for up to three backup models and hardened cross-session security. The release also brings support for glob patterns in deny rules and around 20 fixes.
This article was generated using artificial intelligence from primary sources.
Anthropic released Claude Code v2.1.166 on 6 June 2026, a release that introduces configurable backup models and a set of cross-session security hardenings into its development CLI tool (command-line interface). It is a practical upgrade focused on the reliability of work when the primary model is unavailable.
What does the new fallbackModel setting bring?
The most prominent novelty is the fallbackModel setting. It lets you configure up to three backup models that are tried in order when the primary model is overloaded or unavailable. Instead of the session stalling, Claude Code automatically switches to the next model in line and continues working.
In addition, the --fallback-model flag now applies to interactive sessions as well. Previously this mechanism relied primarily on non-interactive calls, so users working in dialogue did not have the same protection against interruption. With this change Anthropic unifies the behavior across both modes of operation.
How do glob patterns work in deny rules?
The release adds support for glob patterns (patterns with wildcard characters) in deny rules. The pattern "*" now blocks all tools at once, which gives administrators a coarser but stronger way of limiting what the tool may run.
This change is useful in environments where it is necessary to quickly lock down all capabilities and then selectively unlock only the permitted tools. It thereby simplifies the configuration of permissions in Claude Code for restrictive, security-sensitive setups.
Why was cross-session security hardened?
Claude Code v2.1.166 changes the way messages between sessions are handled. Messages forwarded via SendMessage from other Claude sessions no longer carry user authority. Specifically, recipients reject forwarded permission requests, and auto mode blocks them.
The goal is to prevent one session from indirectly approving sensitive actions in another. This narrows the space for unwanted escalation of privileges through inter-agent communication, which is important for team and automated workflows.
What changed regarding model thinking?
The new version also changes the control over model thinking. Setting MAX_THINKING_TOKENS=0 or using --thinking disabled now turns off thinking even on models that think by default.
Previously these flags did not reliably turn off thinking on such models, so users who wanted faster or cheaper responses had limited control. Now the behavior is consistent regardless of an individual model’s default settings.
What are the other fixes in the release?
Alongside the main novelties, Claude Code v2.1.166 brings around 20 fixes. Among them are a fix for terminal flickering in the JetBrains environment, a fix for the Kitty keyboard protocol for Shift and non-ASCII character combinations, and improved PowerShell validation.
The issue of orphaned processes on macOS was also fixed. Although not spectacular in themselves, these fixes improve the day-to-day stability of the tool across different platforms and terminals.
Frequently Asked Questions
- What does the new fallbackModel setting do?
- fallbackModel lets you configure up to three backup models that Claude Code tries in order when the primary model is overloaded or unavailable. In version v2.1.166 the --fallback-model flag now applies to interactive sessions as well, not just non-interactive calls.
- How was cross-session security hardened?
- Messages forwarded via SendMessage from other Claude sessions no longer carry user authority. Recipients reject forwarded permission requests, and auto mode blocks them. This reduces the risk that one session can grant actions in another without authorization.
- How do you fully turn off a model's thinking?
- Setting MAX_THINKING_TOKENS=0 or using --thinking disabled now turns off thinking even on models that think by default. Previously this behavior could not be reliably turned off on such models.
📬 AI news in your inbox
A daily digest built your way — pick topics, sources and cadence. One-click unsubscribe.