C.W.K.
Stream
Lesson 01 of 08 · published

Renamed: Claude Code SDK Is Now Claude Agent SDK

~14 min · rename, install, claude-agent-sdk, migration

Level 0Observer
0 XP0/64 lessons0/13 achievements
0/150 XP to next level150 XP to go0% complete

The rename in one paragraph

In late 2025 Anthropic renamed the Claude Code SDK to the Claude Agent SDK to reflect that it is no longer just for writing code — it is a general autonomous-agent harness based on Claude Code's capabilities. New package names: claude-agent-sdk on PyPI, @anthropic-ai/claude-agent-sdk on npm. The old claude-code-sdk packages are migration history.

What survived, what changed

The architecture is the same — a Claude subprocess wrapped in a transport, with tools, sessions, MCP, and hooks. The Python option type changed from ClaudeCodeOptions to ClaudeAgentOptions. Default system prompt assumptions changed (the SDK no longer auto-injects Claude Code's system prompt; you must opt in via system_prompt={"type": "preset", "preset": "claude_code"}).

Migration as a search-and-replace

For code that ran on the old SDK, migration is mostly mechanical: replace package names, replace ClaudeCodeOptions with ClaudeAgentOptions, decide whether you want the Claude Code preset (yes for code-editing agents, no for fresh-persona agents). Pin the new version and run your tests.

Principle: When an SDK renames itself, that is the loudest possible signal that old tutorials are stale. Verify everything against current docs and current installed source.

Code

Install the renamed SDK·bash
# Python
pip install -U claude-agent-sdk
python -c "import claude_agent_sdk; print(claude_agent_sdk.__version__)"

# TypeScript
npm install @anthropic-ai/claude-agent-sdk
node -e "console.log(require('@anthropic-ai/claude-agent-sdk/package.json').version)"
Migration grep·bash
# Find every site that still uses the old names
rg "claude-code-sdk|@anthropic-ai/claude-code-sdk|ClaudeCodeOptions|claude_code_sdk" .

# Replace with the new ones, then re-run tests.
First call with the new package·python
import asyncio
from claude_agent_sdk import query, ClaudeAgentOptions

async def main():
    options = ClaudeAgentOptions(
        cwd="/tmp",
        # Opt INTO the Claude Code preset for code-style behavior:
        system_prompt={"type": "preset", "preset": "claude_code"},
    )
    async for event in query(prompt="Say hi.", options=options):
        print(event)

asyncio.run(main())

External links

Exercise

If you have any Claude Code SDK code, run the migration grep above. Replace package and option names. Pin the new version. Run your tests; fix any breakage.
Hint
If your tests pass without changes after the rename, you probably did not have integration tests yet — that is the next thing to fix.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.