{"version":"2.1.336","anchor":"sdk-option-additionaldirectoriesviainitialize-add-dirs-sent","canonical_anchor":"sdk-option-additionaldirectoriesviainitialize-add-dirs-sent","heading":"SDK apps can pass extra working folders at startup instead of on the command line","tier":"use","area":"SDK","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336\/e\/sdk-option-additionaldirectoriesviainitialize-add-dirs-sent","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.336","markdown":"### SDK apps can pass extra working folders at startup instead of on the command line\n\nA new SDK option, `additionalDirectoriesViaInitialize`, sends extra working folders in the startup message instead of as `--add-dir` arguments\n\n**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.\n\n**What**\n\nThe 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.\n\nA new SDK option, `additionalDirectoriesViaInitialize`, changes how this works:\n\n- The `--add-dir` arguments are left off the command line.\n\n- The folders are sent as `additionalDirectories` in the initialize request, the first message the SDK sends to Claude Code once it has started.\n\n- Claude Code is told at startup to expect that initialize request.\n\n**Why**\n\nApps built on the SDK can keep their list of folders off the command line used to start Claude Code.\n\n- Area: SDK\n- Names: `--add-dir`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}