The gap
Claude Code currently loads .claude/settings.json and .claude/settings.local.json (and their configured hooks) only from the session's startup working directory. When an additional directory is brought into the session — via --add-dir, /add-dir, or permissions.additionalDirectories — its .claude/settings*.json is ignored.
Concretely: a repo-local PreToolUse hook configured in repo-X/.claude/settings.local.json will fire only when Claude Code is started from repo-X/. If the user starts Claude Code elsewhere and then asks it to do work in repo-X (whether via /add-dir or just operating on files inside that tree), the hook does not fire — so the repo's local policy (linters, title checks, commit-message checks, permission scopes, etc.) is silently bypassed.
Why it matters
Hooks are the mechanism for repo-local policy enforcement (e.g. blocking PRs with off-convention titles, running formatters, gating risky commands). For them to be useful, they need to follow the repo, not the session. Otherwise every multi-repo session silently falls back to user-global rules, and project owners can't rely on their repo-local hooks being honoured.
Related issues (already covering adjacent surface)
Settings/hooks loading is not covered by any of these.
Proposal
When a directory is added to a session (via --add-dir, /add-dir, or permissions.additionalDirectories), and that directory contains .claude/settings.json or .claude/settings.local.json, merge them into the active session config under the usual precedence rules. Hooks defined there should fire for tool calls whose effect scope is within that directory (e.g. Bash commands whose cwd is inside the added tree, Edit/Write calls targeting files inside it).
Alternatives considered
- User-global hook in
~/.claude/settings.json with a cwd / path check to no-op outside the target repo. Works, but requires the user to mentally track every repo-specific hook in one global file — doesn't compose.
- Restarting Claude Code from the target repo. Works, but breaks the common "one session, many repos" flow.
Scope note
This is intentionally narrower than "load everything" — the ask is specifically for settings*.json and hooks. Skills and CLAUDE.md are already (partially) covered by the issues above.
The gap
Claude Code currently loads
.claude/settings.jsonand.claude/settings.local.json(and their configured hooks) only from the session's startup working directory. When an additional directory is brought into the session — via--add-dir,/add-dir, orpermissions.additionalDirectories— its.claude/settings*.jsonis ignored.Concretely: a repo-local
PreToolUsehook configured inrepo-X/.claude/settings.local.jsonwill fire only when Claude Code is started fromrepo-X/. If the user starts Claude Code elsewhere and then asks it to do work inrepo-X(whether via/add-diror just operating on files inside that tree), the hook does not fire — so the repo's local policy (linters, title checks, commit-message checks, permission scopes, etc.) is silently bypassed.Why it matters
Hooks are the mechanism for repo-local policy enforcement (e.g. blocking PRs with off-convention titles, running formatters, gating risky commands). For them to be useful, they need to follow the repo, not the session. Otherwise every multi-repo session silently falls back to user-global rules, and project owners can't rely on their repo-local hooks being honoured.
Related issues (already covering adjacent surface)
--add-dirdoesn't load skills from.claude/skills/additionalDirectories, but are from--add-dir#37553 —additionalDirectoriesdoesn't load skillsCLAUDE.mddoesn't load fromadditionalDirectories(though it does load via--add-dir).claude/traversal into parent directoriesSettings/hooks loading is not covered by any of these.
Proposal
When a directory is added to a session (via
--add-dir,/add-dir, orpermissions.additionalDirectories), and that directory contains.claude/settings.jsonor.claude/settings.local.json, merge them into the active session config under the usual precedence rules. Hooks defined there should fire for tool calls whose effect scope is within that directory (e.g.Bashcommands whosecwdis inside the added tree,Edit/Writecalls targeting files inside it).Alternatives considered
~/.claude/settings.jsonwith acwd/ path check to no-op outside the target repo. Works, but requires the user to mentally track every repo-specific hook in one global file — doesn't compose.Scope note
This is intentionally narrower than "load everything" — the ask is specifically for
settings*.jsonand hooks. Skills andCLAUDE.mdare already (partially) covered by the issues above.