Feature request: claude agents @<repo> mention should include git submodules registered in .gitmodules
Summary
When running claude agents from inside a monorepo that uses git submodules, the @<repo> mention picker can't see the submodule repos. The doc defines the picker's enumeration source as "a repository under the directory you opened agent view from" — but in a submodule-organized monorepo, the things I want to target as sessions live one or two levels deeper under organizing parent directories, each a real, independent git repo.
So the workflow Claude Code's agent view is built around (parallel sessions in sibling repos) is silently unavailable to anyone using a submodule monorepo structure — and there is no native way to even reach those repos from agent view.
My actual structure
~/ghost ← monorepo root (where I run `claude agents`)
├── .claude/
├── .git
├── .gitmodules ← registers every submodule below
├── CLAUDE.md
├── lab-videos/
│
├── forks/ ← submodule parent #1
│ ├── CLAUDE.md
│ └── openscreen/ ← submodule (separate repo, own .git, own remote)
│
├── nfrith-repos/ ← submodule parent #2
│ ├── CLAUDE.md
│ ├── als/ ← submodule
│ ├── als-stable/ ← submodule
│ └── test-marketplace/ ← submodule
│
└── repos/ ← submodule parent #3
├── CLAUDE.md
├── arp/ ← submodule
└── kyberbot/ ← submodule
forks/, nfrith-repos/, and repos/ are organizing dirs that group submodules by purpose. Each */ underneath is a real submodule — own .git, own history, own remote — and all of them are registered in ~/ghost/.gitmodules.
The friction
Running claude agents from ~/ghost:
- The
@<repo>mention picker only enumerates direct children of~/ghostthat look like repos. That returnslab-videos/etc. but does not returnals/,openscreen/,arp/,kyberbot/, or any other submodule. - I dispatch work into these submodules all the time. They are the primary unit of work for me. Claude Code's whole agent-view UX (parallel sessions, per-repo dispatch) is exactly what I need for these — but the picker can't see them.
- The workarounds are all bad:
- Open
claude agentsfrom one level deeper (e.g. from~/ghost/nfrith-repos/) → loses access to siblings inforks/andrepos/, and loses access to the monorepo root itself --add-dirthe parent dirs → does not extend the@<repo>mention pool (and per the bug I filed in #61431, the second--add-diris silently dropped anyway)- Move every repo out of the monorepo → defeats the entire reason I use submodules
Ask
Make claude agents submodule-aware. When agent view is opened from a directory that has a .gitmodules, enumerate the registered submodules as additional @<repo> mention targets.
Concretely, when run from ~/ghost, the picker should surface:
@lab-videos(existing — direct child repo, today)@forks/openscreen(new — submodule, registered in.gitmodules)@nfrith-repos/als(new — submodule)@nfrith-repos/als-stable(new — submodule)@nfrith-repos/test-marketplace(new — submodule)@repos/arp(new — submodule)@repos/kyberbot(new — submodule)
The mention syntax can be @<path-relative-to-monorepo-root> (showing the organizing structure, e.g. @nfrith-repos/als) or just the leaf name (@als) if the leaf is unambiguous — match whatever fits the rest of the picker's conventions.
Reading .gitmodules is cheap (git submodule status --recursive is the canonical command) and has zero false positives — submodules are explicitly declared. This is the right enumeration source for monorepo-shaped projects.
Why this matters
Submodules are not a niche pattern — they're the standard way to organize a monorepo of independent repos that need to be versioned together. The current agent view design implicitly assumes a flat sibling-repo layout, which means anyone using submodules (probably a large chunk of multi-repo users) is locked out of the agent view's core workflow.
The feature also dovetails with the worktree-first workflow Claude Code is already pushing: a session dispatched into @nfrith-repos/als should still get its own worktree under .claude/worktrees/, just rooted at the submodule's directory. The submodule's own .git and the host repo's .git already coexist cleanly with worktrees, so no new isolation mechanics are needed.
Related
- Bug: claude agents silently drops the second --add-dir (#61431) — the obvious workaround (
--add-dir each parent) is broken AND, even if fixed, doesn't extend the mention pool. This issue is the clean fix. - Feature request: fuzzy match in @<repo> mention picker (#61407) — adjacent: once the submodule pool is enumerated, fuzzy match becomes even more valuable (more entries to navigate).
Thanks!
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗