CloudCodeTree LogoCloudCodeTree
AI NewsTutorialsAbout
CloudCodeTree Logo
CloudCodeTree
  • AI News
  • Tutorials
  • About
← Back to AI News
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

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

AI
Workflow
Claude Code
Developer Tools

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.Timeout is replaced by anthropic.Timeout. Code that passes timeout=httpx.Timeout(60.0, connect=2.0) to the client throws a TypeError on 1.x.
  • The internal transport switched from httpx to httpx2. Anything that patches httpx directly — OpenTelemetry's HTTPXClientInstrumentor, Sentry's httpx integration, respx, pytest-httpx — no longer sees the SDK's requests. Fix: call httpx2.alias_httpx() once at startup, before any import 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.Timeoutanthropic.Timeout swap and the common response-field access pattern changes.

What still needs a human

  • Custom HTTP client injection (proxies, transports) — update to httpx2 explicitly
  • Any httpx-level instrumentation — add httpx2.alias_httpx() at startup
  • Tool-use code: @beta_tool decorator and tool_runner are 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