anthropics / anthropics/claude-agent-sdk-python

`cwd` in ClaudeCodeOptions does not seem to be honored at all

Open
#10 10 comments 14 reactions 1 assignee Claimed by @ltawfik View on GitHub
bug
Dominant language
Python
Stars
8.1k
Forks
1.3k
Avg merge
2d 31m
Merged PRs (30d)
1

Description

Update

This is now ok when I use opus for some reason.

Using this code from the examples and docs. The cwd is completely ignored and random paths are picked. Even with bypassPermissions enabled

```
async def main():
messages: list[Message] = []

async for message in query(
prompt = prompt,
options = ClaudeCodeOptions(
cwd = Path("/path/to/app"),
system_prompt = "You are a helpful assistant",
allowed_tools = ['Task', 'Agent', 'Bash', 'Glob', 'Grep', 'LS', 'exit_plan_mode', 'Read', 'Edit', 'MultiEdit', 'Write', 'NotebookRead', 'NotebookEdit', 'WebFetch', 'TodoRead', 'TodoWrite'],
permission_mode = "bypassPermissions",
continue_conversation=True,
max_turns = 10,
),
):
messages.append(message)

print(messages)

anyio.run(main)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.