[FEATURE] Load .claude/settings*.json and hooks from directories added via --add-dir / additionalDirectories
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)
- #44224 —
--add-dirdoesn't load skills from.claude/skills/ - #30064 / #37553 —
additionalDirectoriesdoesn't load skills - #22583 —
CLAUDE.mddoesn't load fromadditionalDirectories(though it does load via--add-dir) - #26489 — feature request for
.claude/traversal into parent directories
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.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. - 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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗