Fighting with multi-repo projects
retained text
I'm sure I'm not the only person who's projects are all multi-repo. Claude code by default trips over this. My user-level [CLAUDE.md](http://CLAUDE.md) now explains this to the assistant as follow: The project dir is an umbrella project that .gitignores the real code, with each sub-component having a checkout in a directory under the umbrella project dir. The umbrella git repo itself includes PRDs, project design, notes, scratch, and scripts that covers all of the repos for sub components. The per-project [CLAUDE.md](http://CLAUDE.md) (in the umbrella project dir) includes a list of the sub-dirs that are the actual source repos for components, and further detail about what is in the repo. Further I have hooks - claude is not allowed to run git commands, it is only allowed to run git-\* commands. These are described in my user level [CLAUDE.md](http://CLAUDE.md) with a set of rules (never force push, never chain certain commands, etc etc etc) as well as never to change the main checkout and always use worktrees. Every time claude tries to run a bare git command, it forgot the rules, and the session shows that it tried to do something, eg chaining commands I don't allow to be chained. It then recovers by reaching for the git-\* commands and applies the rules correct. Claude doesn't expect git repos to be in the sub-directories without a lot of "guardrails". It took a lot of work to get claude to work well in this situation. It seems like claude's training is based on the assumption that a project will only ever have a single repo. Has anybody else experienced this? Any words from the wise? Edit: I have been building the [CLAUDE.md](http://CLAUDE.md) rules and hooks over months, and it has improved it tremendously. Recently I tried something on a different computer without my regular [CLAUDE.md](http://CLAUDE.md) and the experience reminded me why I have those rules - so what I'm getting at is that Claude's default is to assume a single repo per project with the project rooted at the repo checkout top. Making Claude understand this requires work via [CLAUDE.md](http://CLAUDE.md) and hooks
document fetched 2026-11-19 00:41 · canonical https://reddit.com/r/ClaudeCode/comments/1xz7v83/fighting_with_multirepo_projects