Claude Corner
Claude Code Can't See the Shared Library Next to Your Repo? Add the Folder With /add-dir.
By Steven Sorensen ยท 11 Nov 2026

At a glance
- Give Claude Code a second folder with
--add-dirat launch or/add-dirin a running session. - With either of those, the folder's skills, commands and subagents load, but its
CLAUDE.mdand hooks do not. - Save the folder in
permissions.additionalDirectorieswhen you need it every day. That key grants file access only.
Your app lives in one repo and the shared library it calls sits next to it. Claude can see only the folder you launched in, so add the library as a second working directory. This is not Copilot CLI's own /add-dir, which we covered in Copilot CLI /add-dir and sandbox policy.
Why it matters
The permissions docs list three ways to extend access: --add-dir at startup, /add-dir during a session, and additionalDirectories in settings. Files in an added folder follow your project's permission rules, so reads need no prompt and edits follow your permission mode. Additional directories grant file access, not configuration.
How to add a second folder to Claude Code
We built these steps from Anthropic's docs and have not run them in a live session.
- Run
claude --version. Prefixed skill names in step 5 need v2.1.309 or later. At about 6:02 AM ET Wednesday, npmstablewas v2.1.311. - For one session, start from your project with
claude --add-dir ../shared-lib. The CLI reference example can pass two folders at once. - Type
/add-dirand a partial path, then press Tab to accept a suggestion. If Claude is still responding, the commands page says you confirm the folder right away, after which Claude's next tool call in the same turn can reach it. - Know what loaded. The docs say the added folder's skills, commands and subagents load, but from its settings only
enabledPluginsandextraKnownMarketplacesapply. ItsCLAUDE.mdloads only with an environment variable the memory docs describe. Hooks load from your current working directory, not from the added folder. Our habit, not a documented rule: ask Claude to read the library'sCLAUDE.mdbefore it edits there. - If both folders have a
verifyskill, the skills docs say/verifyruns your project's copy and the added folder's copy runs under its folder name, as/shared-lib:verify. - To keep the folder every session, add it to
permissions.additionalDirectories. That key grants file access only and loads no skills. Run the script from the repo root and add.claude/settings.local.jsonto.gitignore. The script writes that file only if it is missing. Otherwise add the key by hand. Shared.claude/settings.jsonwaits for the workspace trust dialog..claude/settings.local.jsonapplies without it unless git tracks that file or.claudeis a symlink.
# We have not run this script end to end on every platform.
# Writes .claude/settings.local.json only if missing. Will not overwrite an existing settings file.
claude --version
mkdir -p .claude
if [ ! -e .claude/settings.local.json ]; then
cat > .claude/settings.local.json <<'JSON'
{
"permissions": {
"additionalDirectories": ["../shared-lib/"]
}
}
JSON
else
echo "settings.local.json already exists. Add additionalDirectories by hand."
fi
# Optional one session start, left commented:
# claude --add-dir ../shared-lib
Gotchas
- Most network shares are refused. On Windows, map the share to a drive letter and pass it with
--add-dirat launch. - Adding is not moving.
/cdmoves the session to a new primary folder and applies its settings and hooks./add-dirkeeps your project as home. - Only skills live reload. Restart after you change the added folder's commands or agents.
Sources:
- Permissions, Claude Code docs
- CLI reference, Claude Code docs
- Commands, Claude Code docs
- Skills, Claude Code docs
- Settings reference, Claude Code docs
- Memory, Claude Code docs
- Copilot CLI /add-dir and sandbox policy
Recommended AI prompt
Copy this paragraph into ChatGPT, Claude, Gemini, Grok, or whatever AI you use.
I use Claude Code on an app repo with a shared library in a sibling folder, and I want both in one session. Using only Anthropic's Claude Code docs, explain how the launch flag, the slash command and the additionalDirectories setting differ, which library configuration loads in each case, and a short checklist to confirm access. Ask which operating system I use before suggesting steps.