AI Coding Across Multiple Repositories for Engineering Teams

Kyle · · 24 min read
AI coding multiple repositories for engineering teams

AI coding across multiple repositories breaks when a “small” change touches a shared type, an API, and deployment config. Your assistant can make every local diff look right while quietly leaving a consumer behind.

What matters is the map: callers, contracts, ownership, and what must land first. More open folders won’t reveal the dependency that bites you after merge.

Watch for these before the first edit:

  • Shared types with consumers outside the current checkout
  • Infrastructure limits hiding behind application changes
  • PRs that need an explicit merge order

Make the whole change safe, not just the diff.

The Scenario Every Team Recognizes

A product manager asks for "one small checkout change." Add an optional field. Show it in the UI. Send it to the API. Log it for support.

Inside a single repo, that sounds easy. In the real system, it usually means a shared schema package, a backend service, a frontend app, maybe an SDK, and some deployment or environment config nobody mentioned in the ticket. The first AI draft often looks fine in the repo it can see. Then another repo breaks a day later.

That's the tension behind ai coding multiple repositories. The speed is real. The shallow understanding is real too.

You already know the situations:

  • shared types used by several services
  • frontend and backend contract changes
  • app plus infrastructure changes
  • SDK and API version updates that have to land together
  • cleanup work where nobody can prove whether an old path is still reachable

The hard question isn't "can the assistant write code?" It usually can. The question is whether it can move fast without losing the architectural awareness your senior engineers rely on by instinct.

Most multi-repo failures don't start in implementation. They start in missing context.

What AI Coding Across Multiple Repositories Actually Means

Let's pin this down clearly. AI coding multiple repositories means using AI assistants to plan, inspect, and help implement one engineering change that touches more than one Git repository.

That is different from a few nearby topics people mix together:

  • It is not the same as AI help inside one very large repo.
  • It is not the same as a monorepo workflow.
  • It is not the same as opening three folders and hoping the model connects the dots.

Multi repository development creates a different class of problem. Interfaces live in one repo and break in another. Merge order matters. Ownership changes by repo. Review paths split. Tests are fragmented. The thing that breaks you is often outside the current checkout.

Cross repository dependencies are the center of this. Not a side concern.

If a shared type changes in one repo, the blast radius sits in the consumers. If an endpoint shape changes, the backend diff may pass while the frontend is already wrong. If you update app memory settings, the real problem may be in infrastructure capacity. The hard part is not asking for code. The hard part is giving the agent a map of the system it is editing.

Why Single-Repo AI Workflows Break Down

Most coding assistants still think locally unless you add extra context. That's not a flaw in the model so much as a boundary in the setup.

We see the same failure pattern over and over. The app change looks complete. Tests in that repo pass. Then a hidden system constraint shows up somewhere else: shared contracts, infra sizing, downstream consumers, rollout sequence.

A simple example makes the point. In a cross-project workspace demo, an agent was asked to double memory requests and limits for an application while making sure suitable node capacity existed. With that infrastructure constraint made explicit, it changed both the app deployment and the infrastructure definition. When that constraint was removed from the prompt, it changed only the app side and missed the infra update.

That's the whole problem in one move.

Better models help. They do not erase hidden constraints. If the system reality isn't visible, the model will still write a neat local answer to a cross-repo problem.

The breakpoints are predictable:

  • silent API contract drift
  • missing consumer updates
  • incorrect rollout order
  • duplicated logic added in the wrong repo
  • dead code left in place because nobody can prove it is unused
  • local tests passing while the integrated change is still unsafe

Opening more repos helps with reach. It does not guarantee understanding.

Why single-repo workflows fail for AI coding multiple repositories

The Mental Model Shift: This Is a Context Problem, Not a Prompt Problem

When teams get weak results here, they often blame the prompt. Usually that's not it.

The issue is missing architecture context.

Experienced engineers do a bunch of things before they touch code, often without saying them out loud. They find callers. They trace dependencies. They look for existing patterns. They estimate blast radius. They ask what must land first. They separate active paths from dead ones.

A prompt mindset asks, "How should we phrase this better?"

A context mindset asks, "What must the agent know before it changes anything?"

That shift matters emotionally as much as technically. Teams say they want speed, but what they really want is speed without the 4:30 pm Slack thread from another team asking why their consumer just broke.

Once software reality is visible, AI starts acting less like eager autocomplete and more like a grounded collaborator. Not perfect. Still very useful.

What Good Multi-Repo AI Work Looks Like in Practice

The target state is pretty straightforward:

  • one request
  • all affected repos identified
  • one shared contract pinned
  • one plan across the stack
  • one PR per repo
  • linked delivery and review

Each repo still keeps its own branch, review path, and ownership. That's important. You do not want to flatten organizational boundaries just to make the tooling feel cleaner. But the integrated change needs one shared reason and one shared plan.

A healthy flow usually looks like this:

Recommended sequence

  1. Scope

    Understand the request.

  2. Repos

    Find the touched repos.

  3. Dependencies

    Inspect cross repository dependencies.

  4. Rollout

    Plan merge and rollout order.

  5. Changes

    Make isolated changes per repo.

  6. Checks

    Run repo-level and system-level checks.

  7. PRs

    Open coordinated PRs.

This is already happening at real scale. Teams with around 25 engineers and more than 100 repos can sustain 200 plus PRs and dozens of releases a month, but only when the agent workflow includes context, validation, and governance layers. Large engineering orgs are also reporting that AI writes most new features in some product lines. The common thread is not "bigger model." It's workflow integration.

One enterprise case puts more specific numbers behind that claim. Cisco reports that Codex wrote more than 95% of its new AI features, increased defect-resolution throughput by 10–15x using Codex CLI, and saved more than 1,500 engineering hours per month. Those are company-reported results rather than an independent benchmark, so they should not be treated as an expected outcome for every team. Still, they make the operating implication concrete: higher AI output shifts the constraint toward validation, review capacity, and safe coordination across complex codebases.

Start With the Contract Before You Start With the Code

If a change spans repos, treat it as a contract problem first.

The contract should capture a few things before implementation starts:

  • the behavior being changed
  • the source of truth repo
  • consumers and callers
  • whether the change is breaking or non-breaking
  • validation rules
  • rollout order

Take a simple checkout field addition. "Optional" sounds harmless until you spell out the contract. The shared schema has to validate it. The backend has to accept it. The response shape may need to echo it. Logging might need it. The frontend form has to collect and send it. If one of those assumptions is fuzzy, you don't have a coding task yet. You have an analysis task.

A practical pattern that works in production is boring in the best way:

Analysis

Identify repos and files touched. List open questions. Estimate complexity and confidence.

Planning

Name exact file paths, expected diffs, and test cases. If the plan cannot say where the change lives, stop there.

Implementation

Only after the contract is pinned.

Review

Humans check intent, risk, and landing order.

Most bad multi-repo AI output starts because teams skip directly to implementation. That's not ambition. That's impatience disguised as throughput.

How to Surface Cross-Repository Dependencies Before the First Edit

Before an agent writes code, it should be able to answer questions like these:

  • Who imports this type?
  • Which endpoints call this service?
  • What environment variables are shared across repos?
  • Which tests cover this path?
  • Is this code still reachable?

The dependency map should make hard questions easier:

  • What breaks if this field is renamed?
  • Which repos still call this endpoint?
  • Can this export be deleted safely?
  • Which modules duplicated the same pattern already?

This is where a knowledge graph helps. We built Pharaoh for exactly this problem. It maps repositories into a queryable graph that MCP-compatible assistants can use for architecture context across larger TypeScript, JavaScript and Python codebases. The useful output isn't "here are some files." It's callers, endpoints, env var usage, blast radius, dead code, and how repos connect.

That matters more than raw indexing.

Without a graph, changing a shared type often means guessing which consumers exist. With a graph, that guess becomes a lookup. That's a completely different operating mode.

AI coding multiple repositories with cross-repository dependencies mapped before editing

Choose the Right Working Model: Workspace, Graph, or Both

A multi-root workspace is useful when you already know which repos belong to the task. App, backend, infra - one session, one place to ask questions. Good for exploratory work. Good during incidents. Good when the operator already has a decent map in their head.

But workspaces have limits.

They don't always reveal hidden dependencies you forgot to include. They still depend on the prompt carrying the right constraints. They don't automatically answer blast radius, ownership, or dead code questions.

Graph-based context layers solve a different problem. They are stronger when the operator does not know every connection ahead of time. Shared packages, service meshes, SDK consumers, org-wide repo sprawl - this is where a graph earns its keep.

For many teams, the right answer is both:

  • use a workspace for execution
  • use a graph for discovery and impact analysis

More open repos is not the same as better context. That's an easy trap.

Working modelWhen to choose itStrongest forKey caution
WorkspaceWhen you already know which repos belong to the task, especially for exploratory work, incidents, or when the operator already has a decent map in their headExecuting questions and changes across known repos such as app, backend, and infra in one sessionIt can miss hidden dependencies, still depends on the prompt carrying the right constraints, and does not automatically answer blast radius, ownership, or dead code questions
GraphWhen you do not know every connection ahead of time, especially with shared packages, service meshes, SDK consumers, or org-wide repo sprawlDiscovery and impact analysis such as callers, endpoints, env var usage, blast radius, dead code, and how repos connectIt solves discovery and architecture-context problems; the section recommends pairing it with a workspace for execution
BothWhen the team needs to discover affected repos and risks before implementation, then make isolated repo changes and open linked PRsUse a graph for discovery and impact analysis, then use a workspace for executionDo not confuse opening more repos with having better context

The Operating Workflow That Keeps Multi-Repo Changes Safe

If you want a practical operating model, keep it tight.

1. Scope the repos involved

Start with the obvious repo. Add direct consumers, producers, and config repos. Keep adding only what the change truly needs.

2. Run impact analysis

Find imports, callers, endpoints, test gaps, and ownership boundaries. Flag uncertain areas before code is written.

3. Produce a written plan

Write exact files, expected diffs per repo, test plan, merge order, and rollback thinking.

4. Isolate changes by repo

Use one branch or worktree per repo. Don't mix cleanup into the same effort unless it is required by the contract.

5. Validate before push

Run repo-specific formatters, linters, type checks, compile steps, and unit tests as hard gates. Then run cross-repo checks where the contract matters.

6. Open linked PRs

One PR per repo. Link dependencies clearly so reviewers can see the chain.

7. Review and land in order

Shared contract first. Consumers next. Rollout last.

The governance lesson is simple. AI can draft at high speed. Humans still need to approve merges and review the higher-risk changes.

Validation Is Where Most Teams Either Gain Trust or Lose It

Most review systems catch structural problems too late. For multi repository development, that's backwards.

Validation has to cover more than normal repo checks:

  • consumer compatibility
  • merge order correctness
  • missing tests on changed paths
  • unreachable exports
  • accidental breaking changes

Confidence gates help a lot here. If the analysis phase is uncertain, stop before implementation. If the plan cannot name exact files, stop before code is written. The team should treat uncertainty as a routing signal, not a minor inconvenience.

For active repos, PR Guard fits naturally into this stage. It adds PR analysis for issues like unreachable exports, regression risk, test coverage gaps, and breaking changes. That kind of structural feedback belongs in review while the chain is still editable, not after merge.

A simple PR chain might look like this:

  • shared schema PR opens first
  • backend PR is linked and blocked on schema
  • frontend PR is linked and blocked on backend behavior

Linting and tests matter. We care about them a lot. We also know they are only part of the answer. The open source AI Code Quality Framework is useful on that side of the workflow. It does not replace architecture context.

Human Review Still Matters, but the Job Changes

In an AI-assisted multi-repo setup, human review should move up the stack.

Stop spending scarce review time on formatting noise, simple mechanical edits, and checks automation can run before a person even opens the diff. That work should be filtered out early.

Put human attention on the things that still require judgment:

  • is the contract right
  • is the landing order safe
  • was the blast radius judged correctly
  • does the change match existing patterns in each repo

Teams hit the scaling issue fast. If AI lifts throughput by even 2x to 5x, human review becomes the bottleneck unless low-level issues get filtered earlier. Then people start blaming the tool, when the real problem is review design.

The split we recommend is simple:

  • automation for repeatable structural checks
  • engineers for intent, risk, and exceptions

The goal isn't fewer engineers. It's fewer avoidable surprises.

Patterns Where AI Works Well Across Multiple Repositories

There are some cases where this approach is genuinely strong.

It works well for adding a field across schema, backend, and frontend. It works for a new endpoint plus consumer updates. It works for syncing SDK changes to an API update. It also works well for tracing whether an old endpoint or export can be removed safely.

It can help during incidents too. Cross-repo questioning is useful when an engineer needs to inspect another team's repo and find environment-specific behavior that explains why only one environment fails. We've seen that kind of work go from broad guessing to a narrower, testable path much faster.

These cases work because:

  • the contract is visible
  • affected repos are finite
  • validation criteria are concrete

And there is another good use case people underrate: learning. Multi-repo AI isn't just for writing code. It helps engineers understand unfamiliar repos, ownership boundaries, and even languages they don't work in every day.

Patterns Where Teams Should Slow Down

Some cases deserve caution.

Undocumented side effects. Unstable interfaces with many consumers. Security-sensitive rollout paths. Large refactors with no clear source of truth. Repos with weak tests and unclear ownership. These are not good places to pretend confidence.

The practical stop signal is blunt: if the agent cannot state the contract, affected repos, and validation plan clearly, the system is not ready for autonomous change.

Passing local checks inside one repo can create false confidence. That is one of the most expensive feelings in software.

In these cases, partial automation is usually smarter. Let AI handle discovery, impact analysis, draft plans, and smaller diffs. Keep the boundary decisions with engineers.

Common Mistakes in AI Coding Multiple Repositories

A few mistakes show up so often they're worth calling out directly:

  • treating the task as a bigger prompt instead of a coordination problem
  • opening more repos and assuming that alone solves dependency awareness
  • letting AI edit consumer repos before the shared contract is agreed
  • merging PRs independently without linking dependencies
  • relying only on unit tests in the changed repo
  • missing ownership rules and review boundaries
  • leaving dead code because nobody can prove reachability
  • creating new patterns when strong existing ones already exist elsewhere
  • expecting the assistant to infer operational constraints nobody exposed

Most of these are process failures, not model failures.

How to Evaluate a Multi-Repo AI Setup for Your Team

If you're evaluating a setup, ask practical questions:

  • Can it see more than one repo in one task?
  • Can it identify callers and consumers across repos?
  • Can it show blast radius before changes are made?
  • Can it support one PR per repo with linked dependencies?
  • Can it respect repo-local validation and ownership?
  • Can it help prove whether code is dead or still reachable?
  • Can it surface structural risk during PR review, not after merge?

Team maturity matters here.

Early teams can get value from workspaces plus written checklists. Growing teams usually need a graph and tighter validation. Active teams with lots of repos and lots of reviews usually need automated structural checks in PRs.

If the missing piece in Claude Code, Cursor, Codex, or another MCP client is architecture context, Pharaoh is one way to add that layer without forcing everything into a monorepo.

A Practical Starting Point for This Week

Don't start with a migration. Start with one real feature that spans two to four repos.

Write the contract first:

  • source of truth
  • consumers
  • risk points
  • rollout order

Before you ask AI to code, require answers to three questions:

  1. What repos are affected?
  2. What breaks if this changes?
  3. What has to land first?

Then add one new habit this week:

  • linked PRs
  • explicit merge order
  • impact check before implementation

If your team keeps getting surprised by hidden architecture, the next move is not longer prompts. It is adding a context layer so the assistants you already use can query how the system actually fits together.

Conclusion

AI coding multiple repositories works when teams treat architecture context, cross repository dependencies, validation, and rollout order as part of the coding workflow itself.

That is the real shift. Less prompt tuning. More system visibility.

Start with one multi-repo change. Map the dependencies before the first edit. Make the review path visible across repos. Speed is useful. Understanding is what keeps it from becoming expensive.

Article Record

ReferencesPrimary sources used for this article
  1. How We Built a System for AI Agents to Ship Real Code Across 75+ Repos [Part 1 of 2]
  2. How We Built a System for AI Agents to Ship Real Code Across 75+ Repos [Part 2 of 2]
  3. 4M + 500K Lines, Rebuilding a Giant App in 3 Weeks - Qoder
  4. Coordinate AI Coding Agents Across Repositories | DevSpecs
Update HistoryMeaningful revisions to this article
Initial publication.
← Back to blog