Skip to content

Commit b3656b1

Browse files
authored
Rename claude_code to claude_agent (#188)
1 parent 180d648 commit b3656b1

49 files changed

Lines changed: 109 additions & 109 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/create-release-tag.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ jobs:
5151
--title "Release v${{ steps.extract_version.outputs.version }}" \
5252
--generate-notes \
5353
--notes-start-tag "${{ steps.previous_tag.outputs.previous_tag }}" \
54-
--notes "Published to PyPI: https://pypi.org/project/claude-code-sdk/${{ steps.extract_version.outputs.version }}/
54+
--notes "Published to PyPI: https://pypi.org/project/claude-agent-sdk/${{ steps.extract_version.outputs.version }}/
5555
5656
### Installation
5757
\`\`\`bash
58-
pip install claude-code-sdk==${{ steps.extract_version.outputs.version }}
58+
pip install claude-agent-sdk==${{ steps.extract_version.outputs.version }}
5959
\`\`\`"

.github/workflows/publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
run: |
103103
twine upload dist/*
104104
echo "Package published to PyPI"
105-
echo "Install with: pip install claude-code-sdk==${{ env.VERSION }}"
105+
echo "Install with: pip install claude-agent-sdk==${{ env.VERSION }}"
106106
107107
- name: Create version update PR
108108
env:
@@ -124,7 +124,7 @@ jobs:
124124
echo "Getting SHA for pyproject.toml"
125125
PYPROJECT_SHA=$(gh api /repos/$GITHUB_REPOSITORY/contents/pyproject.toml --jq '.sha')
126126
echo "Getting SHA for _version.py"
127-
VERSION_SHA=$(gh api /repos/$GITHUB_REPOSITORY/contents/src/claude_code_sdk/_version.py --jq '.sha')
127+
VERSION_SHA=$(gh api /repos/$GITHUB_REPOSITORY/contents/src/claude_agent_sdk/_version.py --jq '.sha')
128128
129129
# Commit pyproject.toml via GitHub API (this creates signed commits)
130130
message="chore: bump version to ${{ env.VERSION }}"
@@ -138,10 +138,10 @@ jobs:
138138
-f branch="$BRANCH_NAME"
139139
140140
# Commit _version.py via GitHub API
141-
base64 -i src/claude_code_sdk/_version.py > version.py.b64
141+
base64 -i src/claude_agent_sdk/_version.py > version.py.b64
142142
gh api \
143143
--method PUT \
144-
/repos/$GITHUB_REPOSITORY/contents/src/claude_code_sdk/_version.py \
144+
/repos/$GITHUB_REPOSITORY/contents/src/claude_agent_sdk/_version.py \
145145
-f message="$message" \
146146
-F content=@version.py.b64 \
147147
-f sha="$VERSION_SHA" \
@@ -152,11 +152,11 @@ jobs:
152152
153153
## Changes
154154
- Updated version in \`pyproject.toml\`
155-
- Updated version in \`src/claude_code_sdk/_version.py\`
155+
- Updated version in \`src/claude_agent_sdk/_version.py\`
156156
157157
## Release Information
158-
- Published to PyPI: https://pypi.org/project/claude-code-sdk/${{ env.VERSION }}/
159-
- Install with: \`pip install claude-code-sdk==${{ env.VERSION }}\`
158+
- Published to PyPI: https://pypi.org/project/claude-agent-sdk/${{ env.VERSION }}/
159+
- Install with: \`pip install claude-agent-sdk==${{ env.VERSION }}\`
160160
161161
🤖 Generated by GitHub Actions"
162162

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
2929
- name: Run tests
3030
run: |
31-
python -m pytest tests/ -v --cov=claude_code_sdk --cov-report=xml
31+
python -m pytest tests/ -v --cov=claude_agent_sdk --cov-report=xml
3232
3333
- name: Upload coverage to Codecov
3434
uses: codecov/codecov-action@v4

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ python -m pytest tests/test_client.py
1818

1919
# Codebase Structure
2020

21-
- `src/claude_code_sdk/` - Main package
21+
- `src/claude_agent_sdk/` - Main package
2222
- `client.py` - ClaudeSDKClient for interactive sessions
2323
- `query.py` - One-shot query function
2424
- `types.py` - Type definitions

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Claude Code SDK for Python
1+
# Claude Agent SDK for Python
22

3-
Python SDK for Claude Code. See the [Claude Code SDK documentation](https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-python) for more information.
3+
Python SDK for Claude Agent. See the [Claude Agent SDK documentation](https://docs.anthropic.com/en/docs/claude-code/sdk/sdk-python) for more information.
44

55
## Installation
66

77
```bash
8-
pip install claude-code-sdk
8+
pip install claude-agent-sdk
99
```
1010

1111
**Prerequisites:**
@@ -17,7 +17,7 @@ pip install claude-code-sdk
1717

1818
```python
1919
import anyio
20-
from claude_code_sdk import query
20+
from claude_agent_sdk import query
2121

2222
async def main():
2323
async for message in query(prompt="What is 2 + 2?"):
@@ -28,10 +28,10 @@ anyio.run(main)
2828

2929
## Basic Usage: query()
3030

31-
`query()` is an async function for querying Claude Code. It returns an `AsyncIterator` of response messages. See [src/claude_code_sdk/query.py](src/claude_code_sdk/query.py).
31+
`query()` is an async function for querying Claude Code. It returns an `AsyncIterator` of response messages. See [src/claude_agent_sdk/query.py](src/claude_agent_sdk/query.py).
3232

3333
```python
34-
from claude_code_sdk import query, ClaudeAgentOptions, AssistantMessage, TextBlock
34+
from claude_agent_sdk import query, ClaudeAgentOptions, AssistantMessage, TextBlock
3535

3636
# Simple query
3737
async for message in query(prompt="Hello Claude"):
@@ -79,7 +79,7 @@ options = ClaudeAgentOptions(
7979
## ClaudeSDKClient
8080

8181
`ClaudeSDKClient` supports bidirectional, interactive conversations with Claude
82-
Code. See [src/claude_code_sdk/client.py](src/claude_code_sdk/client.py).
82+
Code. See [src/claude_agent_sdk/client.py](src/claude_agent_sdk/client.py).
8383

8484
Unlike `query()`, `ClaudeSDKClient` additionally enables **custom tools** and **hooks**, both of which can be defined as Python functions.
8585

@@ -94,7 +94,7 @@ For an end-to-end example, see [MCP Calculator](examples/mcp_calculator.py).
9494
#### Creating a Simple Tool
9595

9696
```python
97-
from claude_code_sdk import tool, create_sdk_mcp_server, ClaudeAgentOptions, ClaudeSDKClient
97+
from claude_agent_sdk import tool, create_sdk_mcp_server, ClaudeAgentOptions, ClaudeSDKClient
9898

9999
# Define a tool using the @tool decorator
100100
@tool("greet", "Greet a user", {"name": str})
@@ -186,7 +186,7 @@ For more examples, see examples/hooks.py.
186186
#### Example
187187

188188
```python
189-
from claude_code_sdk import ClaudeAgentOptions, ClaudeSDKClient, HookMatcher
189+
from claude_agent_sdk import ClaudeAgentOptions, ClaudeSDKClient, HookMatcher
190190

191191
async def check_bash_command(input_data, tool_use_id, context):
192192
tool_name = input_data["tool_name"]
@@ -232,15 +232,15 @@ async with ClaudeSDKClient(options=options) as client:
232232

233233
## Types
234234

235-
See [src/claude_code_sdk/types.py](src/claude_code_sdk/types.py) for complete type definitions:
235+
See [src/claude_agent_sdk/types.py](src/claude_agent_sdk/types.py) for complete type definitions:
236236
- `ClaudeAgentOptions` - Configuration options
237237
- `AssistantMessage`, `UserMessage`, `SystemMessage`, `ResultMessage` - Message types
238238
- `TextBlock`, `ToolUseBlock`, `ToolResultBlock` - Content blocks
239239

240240
## Error Handling
241241

242242
```python
243-
from claude_code_sdk import (
243+
from claude_agent_sdk import (
244244
ClaudeSDKError, # Base error
245245
CLINotFoundError, # Claude Code not installed
246246
CLIConnectionError, # Connection issues
@@ -259,7 +259,7 @@ except CLIJSONDecodeError as e:
259259
print(f"Failed to parse response: {e}")
260260
```
261261

262-
See [src/claude_code_sdk/_errors.py](src/claude_code_sdk/_errors.py) for all error types.
262+
See [src/claude_agent_sdk/_errors.py](src/claude_agent_sdk/_errors.py) for all error types.
263263

264264
## Available Tools
265265

e2e-tests/test_agents_and_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import pytest
77

8-
from claude_code_sdk import (
8+
from claude_agent_sdk import (
99
AgentDefinition,
1010
ClaudeAgentOptions,
1111
ClaudeSDKClient,

e2e-tests/test_dynamic_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44

5-
from claude_code_sdk import (
5+
from claude_agent_sdk import (
66
ClaudeAgentOptions,
77
ClaudeSDKClient,
88
)

e2e-tests/test_include_partial_messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import pytest
1111

12-
from claude_code_sdk import ClaudeSDKClient
13-
from claude_code_sdk.types import (
12+
from claude_agent_sdk import ClaudeSDKClient
13+
from claude_agent_sdk.types import (
1414
ClaudeAgentOptions,
1515
StreamEvent,
1616
AssistantMessage,

e2e-tests/test_sdk_mcp_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import pytest
1010

11-
from claude_code_sdk import (
11+
from claude_agent_sdk import (
1212
ClaudeAgentOptions,
1313
ClaudeSDKClient,
1414
create_sdk_mcp_server,

e2e-tests/test_stderr_callback.py

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

33
import pytest
44

5-
from claude_code_sdk import ClaudeCodeOptions, query
5+
from claude_agent_sdk import ClaudeAgentOptions, query
66

77

88
@pytest.mark.e2e
@@ -15,7 +15,7 @@ def capture_stderr(line: str):
1515
stderr_lines.append(line)
1616

1717
# Enable debug mode to generate stderr output
18-
options = ClaudeCodeOptions(
18+
options = ClaudeAgentOptions(
1919
stderr=capture_stderr,
2020
extra_args={"debug-to-stderr": None}
2121
)
@@ -39,7 +39,7 @@ def capture_stderr(line: str):
3939
stderr_lines.append(line)
4040

4141
# No debug mode enabled
42-
options = ClaudeCodeOptions(stderr=capture_stderr)
42+
options = ClaudeAgentOptions(stderr=capture_stderr)
4343

4444
# Run a simple query
4545
async for _ in query(prompt="What is 1+1?", options=options):

0 commit comments

Comments
 (0)