What changed
Claude Code 2.1.166 shipped on June 6, 2026. Fallback model behavior is now a first-class setting, the deny rule tool-name position accepts globs, and the cross-session message authority model is tightened. A long list of regressions across remote sessions, JetBrains 2026.1+ terminals, the Kitty keyboard protocol, and managed-settings validation also lands together.
New features
-
fallbackModelsetting and interactive-session fallbackFalling back when the primary model was overloaded or unavailable was inconsistent, and
--fallback-modeldid not apply to interactive sessions. The newfallbackModelsetting configures up to three fallback models tried in order, and--fallback-modelnow also applies to interactive sessions. -
Glob pattern support in the deny rule tool-name position
Deny rules required listing tools by exact name, so blocking everything meant enumerating each rule. Glob patterns are now supported in the deny rule tool-name position, with
"*"denying all tools. Allow rules reject non-MCP globs, and unknown tool names in deny rules warn at startup. -
Hardened cross-session messaging
Messages relayed via
SendMessagefrom other Claude sessions carried user authority, so receivers could be tricked into permission prompts and auto mode could act on them. Relayed messages now no longer carry user authority — receivers refuse relayed permission requests, and auto mode blocks them. -
MAX_THINKING_TOKENS=0/--thinking disabledapply to default-thinking modelsOn models that think by default,
MAX_THINKING_TOKENS=0,--thinking disabled, and the per-model thinking toggle did not actually disable thinking. They now disable thinking on default-thinking models via the Claude API (3P providers are unchanged). -
Auto-retry once on the fallback model for unexpected non-retryable API errors
An unexpected non-retryable error from the API failed the turn outright, leaving no chance for a fallback. Claude Code now retries a turn once on the fallback model when the API rejects an unexpected non-retryable error. Auth, rate-limit, request-size, and transport errors still surface immediately.
-
claude updateannounces the target version before downloadingclaude updatewent silent during downloads, with no indication of what version was being installed. It now announces the target version before downloading. -
claude agentsURL filterFinding a session by the URL in its first prompt meant scrolling the list manually. Typing a URL into the
claude agentslist now filters to the session whose first prompt contained it.
Bug fixes
Sessions & remote
- Recurring “image could not be processed” error and extra token usage when an unprocessable image was sent in a session — fixed.
- Remote sessions becoming permanently stuck when a brief backend disruption occurred during worker registration at startup — fixed.
- Background agent sessions that entered a git worktree crash-looping with “No conversation found” when reopened from
claude agents— fixed. /doctorshowing a contradictory failed “Not inside a remote session” check when run inside a remote session — fixed.
Permissions & managed settings
- Managed settings with an invalid entry silently disabling enforcement of their remaining valid policies — fixed.
- Managed-settings
allowedMcpServers/deniedMcpServerspredicates not matching when they use${VAR}references — fixed. - Voice mode requiring
/loginto clear a stale auth check after toggling/voice— fixed.
Terminal & UI
- Flickering in JetBrains IDE terminals (IntelliJ, PyCharm, WebStorm, etc.) on 2026.1+ — fixed by enabling synchronized output.
- Shift+non-ASCII characters (e.g. Shift+ä → Ä) being dropped in terminals using the Kitty keyboard protocol (WezTerm, Ghostty, kitty) — fixed.
- Cursor sticking at the end of the first line when typing a multiline prompt in the
claude agentsdispatch and reply inputs — fixed. - Blank lines appearing between background agent rows in the task list on terminals without Unicode support — fixed.
- Duplicated thinking text in the Ctrl+O transcript view while streaming — fixed.
Platform
- PowerShell command validation occasionally hanging far past its time budget on Windows when a killed process’s children held its output pipes — fixed.
- Orphaned
claude --bg-pty-hostprocesses spinning at 100% CPU after the daemon dies while connected on macOS — fixed.
Notes
- 2.1.164 not released; 2.1.165 was a one-line reliability patch — 2.1.164 was never published to GitHub Releases, and 2.1.165’s changelog was just “Bug fixes and reliability improvements,” so neither is covered as a standalone post.
- Cross-session message authority model changed — messages relayed via
SendMessageno longer carry user authority. Receivers refuse relayed permission requests, so any automation that chains sessions should re-verify its permission flow. - Using
fallbackModel— set up to three fallback models in order; Claude Code tries them when the primary is overloaded or unavailable.--fallback-modelalso works in interactive sessions. - Managed settings validation impact — a single invalid entry no longer silently disables the rest of the policies. Environments where managed enforcement quietly stopped applying should re-verify that the rules now take effect after upgrading.
- Using deny rule globs —
"*"denies all tools, and patterns can group tools. Allow rules reject non-MCP globs, and unknown tool names in deny rules warn at startup, so check the startup log after writing new patterns.