[BUG] Missing --add-dir option in Claude Code SDK (exists in CLI but not SDK)

Resolved 💬 3 comments Opened Jul 29, 2025 by amit-hanoch Closed Aug 15, 2025

Environment

  • Platform (select one):

N/A

  • Claude CLI version: 1.0.61
  • Operating System: macOS
  • Terminal: iTerm2

Bug Description

When using the ClaudeCodeSDK for typescript I'm sending some of those options to the "query" function
<img width="557" height="470" alt="Image" src="https://github.com/user-attachments/assets/cebbddae-08c1-41c7-8cfa-83494495aa65" />

I want to add --add-dir option but that ability is missing from the SDK (but available in the CLI)

I found the CLI wrapper and found that a simple addition to args would resolve this
<img width="959" height="999" alt="Image" src="https://github.com/user-attachments/assets/a6737e1c-6230-4102-b5b3-43a51f8acccc" />
<img width="933" height="460" alt="Image" src="https://github.com/user-attachments/assets/494733a4-eb50-4a10-95e4-3bc454119c00" />

Steps to Reproduce

  1. Run any command with ClaudeSDK from typescript
  2. try to add the --add-dir option and see it can't be done

Expected Behavior

Add the new option that gets a string[] and will append the option to ClaudeCodeCLI

Actual Behavior

Passes down partial options from what is supported in ClaudeCodeCLI

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗