[BUG] CLAUDE.md not loaded when modifying files in a different repo via absolute paths
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When a session is rooted in repo A and modifies files in repo B via absolute paths, CLAUDE.md in repo B is never loaded or consulted. The model has no mechanism to detect it crossed a repo boundary and should check for new rule files.
This came up when working in a project worktree and modifying files in a separate plugin repo via absolute paths. The plugin repo has a CLAUDE.md with explicit instructions for registering new components in manifest files and updating documentation. None of those rules were followed because the CLAUDE.md was never loaded — the gap was only discovered after committing.
This is especially common with plugin development, where the plugin repo lives outside the main project directory.
What Should Happen?
When Claude modifies files in a directory that belongs to a different git repo, it should detect the repo boundary and load any CLAUDE.md files in that repo's root (and in the directories of the changed files). At minimum, the model should be prompted to check for rule files when it detects a .git directory in the path hierarchy that differs from the session's root.
Steps to Reproduce
- Have two repos, each with their own CLAUDE.md:
- Repo A at
/path/to/repo-a/withCLAUDE.mdsaying "always run tests before committing" - Repo B at
/path/to/repo-b/withCLAUDE.mdsaying "update manifest.json when adding files"
- Start a Claude Code session in repo A
- Ask Claude to create a new file in repo B using an absolute path: "copy
./my-file.mdto/path/to/repo-b/files/my-file.mdand commit it" - Claude will create the file and commit without following repo B's CLAUDE.md rules (e.g., won't update manifest.json)
- Repo B's CLAUDE.md was never loaded into the conversation context
Claude Model
Opus
Is this a regression?
I don't know
Claude Code Version
1.0.33
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Terminal is Ghostty (not in dropdown). This edge case is particularly common when developing Claude Code plugins, since plugin repos typically live outside the main project directory (e.g., in ~/.claude/plugins/).
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗