settings.json should traverse up to git root like CLAUDE.md does
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When working in a monorepo with nested service directories, there's inconsistent behavior in how Claude Code discovers configuration files:
- CLAUDE.md: Traverses up the directory tree from cwd to the git repository root, loading all matching files along the way ✓
- settings.json: Only looks in
{cwd}/.claude/settings.json, does NOT traverse up to git root ❌
This is problematic because I want to define shared hooks and settings at the monorepo root that apply to all services, but when I work from nested service directories (which is the common workflow), the settings aren't loaded.
Proposed Solution
settings.json should be discovered by traversing up to the git root, similar to how CLAUDE.md files are discovered.
When working in /my-monorepo/services/my-service/client/, Claude Code should:
- Look for
.claude/settings.jsonin the current directory - If not found, traverse up:
../,../../, etc. - Stop at the git repository root
- Load the first
settings.jsonfound (or merge all found, similar to CLAUDE.md behavior)
This would allow monorepo maintainers to define project-wide hooks/settings once at the repo root.
Alternative Solutions
Currently the workarounds are:
- Duplicate
.claude/settings.jsonin every service directory (maintenance nightmare, prone to drift) - Always start Claude Code from the repo root (inconvenient, forces unnatural workflow)
- Use
~/.claude/settings.json(too global, applies to all projects, can't have project-specific settings) - Symlinks (fragile, doesn't work well across different systems/OS)
None of these are ideal compared to having proper directory traversal like CLAUDE.md.
Priority
High - Significant impact on productivity
This affects every session in a monorepo where you work from nested directories, requiring manual workarounds or degraded functionality.
Feature Category
Configuration and settings
Use Case Example
Example scenario in a typical monorepo:
/redox-services/ # git root
├── .claude/
│ ├── settings.json # PostToolUse hooks for prettier/eslint
│ └── CLAUDE.md # Project docs
├── services/
│ ├── customer-dashboard-ui/
│ │ └── client/ # I work here 90% of the time
│ ├── api-gateway/
│ └── auth-service/
└── libraries/
└── shared-utils/
Current behavior:
- I navigate to
/redox-services/services/customer-dashboard-ui/client(my usual working directory) - I start Claude Code:
claude - Claude loads
CLAUDE.mdfrom repo root ✓ - Claude does NOT load
settings.jsonfrom repo root ❌ - My PostToolUse hooks don't run when editing files
- I have to manually run prettier/eslint after every edit
Desired behavior:
- Same starting point:
/redox-services/services/customer-dashboard-ui/client - Start Claude Code:
claude - Claude loads both
CLAUDE.mdANDsettings.jsonfrom repo root ✓ - PostToolUse hooks run automatically on every edit ✓
- Consistent developer experience across the entire monorepo
Additional Context
This inconsistency between CLAUDE.md and settings.json discovery creates a confusing developer experience. If CLAUDE.md can traverse up to git root, settings.json should follow the same pattern for consistency and to enable the monorepo use case.
Many modern development tools (ESLint, Prettier, TypeScript, etc.) traverse up to find configuration files, so this pattern is familiar to developers.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗