Multiple AI agents across ~22 GitHub repos: how do you keep structure and avoid collisions?
retained text
**Setup**
Self-hosted homelab plus side projects, ~22 GitHub repos. I work with several AI agents: Claude, Codex, and a self-hosted agent (Hermes).
**Two problems**
1. **No index.** Every new AI session has to dig through scattered docs to find out what's current, what's archived and which rules apply. That burns a lot of tokens before any real work starts.
2. **Collisions.** When two agents touch the same repo at the same time, files get overwritten and working trees end up dirty.
**What I plan to build (nothing implemented yet)**
- **One root index** (`llms.txt` style) in a central repo: every repo with a one-line purpose and a status (active / archived / concept).
- **One `INDEX.md` per repo:** what's current, what's historical, where the local rules live.
- **Git worktrees per agent**, plus a single committer so merges are serialized.
- **A small "company" per project:** a lead (splits the task, writes no code), a coder (works in its own worktree until tests pass) and a reviewer (a different model than the coder). "Done" means green tests, not just the agent saying so.
- **Up to 5 projects in parallel,** each with its own company, repo and worktree.
- **Infra, secrets and network changes** stay human-only.
**Questions**
1. Is a flat multi-repo setup with a good index enough at this size, or does something like GitLab with subgroups actually pay off?
2. How do you stop different AI tools (Claude, Codex, self-hosted) from colliding on the same codebase in practice? Is worktrees plus single-committer enough?
3. Has anyone run a lead/coder/reviewer setup in production, not just as a demo? What broke first?
4. Any pitfalls keeping an `llms.txt`-style index in sync with docs that change every few days?
I'm trying to avoid over-engineering, so pushback is welcome ("you don't need X, just do Y").
*Disclosure: I drafted this post with AI help.*document fetched 2026-10-20 00:23 · canonical https://reddit.com/r/ClaudeAI/comments/1x9ti52/multiple_ai_agents_across_22_github_repos_how_do