
Claude Code's /claude-api upgrade Migrates Your Python SDK from 0.x to 1.x — What It Handles Automatically and What Still Needs Eyes
Chris Harper
2 min read
Aug 23, 2026 · 04:09 UTC
TL;DR: Claude Code v2.1.239 added /claude-api upgrade — a skill that finds 0.x SDK usage in your Python project, creates a migration branch, and applies the 1.x breaking changes automatically, except for custom HTTP transport and instrumentation.
The anthropic Python SDK is on 1.x, and if your project is still on 0.x (pip show anthropic shows a version starting with 0.), there are real breaking changes. The two that catch teams by surprise:
httpx.Timeoutis replaced byanthropic.Timeout. Code that passestimeout=httpx.Timeout(60.0, connect=2.0)to the client throws aTypeErroron 1.x.- The internal transport switched from
httpxtohttpx2. Anything that patcheshttpxdirectly — OpenTelemetry'sHTTPXClientInstrumentor, Sentry'shttpxintegration,respx,pytest-httpx— no longer sees the SDK's requests. Fix: callhttpx2.alias_httpx()once at startup, before anyimport httpx.
Running the migration
In any Claude Code session with your project open:
/claude-api upgrade
The skill detects your anthropic version from requirements.txt or pyproject.toml, greps the codebase for 0.x patterns, creates a feature branch, applies the mechanical changes, and writes a summary of what it touched. It handles the httpx.Timeout → anthropic.Timeout swap and the common response-field access pattern changes.
What still needs a human
- Custom HTTP client injection (proxies, transports) — update to
httpx2explicitly - Any
httpx-level instrumentation — addhttpx2.alias_httpx()at startup - Tool-use code:
@beta_tooldecorator andtool_runnerare new 1.x helpers the skill won't introduce automatically; check the updated docs
The skill is good for the mechanical 80%. Test your actual API calls after — it can't know if your production request patterns exercise edge cases.
Sources: Claude Code changelog v2.1.239 — Anthropic · Python SDK docs — Anthropic · 0.x → 1.x MIGRATION.md — GitHub · Real-world upgrade discussion — microsoft/agent-framework #6986