Skip to content

Missing add_dir / addDirectories support in ClaudeAgentOptions #683

@volkov

Description

@volkov

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...>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions