Unclear It is not confirmed that Claude Code reads the folders from the initialize request, so whether they still take effect with this option is unclear.
What
The SDK is the kit for building your own apps on top of Claude Code. An app can give Claude Code extra working folders, which it normally passes as --add-dir arguments on the command line it uses to start Claude Code.
A new SDK option, additionalDirectoriesViaInitialize, changes how this works:
- The
--add-dirarguments are left off the command line. - The folders are sent as
additionalDirectoriesin the initialize request, the first message the SDK sends to Claude Code once it has started. - Claude Code is told at startup to expect that initialize request.
Why
Apps built on the SDK can keep their list of folders off the command line used to start Claude Code.
Names in the bundle--add-dir
--add-dir
CLI reference modified, medium confidence
| `--bare` | Minimal mode: skip auto-discovery of your hooks and of skills, custom commands, subagents, MCP servers, auto memory, and CLAUDE.md so scripted calls start faster. Skills in a directory you pass with `--add-dir` still load. Cla…see the edit
--add-dir
Glossary modified, medium confidence
With `--bare`, Claude Code starts without your hooks, skills, custom commands, subagents, MCP servers, auto memory, or CLAUDE.md, apart from skills in a directory you pass with `--add-dir`. Recommended for CI and scripted calls.see the edit
Something disagreesSomething we can check disagrees with this entry, or the writer said they could not settle it.
The writer flagged doubt
It is not confirmed that Claude Code reads the folders from the initialize request, so whether they still take effect with this option is…
Anthropic's documentation agrees
--add-dir on CLI reference
Anthropic's release notes agree
Changed answering No at the startup --add-dir trust prompt to start the session without that directory in most cases instead of exiting; Esc…