[FEATURE] Add option to override git root detection for monorepo/multi-project setups

Resolved 💬 2 comments Opened Feb 3, 2026 by bnguyen-lilly Closed Mar 5, 2026

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 directory that's nested inside a larger git repository, Claude Code uses the parent .git as the repo root. This causes /init to scope CLAUDE.md and context to the entire parent repo rather than the current working directory.

Proposed Solution

CLI flag: claude --git-root=. to treat CWD as repo root
CLAUDE.md directive: git-root: . or scope: current-directory
Config in settings.json: "gitRoot": "cwd"
Respect a .claude-root marker file (similar to .python-version)

Alternative Solutions

_No response_

Priority

Critical - Blocking my work

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗