Summary
The Python SDK (claude-agent-sdk 0.1.48) does not support the --add-dir CLI flag via ClaudeAgentOptions. The JS SDK (0.2.76) already has an addDirectories type in its type definitions.
Use case
When running Claude agents programmatically, there's no way to pass additional directories that should be accessible to the agent and have their .claude/skills/ automatically discovered. The --add-dir flag works fine when using the CLI directly, but there's no corresponding option in ClaudeAgentOptions.
This is needed to:
- Share skills across projects by pointing to a common skills directory
- Give agents access to directories outside
cwd with automatic skill discovery
- Match the behavior available via
claude --add-dir <path>
Current behavior
# No add_dir or additional_directories field exists
options = ClaudeAgentOptions(
cwd="/path/to/workspace",
# add_dir=["/path/to/shared-skills"] # ← not available
)
Expected behavior
Something like:
options = ClaudeAgentOptions(
cwd="/path/to/workspace",
add_dir=["/path/to/shared-skills"],
)
Which would translate to claude --add-dir /path/to/shared-skills when spawning the subprocess.
Environment
- Python SDK version: 0.1.48 (latest on PyPI)
- JS SDK version: 0.2.76 (already has
addDirectories type)
- Claude CLI: supports
--add-dir <directories...>
Summary
The Python SDK (
claude-agent-sdk0.1.48) does not support the--add-dirCLI flag viaClaudeAgentOptions. The JS SDK (0.2.76) already has anaddDirectoriestype in its type definitions.Use case
When running Claude agents programmatically, there's no way to pass additional directories that should be accessible to the agent and have their
.claude/skills/automatically discovered. The--add-dirflag works fine when using the CLI directly, but there's no corresponding option inClaudeAgentOptions.This is needed to:
cwdwith automatic skill discoveryclaude --add-dir <path>Current behavior
Expected behavior
Something like:
Which would translate to
claude --add-dir /path/to/shared-skillswhen spawning the subprocess.Environment
addDirectoriestype)--add-dir <directories...>