← All Claude Code issues

This week in Claude Code · Jun 7, 2026

Claude Builder Weekly: Fallback Models, Middleware Support & Agent SDK Hardening

Get the next issue in your inbox. Weekly · Free

unsubscribe anytime.

TLDR;

A massive Claude Code v2.1.166 drop adds configurable fallback models (up to three), glob-pattern deny rules, hardened cross-session messaging security, and thinking-mode controls — plus 20+ bug fixes. The TypeScript SDK v0.101.0/v0.102.0 lands middleware support across all cloud flavors and ships Managed Agents type updates. Agent SDK releases (TS v0.3.162–v0.3.168, Python v0.2.88–v0.2.93) tighten refusal detection, idempotent initialization, and MCP runtime server injection. Claude Opus 4.1 is now marked deprecated in all cloud SDKs. Upgrade to the latest Claude Code and SDK versions now to stay on supported tooling.

API & Model Updates

Claude Code & CLI

Claude Code v2.1.166: Fallback Models, Glob Deny Rules & Cross-Session Security

  • The headline release of this cycle adds `fallbackModel` config for up to three ordered fallback models on overload, glob-pattern support in deny rules (`"*"` blocks all tools), hardened cross-session messaging that strips user authority from relayed `SendMessage` requests, and the ability to disable thinking via `MAX_THINKING_TOKENS=0`.
  • Also fixes 20+ bugs spanning JetBrains flickering, Kitty keyboard protocol drops, Windows PowerShell hangs, and more.

Editor’s read: Must-read: fallback model config and the cross-session security hardening are both production-critical for multi-agent deployments.

Agent SDK & Managed Agents

MCP Ecosystem

Action Items

Immediate

  • Upgrade Claude Code to v2.1.168 (`claude update`) — picks up fallback model config, cross-session security hardening, glob deny rules, and 20+ bug fixes from the v2.1.166 milestone.
  • Update the TypeScript SDK to v0.102.0 (`npm install @anthropic-ai/claude-agent-sdk@0.3.168`) for Managed Agents type parity and the middleware-before-signing fix.
  • Update the Python Agent SDK to v0.2.93 (`pip install claude-agent-sdk==0.2.93`) to stay current with CLI v2.1.168.
  • Audit any code that detects refusals by matching error text — migrate to checking `stop_reason: "refusal"` as provided in Agent SDK TS v0.3.162+.
  • If you use `session_store=` with trio, upgrade to Python Agent SDK v0.2.88+ immediately to resolve the anyio crash.
  • Review managed-settings configs: `allowedMcpServers`/`deniedMcpServers` `${VAR}` references now work correctly (fixed in v2.1.166); re-test any policy that relied on them.
  • Begin migrating off Claude Opus 4.1 — all TypeScript cloud SDKs (Bedrock, AWS, Vertex, Foundry, core) now mark it deprecated.
  • If you depend on dynamic-workflow trigger keyword `workflow`, rename usages to `ultracode` following the v2.1.160 rename.
  • Review any PostToolUse hook implementations for abort-signal handling — upgrade to Agent SDK TS v0.3.160+ to prevent hanging on abort.
  • If you run Claude Code via managed settings with version enforcement, configure `requiredMinimumVersion`/`requiredMaximumVersion` in your org policy using the new fields from v2.1.163.

All Resources

Every Monday morning

This week in Claude Code

Five minutes, every Monday — the tools, releases and tactics for shipping solo.

unsubscribe anytime.

This week for builders

Five minutes, every Monday — the tools, releases and tactics for shipping solo.

unsubscribe anytime.