Commit graph

120 commits

Author SHA1 Message Date
Kashyap Murali
bec72b92ac
fix: Remove all trailing whitespace (ruff W291, W293) 2025-09-02 17:58:17 -07:00
Kashyap Murali
ad48d14db9
fix: Remove trailing whitespace in comments (ruff format) 2025-09-02 17:57:57 -07:00
Kashyap Murali
840136e605
docs: Improve TODO comment explaining Python MCP limitation
Clarify why we need manual routing (Python MCP lacks Transport
abstraction that TypeScript has) and reference tracking issue
2025-09-02 17:56:05 -07:00
Kashyap Murali
fe5141cf09
refactor: Make MCP a required dependency
- Move mcp from optional to required dependencies
- Remove all conditional imports and HAS_MCP checks
- Clean, simple imports at module level
- SDK MCP servers are a core feature, not optional

This is cleaner and simpler - if you install claude-code-sdk,
you get full MCP support out of the box.
2025-09-02 17:38:52 -07:00
Kashyap Murali
d641e10f89
refactor: Clean up MCP imports - no conditional BS
- MCP is an optional dependency for the SDK
- But if you use SDK MCP servers, you must have it installed
- Import at runtime in the method that needs it
- Clear ImportError if MCP not installed when using MCP features
2025-09-02 17:36:26 -07:00
Kashyap Murali
973c061b31
fix: Remove blank line whitespace (ruff W293) 2025-09-02 17:20:46 -07:00
Kashyap Murali
dec66a2b2b
fix: Remove MCP SDK type dependencies to fix CI
- Replace MCP SDK type imports with simpler duck-typing approach
- Use getattr to access server handlers without importing MCP types
- Add sdk_mcp_servers extraction in ClaudeSDKClient
- This avoids import errors when mcp package isn't installed
2025-09-02 17:19:57 -07:00
Kashyap Murali
c8704be6a9
Merge main into feat/sdk-mcp-server-support 2025-09-02 17:11:36 -07:00
Kashyap Murali
902cca6715
fix: Clean up whitespace and unused import in SDK MCP code 2025-09-02 16:39:06 -07:00
Kashyap Murali
42909a5a0e
fix: Fix linting issues in examples (whitespace and imports) 2025-09-02 16:17:49 -07:00
Kashyap Murali
6f1513e7d2
refactor: Use MCP SDK's built-in request handling for SDK MCP servers
- Addresses Ashwin's review comment about letting MCP SDK do the routing
- Directly uses MCP Server's request_handlers instead of manual routing
- Creates proper MCP request types (ListToolsRequest, CallToolRequest)
- Leverages existing MCP SDK infrastructure for better maintainability
- No need for custom transport layer - uses handlers directly
- Future MCP methods will be automatically supported without code changes
2025-09-02 15:14:00 -07:00
Dickson Tsai
22fa9f473e
Implement control protocol support for Python SDK (#139)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
## Summary

This PR implements control protocol support in the Python SDK, aligning
it with the TypeScript implementation pattern. The refactor introduces a
Query + Transport separation to enable bidirectional communication
between the SDK and CLI.

## Motivation

The previous Python SDK implementation used a high-level abstraction in
the Transport ABC (`send_request`/`receive_messages`) that couldn't
handle bidirectional communication. This prevented support for:
- Control messages from CLI to SDK that need responses
- Hooks implementation  
- Dynamic permission mode changes
- SDK MCP servers

## Changes

### Core Architecture Refactor

1. **New Query Class** (`src/claude_code_sdk/_internal/query.py`)
   - Manages control protocol on top of Transport
   - Handles control request/response routing
   - Manages initialization handshake with timeout
   - Supports hook callbacks and tool permission callbacks
   - Implements message streaming

2. **Refactored Transport ABC**
(`src/claude_code_sdk/_internal/transport/__init__.py`)
- Changed from high-level (`send_request`/`receive_messages`) to
low-level (`write`/`read_messages`) interface
   - Now handles raw I/O instead of protocol logic
   - Aligns with TypeScript ProcessTransport pattern

3. **Updated SubprocessCLITransport**
(`src/claude_code_sdk/_internal/transport/subprocess_cli.py`)
   - Simplified to focus on raw message streaming
   - Removed protocol logic (moved to Query)
   - Improved cleanup and error handling

4. **Enhanced ClaudeSDKClient** (`src/claude_code_sdk/client.py`)
   - Now uses Query for control protocol
   - Supports initialization messages
   - Better error handling for control protocol failures

### Control Protocol Features

- **Initialization handshake**: SDK sends initialize request, CLI
responds with supported commands
- **Control message types**: 
  - `initialize`: Establish bidirectional connection
  - `interrupt`: Cancel ongoing operations  
  - `set_permission_mode`: Change permission mode dynamically
- **Timeout handling**: 60-second timeout for initialization to handle
CLI versions without control support

### Examples

Updated `examples/streaming_mode.py` to demonstrate control protocol
initialization and error handling.

## Testing

- Tested with current CLI (no control protocol support yet) - gracefully
falls back
- Verified backward compatibility with existing `query()` function
- Tested initialization timeout handling
- Verified proper cleanup on errors

## Design Alignment

This implementation closely follows the TypeScript reference:
- `src/core/Query.ts` → `src/claude_code_sdk/_internal/query.py`
- `src/transport/ProcessTransport.ts` →
`src/claude_code_sdk/_internal/transport/subprocess_cli.py`
- `src/entrypoints/sdk.ts` → `src/claude_code_sdk/client.py`

## Next Steps

Once the CLI implements the control protocol handler, this will enable:
- Hooks support
- Dynamic permission mode changes
- SDK MCP servers
- Improved error recovery

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Ashwin Bhat <ashwin@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Kashyap Murali <kashyap@anthropic.com>
2025-09-01 23:04:22 -07:00
Kashyap Murali
44f0d05fb7
Merge branch 'dickson/control' into feat/sdk-mcp-server-support 2025-09-01 18:33:33 -07:00
Dickson Tsai
05e932d2d1
Use anyio, not asyncio, in src 2025-09-02 06:35:00 +09:00
Dickson Tsai
dd1ccf8b92
Improve types of control request and response 2025-09-02 06:23:08 +09:00
Kashyap Murali
910b9cbff4
Fix ruff linting issues
- Remove trailing whitespace from blank lines in test_streaming_client.py
2025-09-01 04:00:58 -07:00
Kashyap Murali
ef997feb49
Merge remote-tracking branch 'origin/dickson/control' into feat/sdk-mcp-server-support 2025-09-01 03:48:33 -07:00
Kashyap Murali
866bdf7929
Fix remaining test failures for control protocol
- Update test_transport.py: disconnect() -> close(), is_connected() -> is_ready()
- Update test_subprocess_buffering.py: receive_messages() -> read_messages()
- Fix test_streaming_client.py edge cases:
  - Add control protocol init to test_double_connect (use side_effect for multiple mocks)
  - Add control protocol init to test_receive_response_list_comprehension
  - Add control protocol init to test_concurrent_send_receive
- All transport method calls now use read_messages() instead of receive_messages()

Test results: 89 of 90 tests passing (1 subprocess test still needs work)
2025-09-01 03:45:59 -07:00
Kashyap Murali
a50b134ecf
Fix failing tests for control protocol implementation
- Update test mocks to handle control protocol initialization
- Fix interrupt test to check for control requests via write() instead of interrupt()
- Add control protocol support to mock_receive functions in streaming tests
- Ensure all tests properly handle init handshake before sending messages
- Fix formatting issues (trailing whitespace, blank lines)

All tests now properly support the new Query/Transport architecture with
bidirectional control protocol communication.
2025-09-01 03:24:02 -07:00
Kashyap Murali
92a2d42d36
Apply ruff formatting and merge fixes from base branch
- Applied ruff formatting to all files
- Integrated async/sync fixes from dickson/control branch
- Fixed import conflicts between TYPE_CHECKING and contextlib
- All SDK MCP tests passing
2025-09-01 03:14:44 -07:00
Kashyap Murali
76f6ed1d9c
Merge branch 'dickson/control' into feat/sdk-mcp-server-support
Resolved conflict by keeping both TYPE_CHECKING (needed for MCP) and contextlib.suppress (from base branch fixes)
2025-09-01 03:09:42 -07:00
Kashyap Murali
105da74f68
clean up sdk refactor 2025-09-01 03:00:14 -07:00
Ashwin Bhat
1adacaffe8
Revert "Reorganize imports in client.py"
This reverts commit baee8bae42.
2025-08-31 22:04:21 -07:00
Ashwin Bhat
baee8bae42
Reorganize imports in client.py
- Move json import to top-level imports
- Add asyncio and contextlib.suppress imports for future use
- Remove inline json import from query method

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-31 21:59:47 -07:00
Kashyap Murali
95775ac657
feat: Add SDK MCP server support on top of control protocol
- Rebased SDK MCP implementation onto PR #139's control protocol refactoring
- Moved SDK MCP handling from Transport to Query class for proper layering
- Transport now only filters SDK servers from CLI config
- Query class handles SDK MCP control requests via _handle_sdk_mcp_request
- Added tool decorator and create_sdk_mcp_server API functions
- Added McpSdkServerConfig type definition
- Updated documentation with SDK MCP examples
- Added integration tests for SDK MCP functionality

This implementation properly layers SDK MCP on top of the bidirectional control protocol from PR #139, ensuring clean separation between transport (I/O) and query (protocol) layers.
2025-08-31 20:46:28 -07:00
Anudeep Yegireddi
9a64bc3a64
fix: propagate user cwd to subprocess environment (#136)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
The subprocess transport was ignoring user-specified cwd from
ClaudeCodeOptions, causing the working directory preference to be
overridden by os.environ. This fix ensures the CWD environment variable
is properly passed to child processes.

- Add PWD env var when self._cwd is set in SubprocessCLITransport
- Fixes issue where custom working directory was not respected
- Maintains backward compatibility

Tests: All existing tests pass
2025-08-29 22:36:52 -07:00
Dickson Tsai
cc81142feb
Fix example not to background 2025-08-29 19:53:36 -07:00
Dickson Tsai
b3718cde80
mypy 2025-08-29 19:40:24 -07:00
Dickson Tsai
d40261c8d5
Bubble up initialization message 2025-08-29 19:31:47 -07:00
Dickson Tsai
fb334b6aef
Implement new classes based on Typescript 2025-08-29 19:11:49 -07:00
8519mark
ea7e86714f
add end of command options to sanitize user prompt (#130)
The PR should address the issue where user prompt maybe treated as a
option with leading `-`
Assuming `claude` does follow POSIX standard, the `--` option should
solve the issue.

fixes #129
2025-08-29 18:09:01 -07:00
Abhijeeth Padarthi
a801a33086
simplify example with interrupt (#127)
This PR simplifies the example with interrupt. 
There is a flag interrupt_sent that isn't required since the execution
loop will terminate after interrupt with the following message:
`{"content": [{"type": "text", "text": "[Request interrupted by
user]"}]}`
2025-08-29 18:08:13 -07:00
Suzanne Wang
f794e17e78
Add support for custom env vars (#131)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
## Key changes
- Adds env field to `ClaudeCodeOptions`, allowing custom env vars to cli
- Updates tests and examples

## Motivation
Bringing Python SDK to feature parity with TS SDK, which supports custom
env vars

## Notes
- Environment variables are merged in order: system env → user env → SDK
required vars
- This implementation seems slightly more robust than the TypeScript
version, which can exclude OS envs vars if a user passes a minimal env
object
- Some linting changes seem to have been picked up
2025-08-25 14:02:03 -07:00
Michael Gendy
30df222bfc
Move thinking block parsing from user to assistant messages (#119)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
Related to https://github.com/anthropics/claude-code-sdk-python/pull/28
cc @dicksontsai
2025-08-19 13:36:12 -07:00
Rushil Patel
bc01cd7e9a
feat: enable custom transports (#91)
## Summary

This PR exposes the `Transport` interface in the public API, enabling
users to pass custom transport implementations to the `query()`
function. Previously, transport selection was internal and users had no
way to provide custom implementations.

**Primary Benefits:**
- 🔌 **Remote claude code** - Connect to Claude Code CLIs running
remotely
- The concrete use case here is to be able to implement a custom
transport that can communicate to claude code instances running in
remote sandboxes. Currently the the sdk only works with Claude Codes
running in a local subprocess limiting the scenarios in which this SDK
can be used.

## Changes

### Public API Changes
- **Exposed the previously internal `Transport` abstract base class** in
`claude_code_sdk.__init__.py`
- **Added `transport` parameter** to `query()` function signature
- **Updated docstring** with transport parameter documentation

### Internal Changes
- **Modified `InternalClient.process_query()`** to accept optional
transport parameter
- **Added transport selection logic** - use provided transport or
default to `SubprocessCLITransport`
- **Updated `__all__` exports** to include `Transport`

### Testing
- **Updated existing tests** to work with new transport parameter
- **Maintained backward compatibility** - all existing code continues to
work unchanged

## Testing

### Existing Tests
-  All existing unit tests pass with new transport parameter
-  Integration tests updated to mock new transport interface
-  Subprocess buffering tests continue to work with exposed transport

### New Functionality Testing
-  Verified custom transport can be passed to `query()`
-  Confirmed default behavior unchanged when no transport provided  
-  Validated transport lifecycle ( connect → receive → disconnect)
-  Tested transport interface compliance with abstract base class

## Example Usage

### Basic Custom Transport
```python
from claude_code_sdk import query, ClaudeCodeOptions, Transport

class MyCustomTransport(Transport):
    # Implement abstract methods: connect, disconnect, 
    # send_request, receive_messages, is_connected
    pass

transport = MyCustomTransport()
async for message in query(
    prompt="Hello",
    transport=transport
):
    print(message)
```

## Related
- #85 

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Signed-off-by: Rushil Patel <rpatel@codegen.com>
2025-08-19 13:28:42 -07:00
github-actions[bot]
91315e3824
chore: bump version to 0.0.20 (#121)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
This PR updates the version to 0.0.20 after publishing to PyPI.

## Changes
- Updated version in `pyproject.toml`
- Updated version in `src/claude_code_sdk/__init__.py`

## Release Information
- Published to PyPI: https://pypi.org/project/claude-code-sdk/0.0.20/
- Install with: `pip install claude-code-sdk==0.0.20`

🤖 Generated by GitHub Actions

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-14 08:45:28 -07:00
Michael Gendy
b6a5b98604
Add support for plan permission mode (#116)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
2025-08-07 13:06:05 -07:00
yokomotod
f1e6dda230
fix: add support for thinking content blocks (#28)
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run
Test / test (3.12) (push) Waiting to run
Test / test (3.13) (push) Waiting to run
## Summary

Fixes an issue where `thinking` content blocks in Claude Code responses
were not being parsed, resulting in empty `AssistantMessage` content
arrays.

## Changes
- Added `ThinkingBlock` dataclass to handle thinking content with
`thinking` and `signature` fields
- Updated client parsing logic in `_internal/client.py` to recognize and
create `ThinkingBlock` instances
- Added comprehensive test coverage for thinking block functionality

## Before

```python
# Claude Code response with thinking block resulted in:
AssistantMessage(content=[])  # Empty content!
```

## After

```python
# Now correctly parses to:
AssistantMessage(content=[
    ThinkingBlock(thinking="...", signature="...")
])
```

Fixes #27

---------

Co-authored-by: Dickson Tsai <dickson@anthropic.com>
2025-08-06 19:00:02 -07:00
Sam Fu
6bbe00cc15
fix pytest allowed tool (#117) 2025-08-06 16:03:30 -07:00
Sam Fu
58b5a41a15
allow claude gh action to lint, typecheck, and run tests (#115)
Co-authored-by: Ashwin Bhat <ashwin@anthropic.com>
2025-08-06 15:29:34 -07:00
Sam Fu
f233df1852
teach ClaudeCodeOptions.mcp_servers to accept a filepath (#114)
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run
Test / test (3.12) (push) Waiting to run
Test / test (3.13) (push) Waiting to run
`claude`'s `--mcp-config` takes either a JSON file or string, so support
this in `ClaudeCodeOptions`
```
  --mcp-config <file or string>    Load MCP servers from a JSON file or string
```

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Sam Fu <shunfu@users.noreply.github.com>
2025-08-06 14:13:59 -07:00
Dickson Tsai
9fc830028e
Add extra_args field to ClaudeCodeOptions for forward compatibility (#111)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
## Summary
- Adds `extra_args` field to `ClaudeCodeOptions` to support passing
arbitrary CLI flags
- Enables forward compatibility with future CLI flags without requiring
SDK updates
- Supports both valued flags (`--flag value`) and boolean flags
(`--flag`)

## Changes
- Add `extra_args: dict[str, str | None]` field to `ClaudeCodeOptions`
- Implement logic in `SubprocessCLITransport` to handle extra args:
- `None` values create boolean flags (e.g., `{"verbose": None}` →
`--verbose`)
- String values create flags with arguments (e.g., `{"output": "json"}`
→ `--output json`)
- Add comprehensive tests for the new functionality

## Test plan
- [x] Added unit tests for settings file path handling
- [x] Added unit tests for settings JSON object handling  
- [x] Added unit tests for extra_args with both valued and boolean flags
- [x] All tests pass (`python -m pytest tests/`)
- [x] Type checking passes (`python -m mypy src/`)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-04 22:47:24 -07:00
Sam Fu
8f4b7777b9
remove mcp_tools field from ClaudeCodeOptions (#110)
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run
Test / test (3.12) (push) Waiting to run
Test / test (3.13) (push) Waiting to run
the `mcp_tools` field in `ClaudeCodeOptions` seems to have been there
since the initial commit but I couldn't find any references in the repo,
so I believe it may be vestigial and unused
2025-08-04 11:14:01 -07:00
github-actions[bot]
6255850eb2
chore: bump version to 0.0.19 (#105)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
This PR updates the version to 0.0.19 after publishing to PyPI.

## Changes
- Updated version in `pyproject.toml`
- Updated version in `src/claude_code_sdk/__init__.py`

## Release Information
- Published to PyPI: https://pypi.org/project/claude-code-sdk/0.0.19/
- Install with: `pip install claude-code-sdk==0.0.19`

🤖 Generated by GitHub Actions

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-31 22:37:33 -07:00
Dickson Tsai
0cb5efa923
Support --add-dir flag (#104) 2025-07-31 20:52:30 -07:00
Dickson Tsai
fbda510ee4
Fix subprocess deadlock with MCP servers via stderr redirection (#103)
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run
Test / test (3.12) (push) Waiting to run
Test / test (3.13) (push) Waiting to run
## Summary

Fixes a critical deadlock issue that occurs when MCP servers produce
verbose stderr output. The SDK would hang indefinitely when the stderr
pipe buffer filled up.

## The Problem

The deadlock occurred due to sequential reading of subprocess streams:
1. SDK reads stdout completely before reading stderr
2. When stderr pipe buffer fills (64KB on Linux, 16KB on macOS),
subprocess blocks on write
3. Subprocess can't continue to stdout, parent waits for stdout →
**DEADLOCK** 🔒

## The Solution  

Redirect stderr to a temporary file instead of a pipe:
- **No pipe buffer** = no possibility of deadlock
- Temp file can grow as needed (no 64KB limit)
- Still capture stderr for error reporting (last 100 lines)
- Works consistently across all async backends

## Implementation Details

- `stderr=tempfile.NamedTemporaryFile()` instead of `stderr=PIPE`
- Use `deque(maxlen=100)` to keep only recent stderr lines in memory
- Temp file is automatically cleaned up on disconnect
- Add `[stderr truncated, showing last 100 lines]` message when buffer
is full

## Testing

- Verified no deadlock with 150+ lines of stderr output
- Confirmed stderr is still captured for error reporting
- All existing tests pass
- Works with asyncio, trio, and other anyio backends

## Impact

- Fixes consistent hangs in production with MCP servers
- No functional regression - stderr handling is preserved
- Simpler than concurrent reading alternatives
- More robust than pipe-based solutions

Fixes the issue reported in Slack where SDK would hang indefinitely when
receiving messages from MCP servers with verbose logging.

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-31 11:42:20 -07:00
github-actions[bot]
0de87a2a96
chore: bump version to 0.0.18 (#102)
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run
Test / test (3.12) (push) Waiting to run
Test / test (3.13) (push) Waiting to run
This PR updates the version to 0.0.18 after publishing to PyPI.

## Changes
- Updated version in `pyproject.toml`
- Updated version in `src/claude_code_sdk/__init__.py`

## Release Information
- Published to PyPI: https://pypi.org/project/claude-code-sdk/0.0.18/
- Install with: `pip install claude-code-sdk==0.0.18`

🤖 Generated by GitHub Actions

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-31 11:02:29 -07:00
Dickson Tsai
fa3962de3f
Improve UserMessage types to include ToolResultBlock (#101)
Fixes https://github.com/anthropics/claude-code-sdk-python/issues/90
2025-07-31 07:51:39 -07:00
Dickson Tsai
df94948edc
Add settings option to ClaudeCodeOptions (#100)
Some checks are pending
Lint / lint (push) Waiting to run
Test / test (3.10) (push) Waiting to run
Test / test (3.11) (push) Waiting to run
Test / test (3.12) (push) Waiting to run
Test / test (3.13) (push) Waiting to run
## Summary
- Add `settings` field to `ClaudeCodeOptions` to expose the `--settings`
CLI flag
- Allow SDK users to specify custom settings configuration path

## Changes
- Added `settings: str | None = None` field to `ClaudeCodeOptions`
dataclass
- Added CLI argument conversion logic in `SubprocessCLITransport` to
pass `--settings` flag to Claude Code CLI

## Test plan
- [x] All existing tests pass
- [x] Linting passes (`python -m ruff check`)
- [x] Type checking passes (`python -m mypy src/`)

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-07-30 23:59:21 -07:00
github-actions[bot]
472aa23aae
chore: bump version to 0.0.17 (#88)
Some checks failed
Lint / lint (push) Has been cancelled
Test / test (3.10) (push) Has been cancelled
Test / test (3.11) (push) Has been cancelled
Test / test (3.12) (push) Has been cancelled
Test / test (3.13) (push) Has been cancelled
This PR updates the version to 0.0.17 after publishing to PyPI.

## Changes
- Updated version in `pyproject.toml`
- Updated version in `src/claude_code_sdk/__init__.py`

## Release Information
- Published to PyPI: https://pypi.org/project/claude-code-sdk/0.0.17/
- Install with: `pip install claude-code-sdk==0.0.17`

🤖 Generated by GitHub Actions

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-23 22:52:20 -07:00