Skip to content

Commit c6a8024

Browse files
ashwin-antclaude
andauthored
feat: add deprecation warnings for Claude Code SDK to Claude Agent SDK migration (#194)
Add DeprecationWarning to both ClaudeSDKClient and query() entry points to inform users that the package has been renamed to claude-agent-sdk and provide migration guidance. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent e8832f1 commit c6a8024

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/claude_code_sdk/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import json
44
import os
5+
import warnings
56
from collections.abc import AsyncIterable, AsyncIterator
67
from dataclasses import replace
78
from typing import Any
@@ -53,6 +54,14 @@ class ClaudeSDKClient:
5354

5455
def __init__(self, options: ClaudeCodeOptions | None = None):
5556
"""Initialize Claude SDK client."""
57+
warnings.warn(
58+
"The Claude Code SDK is now the Claude Agent SDK! "
59+
"Please install and use claude-agent-sdk instead. "
60+
"See https://docs.claude.com/en/docs/claude-code/sdk/migration-guide for migration instructions.",
61+
DeprecationWarning,
62+
stacklevel=2,
63+
)
64+
5665
if options is None:
5766
options = ClaudeCodeOptions()
5867
self.options = options

src/claude_code_sdk/query.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Query function for one-shot interactions with Claude Code."""
22

33
import os
4+
import warnings
45
from collections.abc import AsyncIterable, AsyncIterator
56
from typing import Any
67

@@ -113,6 +114,14 @@ class MyCustomTransport(Transport):
113114
```
114115
115116
"""
117+
warnings.warn(
118+
"The Claude Code SDK is now the Claude Agent SDK! "
119+
"Please install and use claude-agent-sdk instead. "
120+
"See https://docs.claude.com/en/docs/claude-code/sdk/migration-guide for migration instructions.",
121+
DeprecationWarning,
122+
stacklevel=2,
123+
)
124+
116125
if options is None:
117126
options = ClaudeCodeOptions()
118127

0 commit comments

Comments
 (0)