[FEATURE REQUEST] Nested CLAUDE.md context
Nested context
Problem
Caude does not "see" the CLAUDE.md further up the file tree than the current directory. When I work with git worktrees, this means having to re-init claude in every individual worktree direcotry (i.e. it does not see project/CLAUDE.md when launching in project/branch1).
At the moment I am fixing this by cd .. before launching claude and giving instructions in the project/CLAUDE.md for it to hook into my IDE mcp, check what worktree directory I am working on, then only make changes in that directory. This is a dirty hack and it does not spark joy.
Desired solution
Claude code should scan recursively up the filetree from where it is launched, adding all encountered CLAUDE.md files to its context. This will allow for a more general "project wide" CLAUDE.md file in the root of the project, and more specific CLAUDE.md files in various other places, be that branches, monorepo apps or libs, or just features that want to provide more context. I am imagining this in a similar way to how .gitignore files work, where they are picked up recursively and only apply to the directory they exist in.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗