🧩additionalDirectories Option
Also known as add_dirs, Agent SDK extra folders, Claude Agent SDK additionalDirectories
The option that gives the agent more folders to work in.
Think of it like
It is like giving a helper the keys to two more rooms.
Example
An agent works in an app's folder but needs a shared library next to it. Adding that path lets it read and fix both.
Why it matters
Real work often spans more than one folder. This opens the ones you choose and no more.
Definition
Example code
typescript
additionalDirectories: ["../shared-lib"]Common mistake
Key takeaways
- 1More folders. Past the main one.
- 2Same as --add-dir. Passed to Claude Code.
- 3add_dirs in Python. Same list.