Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Running a Multi-Repo Product with Parallel AI Agents (Claude Code)

说明与用途

实现了一个系统,单一工作区管理七个独立仓库,每个仓库都有自己的 Claude Code 代理,在隔离的 git 工作树中运行。钩子和 contracts/ 文件夹确保更改保持在各自仓库内,实现安全的并行任务执行。

问题

Managing multiple independent repositories in a single workspace while ensuring isolated AI agent work, preventing cross-repo contamination, and executing parallel tasks without interference.

结果

The workflow enables safe, parallel AI-driven development across seven independent repositories, preventing accidental cross‑repo commits, ensuring consistent rules, and automating PR creation and auditing.

工作流

  • Create a small workspace root repo with an allowlist .gitignore and clone-all.sh
  • Add a concise CLAUDE.md to each repo describing purpose, stack, commands, and a pointer to root rules
  • Create a root CLAUDE.md mapping all repos, connections, routing rule, git workflow, and parallel rules
  • Define one agent type per repo in .claude/agents/, each agent runs in its own git worktree
  • Implement a read‑only test auditor that checks coverage and edge cases
  • Set up contracts/ folder for cross‑repo specifications, with owner, consumers, status, and shape
  • Add hooks: PreToolUse repo guard, .env guard, PostToolUse formatter, and fast pre‑push lint/format checks
  • Run tasks: main session plans, starts agent copies per repo, builds in parallel, audits, pushes PRs, and reports results
  • Scale to multiple tasks by running agent copies in waves and managing token cost
  • Iterate lessons learned to refine hooks, formatting, and workflow constraints

证据

The workspace root is its own small git repo holding only the shared pieces: a root CLAUDE.md (map of all repos + shared rules), a contracts/ folder (the only place cross-repo changes are agreed), .claude/agents/ (one agent per repo + a read-only test auditor), .claude/hooks/ (guards that enforce the rules), and a clone-all.sh script.

来源

Each copy works in its own git worktree (_wt/backend-task-name), never in your main checkout.

来源

PreToolUse repo guard: a repo agent may edit only its own worktrees, contracts/, and its notes file.

来源

10 tasks (8 full-stack, 2 backend-only) = 18 agent copies, each isolated.

来源

  • 记录日期: 2026-10-05T08:55:58.106Z