Windsurf multi-repo AI coding runs into a wall that has nothing to do with the model's reasoning and everything to do with where it can see. Consider an illustrative scenario common across engineering teams: a developer opens the web-client repo in Windsurf, asks Cascade to wire a new "saved payment methods" panel into the billing flow, and the agent ships a clean 180-line diff against the BillingService client it found indexed in that workspace.
The problem is that BillingService lives in a second repository nobody added to the workspace. Two sprints ago a different engineer renamed the methods array to instruments and split the endpoint in half. Cascade never saw that change, because Cascade's index stops at the folders currently open. The panel compiles, the unit tests pass against a mocked client, and the integration only breaks in staging when the saved cards render empty.
Nobody misused the tool. The Windsurf AI agent did exactly what a workspace-scoped agent does: it reasoned completely within the context it had, and the contract it needed lived outside that context window. This post is a practical guide to planning around that limit when one feature spans several repositories.
Key Takeaways
- Cascade's context is per-workspace. Windsurf indexes the folders you open and generates memories tied to that single workspace. A second repository the feature depends on is invisible unless you deliberately add it.
- "Add folder to workspace" is not a plan. Loading more repos into a multi-root workspace widens the index but also dilutes attention and raises cost, and it still leaves no authoritative record of the shared contract.
- The fix is a feature-level plan, not a bigger prompt. One approved specification that names the shared contract, scoped per feature rather than per repo, keeps every agent on the same contract regardless of what any single window can hold.
- Decide the contract before Cascade writes code. Who owns the cross-repo interface, and who signs off on a change to it, has to be settled upstream of the diff.
How do you handle a feature that spans multiple repos in Windsurf?
Windsurf multi-repo AI coding works when the shared contract is decided before Cascade starts, not discovered after. Cascade, the Windsurf AI agent, reasons inside one workspace index at a time, so a feature crossing repositories needs a single approved plan that names the cross-repo interface. Every repo's agent then builds against that one contract instead of guessing from a local index.
Why the context window limit bites hardest across repositories
A coding agent inside a single repository has a coherent world. The source tree, the dependency graph, the test runner, and the type definitions all sit under one root, and the agent's index covers them. Windsurf's Cascade is built around exactly this model. Its autogenerated memories are, per the Windsurf Cascade memories documentation, associated with the workspace they were created in and are not carried into another workspace. Indexing follows the same boundary: the folders you open are what Cascade can reason about.
That design is a feature inside one repo and a trap across several. The context window is finite, and the relevant truth for a cross-repo feature, the shared API contract or data transfer object (DTO, the typed shape passed between services), lives in a repository that is not open. No amount of prompting recovers information the index never ingested. This is the Windsurf-specific case of a pattern that shows up across every tool: AI coding agents in multi-repo codebases reason well locally and break at the boundary between services.
Workflow summary: Cascade reasons completely over the repositories open in its workspace, but a dependency repository left outside that index falls beyond the context window and goes unverified.
The intuitive reaction is to add the second repo and let the context window do multi-repo work for you. Windsurf supports this: it inherits the multi-root workspace model from VS Code, so you can keep several folders open at once with "Add folder to workspace." That helps, but it is not a plan, and it has real costs covered in the next section.
Add folder to workspace is a tactic, not a strategy
Opening every dependency in a single multi-root workspace does widen Cascade's index. It also introduces three problems that get worse as the feature grows:
- Attention dilutes. A larger index means more candidate files competing for a finite context window. Signal-to-noise drops, and the agent is likelier to anchor on a stale or near-miss match. This is the same context window multi-repo degradation teams report on long sessions, not a reasoning failure but an attention budget spent on the wrong tokens.
- There is still no authority. A multi-root workspace is a view, not a contract. If the
web-clientandbilling-servicedefinitions of the payload disagree, nothing in the workspace declares which one is correct. Cascade will pick the one it indexed most confidently, which is not the same as the one the team agreed on. - Scope travels with ownership. Windsurf rules are defined at each repository root and only apply when that repo is loaded, so conventions do not automatically span the set. The repos often belong to different teams, and merging their contexts in one editor does not merge the decision about who owns the interface between them. That is the cross-repo face of spec drift, and it is organizational before it is technical.
Widening the window treats a coordination problem as a retrieval problem. The retrieval gets marginally better and the coordination gap stays exactly where it was.
Decide the contract before Cascade writes code
Multi-repo work fails at the seam between repositories, so the seam is what has to be decided first. Before any agent generates a diff, settle who owns the shared contract and who approves a change to it.
| Decision | Who drafts | Who reviews | Who approves before the agent builds |
|---|---|---|---|
| The shared API contract / DTO shape | Service owner of the producing repo | Consuming repo's tech lead | Both repo owners, jointly |
| Which repos the feature touches | Feature author (PM or tech lead) | Platform or architecture | Feature author |
| Breaking vs additive change | Producing-repo engineer | Consuming-repo engineer | Producing-repo owner |
| Rollout order across repos | Release owner | Both tech leads | Release owner |
The point of the table is not bureaucracy. It is that each of these questions has a wrong answer a workspace-scoped agent will cheerfully pick on your behalf if nobody decided first. Settling them produces a short, authoritative record: the feature-level plan every repo's Cascade session then builds against.
A step-by-step sequence for Windsurf multi-repo AI coding
This is the sequence we recommend when a feature in Windsurf crosses repository boundaries.
- Name every repository the feature touches, before opening the editor. List the producing and consuming repos and the one interface that binds them. If you cannot name the shared contract in a sentence, that is the first thing to resolve, not the first thing to delegate.
- Author one specification per feature, not one per repo. The spec states the shared payload shape, the producing endpoint, and the consuming client in a single place. Per-repo notes drift independently; a single feature spec cannot contradict itself.
- Get the contract approved by both repo owners. The approval is the moment the ambiguity is removed. A spec that multiple agents can read identically is only safe once the humans who own both sides have signed off on the interface.
- Load Cascade with the approved contract, not the whole monorepo. Open the service directory you are changing plus the approved spec, rather than an entire multi-root tree. Give the Windsurf AI agent the decided contract as the source of truth so the finite context window is spent on the relevant repo, not on indexing everything adjacent to it.
- Run cross-repo impact analysis before the change, not after staging. Identify every downstream caller of the interface across connected repositories up front, so a rename in the producing repo is applied to consumers in the same change instead of surfacing as an empty render two environments later.
- Keep the plan as the system of record as agents build. Serve the frozen, approved spec to each agent over the Model Context Protocol (MCP), the open standard for feeding tools structured context, so Cascade and any other agent read the identical contract and report status back to one plan.
This is the same discipline that holds the broader agentic SDLC together: the plan, not the editor window, is where cross-service truth lives. Enact builds that plan from your actual codebase across every connected repo, grounds it in the live structure of each service, and serves the approved version to whichever agent you run.
Failure modes when the plan is missing
| What the agent does | What the spec must mandate instead |
|---|---|
| Builds against the contract it indexed locally | The single approved contract, named before coding |
| Treats an un-opened repo's schema as unchanged | The current shape, verified across every affected repo |
| Marks a per-repo ticket done in isolation | End-to-end feature ownership tied to one plan |
| Picks the most confident match when repos disagree | The authoritative definition both owners approved |
| Renames a field and stops at the repo edge | A blast-radius list of downstream callers to update together |
Copy-paste checklist for a cross-repo feature
Use this before you hand a multi-repo feature to Cascade:
- Every repository the feature touches is named, and the shared interface is written in one sentence.
- A single feature-level specification exists, not one note per repo.
- The shared contract or DTO shape is approved by the owners of both the producing and consuming repos.
- Cascade is loaded with the approved spec and the specific service directory, not an undifferentiated multi-root tree.
- Cross-repo impact analysis has listed every downstream caller of the changed interface.
- The approved plan is the record agents build against, and status flows back to it as each repo's work lands.
Teams can estimate what the un-planned version of this costs, in staging failures and rework cycles, with the rework ROI calculator.
Conclusion
Windsurf's Cascade is a strong agent inside the boundary it was built for: one indexed workspace. Multi-repo features live outside that boundary, and no context window is wide enough to make a coordination decision nobody made. The durable fix is not a larger prompt or a busier workspace. It is deciding the shared contract first, writing it down once per feature, approving it with the owners of every repo it touches, and serving that one plan to Cascade and every other agent. Plan around the context limit, and the limit stops deciding your architecture for you.
One approved plan. Every repo your agents touch.
See how Enact grounds a feature plan in each connected repository, gets both owners to approve the shared contract, and serves it to Windsurf and any other agent over MCP.
Watch the demo →