This week in Claude Code · Jun 7, 2026
Claude Dev Weekly: SDK Middleware, Fallback Models, and Agent Control Hardening
Get the next issue in your inbox. Weekly · Free
The past week brought a wave of meaningful Claude tooling upgrades. The TypeScript SDK v0.101-v0.102 added a client middleware layer and small Managed Agents type updates, while the Bedrock, Vertex, Foundry, and AWS SDKs followed suit. Claude Code v2.1.166 introduced fallback model chaining, glob-based tool deny rules, and tightened cross-session messaging security. On the agent side, the Claude Agent SDK (TypeScript v0.3.161-v0.3.168, Python v0.2.88-v0.2.93) shipped idempotent initialization, structured refusal stop reasons, runtime MCP server injection fixes, and abort signal propagation in hooks. Claude Opus 4.1 has been formally marked deprecated across cloud SDKs. Upgrade your SDKs now to pick up the middleware and security fixes.
API & Model Updates
TypeScript SDK v0.102.0: Managed Agents type updates and middleware fix
- Released 2026-06-06, sdk-v0.102.0 ships small but breaking-compatible type refinements to Managed Agents alongside a critical fix ensuring middleware runs before request signing, preventing auth header corruption.
TypeScript SDK v0.101.0: Client middleware support lands
- Released 2026-06-05, this release adds a first-class middleware API to the Anthropic TypeScript client, letting builders intercept and transform requests and responses in the fetch pipeline.
- A timeout scoping bug was also fixed so request timeouts no longer apply to the outer middleware chain.
Bedrock SDK v0.30.0-v0.30.1: Middleware support and Claude Opus 4.1 deprecated
- Released 2026-06-05 and 2026-06-06, the Bedrock TypeScript SDK picks up client middleware and formally marks Claude Opus 4.1 as deprecated in v0.30.0, then patches the middleware-before-signing issue in v0.30.1.
AWS SDK v0.4.0-v0.4.1: Middleware and Opus 4.1 deprecation
- Released 2026-06-05 and 2026-06-06, the AWS-flavored TypeScript SDK gains middleware and deprecates Claude Opus 4.1 in v0.4.0, then fixes middleware ordering before request signing in v0.4.1.
Vertex SDK v0.17.0: Middleware and Opus 4.1 deprecated
- Released 2026-06-05, the Vertex TypeScript SDK mirrors the other cloud SDK releases with middleware support and the Claude Opus 4.1 deprecation marker.
Foundry SDK v0.3.0: Middleware and Opus 4.1 deprecated
- Released 2026-06-05, the Foundry SDK joins the wave with client middleware and the Claude Opus 4.1 deprecation signal baked into API types.
Claude Code & CLI
Claude Code v2.1.166: Fallback model chaining, glob deny rules, and cross-session security hardening
- A feature-dense release that adds a fallbackModel setting accepting up to three ordered fallback models when the primary is overloaded, glob patterns in tool deny rules (with wildcard support), and a security tightening that strips user authority from messages relayed via SendMessage across Claude sessions.
Claude Code v2.1.163: Version range enforcement, /plugin list command, and hook additionalContext
- Operators can now set requiredMinimumVersion and requiredMaximumVersion managed settings so Claude Code refuses to run outside an approved version band.
- The /plugin list command with --enabled/--disabled filters and Stop/SubagentStop hook additionalContext for non-error turn feedback also ship here.
Claude Code v2.1.162: Agents waitingFor field, Grep/Glob tool fix, and autocomplete UX tweak
- claude agents --json now surfaces a waitingFor field showing what blocks a session (such as a pending permission prompt).
- Explicitly listing Grep/Glob in --tools now correctly registers the dedicated search tools on native builds, and slash command autocomplete no longer auto-runs on click.
Claude Code v2.1.161: OTEL metric labels, parallel tool call isolation, and /mcp connector cleanup
- OTEL_RESOURCE_ATTRIBUTES values now appear as labels on metric datapoints for slicing by team or repo.
- A parallel tool call bug where a failed Bash command cancelled sibling calls in the same batch is fixed, and /mcp collapses unused claude.ai connectors by default.
Claude Code v2.1.160: Write-to-shell-startup prompt and build-config edit guardrails
- Claude Code now prompts before writing to shell startup files (.zshenv, .zlogin, .bash_login) or git config.
- In acceptEdits mode, it also prompts before touching build-tool config files that could grant code execution, including .npmrc, bunfig.toml, .bazelrc, and .devcontainer.
Agent SDK & Managed Agents
Claude Agent SDK TypeScript v0.3.166: MCP resource tools injected for runtime-added servers
- Fixes a bug where MCP resource tools were not injected for servers added at runtime via the mcp_set_servers control request, which would silently leave those tools unavailable to the agent.
Claude Agent SDK TypeScript v0.3.163: stop_task idempotency, builtin MCP server fix, and hook additionalContext
- stop_task control requests now return success when the target task is already gone, eliminating errors when pruning stale tasks.
- SDK hosts can now add builtin MCP servers like claude-in-chrome via setMcpServers even when the CLI was launched without them.
- Stop and SubagentStop hooks gain an additionalContext field for non-error feedback.
Claude Agent SDK TypeScript v0.3.162: Structured refusal stop reason and embedded search default
- Refusal error messages now carry stop_reason: "refusal" and stop_details on the assistant message, enabling programmatic detection without text matching.
- Agent SDK sessions on native builds now default to the faster embedded find/grep search, matching the interactive CLI; opt into dedicated Grep/Glob tools via the tools option.
Claude Agent SDK TypeScript v0.3.161: Idempotent initialize and live agent switching
- A second initialize control request now returns the same success payload instead of an Already initialized error, simplifying reconnect logic.
- applyFlagSettings can now live-switch the active agent mid-session, taking effect on the next turn.
Claude Agent SDK TypeScript v0.3.160: Abort signal propagation fix in hook callbacks
- Fixes a bug where aborting during a PostToolUse hook caused the calling process to hang indefinitely.
- Aborts now correctly end the turn with a final result message.
Claude Agent SDK Python v0.2.88: Trio compatibility fix for session stores
- Ports session_store code paths (TranscriptMirrorBatcher, session_resume, sessions) from raw asyncio primitives to anyio, resolving a crash when passing session_store to query() or ClaudeSDKClient under the Trio backend.
Claude Agent SDK Python v0.2.91: Async test suite now runs under both asyncio and Trio
- The test suite switches from pytest-asyncio to anyio's pytest plugin, running every async test under both asyncio and Trio backends to catch backend-specific regressions in CI.
MCP Ecosystem
Claude Code v2.1.163: /mcp connector collapse for unused claude.ai connectors
- The /mcp command now hides claude.ai connectors the user has never signed in to behind a Show unused connectors row, reducing noise in the MCP server list for teams managing many potential integrations.
Action Items
Immediate
- Upgrade the Anthropic TypeScript SDK to v0.102.0 (or the corresponding Bedrock v0.30.1, AWS v0.4.1, Vertex v0.17.0, Foundry v0.3.0 builds) to pick up the middleware-before-signing fix and avoid auth header corruption.
- Update Claude Agent SDK TypeScript to v0.3.168 and Python to v0.2.93 to get all MCP injection fixes, abort propagation, and idempotent initialize improvements.
- Update Claude Code to v2.1.168 and review your fallbackModel settings in claude.json to configure up to three ordered fallback models for overload resilience.
- Audit any tool permission rules that used specific tool names in deny positions and update them to use glob patterns now that v2.1.166 supports wildcards (note: allow rules reject non-MCP globs).
- If you operate multi-agent pipelines using SendMessage relay, verify that relayed messages are not carrying permission requests, as v2.1.166 now blocks them when received from other Claude sessions.
- Plan migration away from Claude Opus 4.1: all cloud SDK releases (Bedrock, AWS, Vertex, Foundry) have marked it deprecated.
- If you use requiredMinimumVersion or requiredMaximumVersion managed settings, ensure all deployed Claude Code instances are within the allowed version range after upgrading to v2.1.163+.
- If using the Python Agent SDK under Trio, upgrade to v0.2.88 or later to resolve the session_store crash.
All Resources
- Anthropic TypeScript SDK v0.102.0 release notes
- Anthropic TypeScript SDK v0.101.0 (middleware support)
- Bedrock SDK v0.30.1 release notes
- Bedrock SDK v0.30.0 release notes
- AWS SDK v0.4.1 release notes
- AWS SDK v0.4.0 release notes
- Vertex SDK v0.17.0 release notes
- Foundry SDK v0.3.0 release notes
- Claude Code v2.1.168 release notes
- Claude Code v2.1.166: fallback models and deny glob rules
- Claude Code v2.1.163: version range enforcement and plugin list
- Claude Code v2.1.162: agents waitingFor and Grep/Glob fix
- Claude Code v2.1.161: OTEL labels and parallel tool isolation
- Claude Code v2.1.160: shell startup write prompt and build-config guardrails
- Claude Agent SDK TypeScript v0.3.168
- Claude Agent SDK TypeScript v0.3.166: MCP resource tools injection fix
- Claude Agent SDK TypeScript v0.3.163: stop_task and hook additionalContext
- Claude Agent SDK TypeScript v0.3.162: refusal stop reason and embedded search
- Claude Agent SDK TypeScript v0.3.161: idempotent initialize and live agent switching
- Claude Agent SDK TypeScript v0.3.160: abort signal fix in hooks
- Claude Agent SDK Python v0.2.93
- Claude Agent SDK Python v0.2.91: asyncio and Trio test parity
- Claude Agent SDK Python v0.2.88: Trio session_store fix
This week in Claude Code
Five minutes, every Monday — the tools, releases and tactics for shipping solo.