Answer: Set `cwd` to run the session in a specific directory; neither SDK has a setter for `cwd`, so to run in a different directory, start another session with that `cwd`. Status: Confirmed Entry: tool/claude-code/settings/set-working-directory-sdk Revision: 3 Digest: sha256:d929b04be0fbc529 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:39Z Last changed: 2026-11-20T12:16:23Z (Python additional directories option: — → add_dirs) Last verified: 2026-11-20T12:16:23Z Next check: 2026-11-21T12:16:23Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of setting | cwd | [1] | 2026-11-20 default behavior | your process's working directory | [1] | 2026-11-20 setter availability | Neither SDK has a setter for `cwd`. | [1] | 2026-11-20 how to change | start another session with that `cwd` | [1] | 2026-11-20 TypeScript additional directories option | additionalDirectories | [1] | 2026-11-20 Python additional directories option | add_dirs | [1] | 2026-11-20 Sources: [1] Anthropic. "Configure your agent". https://code.claude.com/docs/en/agent-sdk/configuration.md Role: primary. Accessed: 2026-11-20T12:16:23Z Quote: "Set `cwd` to run the session in a specific directory." (Supports: setting) Quote: "When you leave `cwd` unset, the session runs in your process's working directory." (Supports: default behavior) Quote: "Neither SDK has a setter for `cwd`." (Supports: setter availability) Quote: "To run in a different directory, start another session with that `cwd`." (Supports: how to change) Quote: "add paths with `additionalDirectories` (TypeScript) or `add_dirs` (Python)" (Supports: TypeScript additional directories option, Python additional directories option) Published: 2026-11-20T02:52:33Z Snapshot SHA-256: e8eaeff8e41acc725cb781af740f2c42a1e83825a7a3ebd74738d2f7136b13f5 (captured 2026-11-20T12:16:23Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:16:23Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:16:23Z Last attempt: 2026-11-20T12:16:23Z Notes and limitations: Extracted automatically from a single official source (section "Set the working directory"). Related: https://latestn.com/tool/claude-code/settings/setting-sources-precedence How do I control which settings sources the Claude Code Agent SDK loads? https://latestn.com/tool/claude-code/settings/settings-file-locations Where do I save Claude Code settings for myself, my team, or my organization? https://latestn.com/tool/claude-code/settings/settings-json-comments Can I put comments in a Claude Code settings.json file? https://latestn.com/tool/claude-code/settings/set-environment-variables How do I set environment variables for Claude Code in my shell or in a settings file? https://latestn.com/tool/claude-code/settings/set-environment-variables-sdk How do I set environment variables for a Claude Code Agent SDK session? https://latestn.com/tool/claude-code/settings/set-up-status-line How do I set up a custom status line in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-20T12:16:23Z | changed | Python additional directories option: — → add_dirs | [1] 2026-11-20T12:16:23Z | changed | TypeScript additional directories option: — → additionalDirectories | [1] 2026-11-20T12:16:23Z | changed | how to change: — → start another session with that `cwd` | [1] 2026-11-20T12:16:23Z | changed | setter availability: — → Neither SDK has a setter for `cwd`. | [1] 2026-11-20T12:16:23Z | changed | default behavior: — → your process's working directory | [1] 2026-11-20T12:16:23Z | changed | setting: — → cwd | [1] 2026-11-20T12:16:23Z | changed | How to change directory: start another session with that `cwd` → — | [1] 2026-11-20T12:16:23Z | changed | Setter availability: Neither SDK has a setter for `cwd` → — | [1] 2026-11-20T12:16:23Z | changed | Default behavior: your process's working directory → — | [1] 2026-11-20T12:16:23Z | changed | Setting: cwd → — | [1] 2026-11-17T12:20:19Z | changed | How to change directory: — → start another session with that `cwd` | [1] 2026-11-17T12:20:19Z | changed | Setter availability: — → Neither SDK has a setter for `cwd` | [1] 2026-11-17T12:20:19Z | changed | Default behavior: — → your process's working directory | [1] 2026-11-17T12:20:19Z | changed | Setting: — → cwd | [1] 2026-11-17T12:20:19Z | changed | Python additional directories option: add_dirs → — | [1] 2026-11-17T12:20:19Z | changed | TypeScript additional directories option: additionalDirectories → — | [1] 2026-11-17T12:20:19Z | changed | how to change: start another session with that `cwd` → — | [1] 2026-11-17T12:20:19Z | changed | setter availability: Neither SDK has a setter for `cwd` → — | [1] 2026-11-17T12:20:19Z | changed | default behavior: your process's working directory → — | [1] 2026-11-17T12:20:19Z | changed | setting: cwd → — | [1] 2026-11-13T03:02:39Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/settings/set-working-directory-sdk/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/settings/set-working-directory-sdk POST: https://latestn.com/dispute/tool/claude-code/settings/set-working-directory-sdk with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/settings/set-working-directory-sdk?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I change the working directory for a Claude Code Agent SDK session? Revision 3, last verified 2026-11-20T12:16:23Z. https://latestn.com/tool/claude-code/settings/set-working-directory-sdk (accessed 2026-11-21T09:54:28Z). @misc{LatestN_tool_claude_code_settings_set_working_directory_sdk_r3, title = {How do I change the working directory for a Claude Code Agent SDK session?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/settings/set-working-directory-sdk}}, note = {Revision 3; digest sha256:d929b04be0fbc529; last verified 2026-11-20T12:16:23Z; accessed 2026-11-21T09:54:28Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/settings/set-working-directory-sdk