| name | anth-upgrade-migration |
| description | Upgrade Anthropic SDK versions and migrate between Claude API versions.
Use when upgrading the Python/TypeScript SDK, migrating from Text Completions
to Messages API, or adopting new API features like tool use or batches.
Trigger with phrases like "upgrade anthropic sdk", "anthropic migration",
"update claude sdk", "migrate to messages api".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(pip:*), Bash(git:*) |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","ai","anthropic"] |
| compatibility | Designed for Claude Code |
Anthropic Upgrade & Migration
Overview
Guide for upgrading the Anthropic SDK and migrating between API versions. The SDK follows semver — major versions may have breaking changes.
Check Current Versions
pip show anthropic | grep Version
npm list @anthropic-ai/sdk
pip index versions anthropic 2>/dev/null | head -1
npm view @anthropic-ai/sdk version
Upgrade Path
Step 1: Create Upgrade Branch
git checkout -b upgrade/anthropic-sdk
Step 2: Upgrade SDK
pip install --upgrade anthropic
pip show anthropic | grep Version
npm install @anthropic-ai/sdk@latest
Step 3: Review Breaking Changes
Key breaking changes by version:
Python SDK 0.20+ (anthropic-version: 2023-06-01)
response = client.completions.create(
model="claude-2",
prompt="\n\nHuman: Hello\n\nAssistant:",
max_tokens_to_sample=256
)
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=256,
messages=[{"role": "user", "content": "Hello"}]
)
Python SDK 0.30+ (streaming changes)
response = client.messages.create(..., stream=True)
for line in response.iter_lines():
...
with client.messages.stream(...) as stream:
for text stream.text_stream:
(text)