--add-dir
A Claude Code CLI flag, read out of the shipped bundle. It has been in the build since v2.1.138, including the newest one read.
Add additional working directories for Claude to read and edit files. Grants file access; Claude Code doesn't discover most .claude/ configuration from these directories. Validates that each path exists as a directory. You can't add most network paths, such as \\server\share. To persist these directories across sessions, set permissions.additionalDirectories in settings
Anthropic's own wording. Read off CLI reference, captured 2026-09-26.
In the changelogs
27Releases whose published page names --add-dir.
-
v2.1.309
Self-hosted runners handle code review sessions more strictly
Self-hosted runners now refuse code reviews in some setups, run them without local settings, and pass their tokens outside the environment
found in this entry's text
-
v2.1.301
SDK start-up message now lists the session's permission folder and added folders
The message an SDK session sends at start-up can now include the folder permission checks start from and any added working folders
found in this entry's text
-
v2.1.295
One memory file scan now looks only at managed and user CLAUDE.md files
One of Claude Code's memory file scans no longer includes project, local or
--add-dirCLAUDE.md files, only managed and user onesfound in this entry's text
-
v2.1.292
Plugin removal hint for settings behind a link to another machine
When plugin removal cannot read settings from an --add-dir folder, the message now suggests replacing a link to another machine with a real folder
found in this entry's text, named in this entry
-
v2.1.287
Auto-update setting no longer credited to an added directory under organization policy
When an organization policy supplies the auto-update setting, Claude Code no longer says it came from an
--add-dirdirectory's settingsfound in this entry's text, named in this entry
-
v2.1.287
The
--add-dirrejection message now names the session's working directoryA directory outside the allowed area is now rejected with wording about the session's working directory instead of "cwd"
found in this entry's text, named in this entry
-
v2.1.287
Removing a reserved-name plugin marketplace entry now turns its plugins off safely
claude plugin marketplace removenow turns off affected plugins first, and plugin settings and secrets are copied when you switch pluginsfound in this entry's text
-
v2.1.287
Project settings can no longer change auto-update for the official marketplace
Auto-update for the official plugin marketplace is now read only from user,
--settingsand managed settings, not from project filesfound in this entry's text
-
v2.1.284
A project rules folder that links outside the project now needs your approval
If a project's
.claude/rulesfolder is a link to a place outside the project, its rules load only when external includes are allowed or approvedfound in this entry's text
-
v2.1.282
Managed-only permission rules now also cover skills'
allowed-toolslistsWith
allowManagedPermissionRulesOnlyon, user and project skills and commands can no longer grant themselves tools throughallowed-toolsfound in this entry's text
-
v2.1.281
Background fork argument building reworked
The command-line options for forking a session to the background, including removing --add-dir, are now built by separate helpers
found in this entry's text
-
v2.1.281
Additional working directories carried across TUI mode switch
Folders added with
--add-diror/add-dirare now kept when Claude Code restarts to switch its terminal interface modefound in this entry's text, named in this entry
-
v2.1.281
Self-restart carries additional working directories
Directories added with --add-dir now survive when Claude Code restarts itself
found in this entry's text, named in this entry
-
v2.1.281
--tmux worktree relaunch absolutizes path arguments
When --tmux relaunches Claude Code for a worktree, relative file paths in flags are now turned into full paths
found in this entry's text
-
v2.1.281
--managed-settingsis carried through to spawned sessions;--setting-sourcesis accepted and discarded by one argument parser--managed-settings is now passed on to sessions Claude Code starts itself, while one parser reads --setting-sources and throws the value away
found in this entry's text
-
v2.1.281
Git bundle upload refuses checkouts under a home directory that is itself a git checkout
Cloud-session git upload now refuses or hardens checkouts sitting under a home directory that is itself a git repository
found in this entry's text
-
v2.1.281
Background/relaunched sessions inherit session-scoped additional directories
Background and relaunched sessions now carry over extra working directories added during the session
found in this entry's text
-
v2.1.257
Working directories: network paths explicitly rejected with guidance
Adding a network path as a working directory now errors with guidance, suggesting a mapped drive letter on Windows.
found in this entry's text, named in this entry
-
v2.1.251
Marketplace names sanitized before going into headers
Marketplace names are sanitized so they cannot inject content into request headers.
found in this entry's text
-
v2.1.238
Plugin marketplaces and archives can mint HTTP headers from a command
Marketplaces and plugins can run a command to mint short-lived HTTP headers for fetching archives.
found in this entry's text
-
v2.1.234
Early flag scan no longer mistakes tool lists and directories for flags
Tool lists and directories passed to flags are no longer misread as flags themselves at startup.
named in this entry, found in this entry's text
-
v2.1.228
Relaunching Claude Code keeps your selected model
Restarting after an update keeps the model you picked instead of reverting to the default.
found in this entry's text
-
v2.1.219
register_repo_rootaccepts launch-time roots and rejects duplicatesRegistering a repo root now accepts launch-time --add-dir roots and clearly rejects duplicates or bad paths.
named in this entry, found in this entry's text
-
v2.1.219
register_repo_root accepts launch-time directories and rejects duplicates
You can register repo roots under any directory passed with --add-dir, and duplicates now say so clearly.
named in this entry, found in this entry's text
-
v2.1.140
Marketplace
autoUpdateSynced from Settingsfound in this entry's text
-
v1.0.27
Configuration Support
found in this entry's text
-
v1.0.18
Enhanced Directory Permissions
found in this entry's text
First cited
5The earliest release whose published evidence quoted --add-dir was v2.1.219, 24 Jul 2026. That is the oldest release this project wrote about it, so it is a floor on the name's age and not the release that introduced it. It is not a presence reading: which builds carried the name is the table below.
Presence across releases
1Build by build
150One row per release since the first build this name was read out of. Absent means the build was read and the name was not in it, never mined means no bundle for that release was ever archived, and a declared type or a default is only ever what that release's own bundle stated.
Read out of the published npm bundle release by release, and out of Anthropic's own documentation as this site captured it. Nothing on this page is a description anybody here wrote about what the CLI flag does. All CLI flags.