Skip to content
BENIBIX Learn

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

This Agent SDK option lets the agent reach folders outside its working folder. You give it a list of paths, and the SDK passes each one to Claude Code as --add-dir. The agent can then read and edit files in those folders too. With project settings loaded, it also picks up the skills, commands and subagents kept there. In Python the option is called add_dirs.

Example code

typescript
additionalDirectories: ["../shared-lib"]
Let the agent reach one more folder.
Each added folder is one more place the agent can read and change.

Common mistake

Adding a whole home folder. Each folder you add is one more place the agent can change.

Key takeaways

  1. 1
    More folders. Past the main one.
  2. 2
    Same as --add-dir. Passed to Claude Code.
  3. 3
    add_dirs in Python. Same list.