Building Large Projects with Claude Code - A multi-phase implementation approach
From the publisher’s feed, collected in the ZeroLabs newsroom.
The Real Problem: Implementation of Large Projects Strain Single-Agent SessionsA full-stack SaaS, a monolith legacy application, or a microservices backend with dozens of independently deployable services can span hundreds of files and decisions. During implementation phase, as a agent session grows, earlier context gets crowded out by new conversation. The agent may start contradicting architecture decisions it made 2 hours earlier, re-implementing functions that already exist, or losing track of interfaces it correctly defined at the start.Multi-phase implementation approach structures a large, complex problem into smaller, independently solvable units.What the Multiphase-Plan Pattern IsThe idea is simple; split the entire project into multiple phases which can be taken up by dedicated agents.A single shared document MASTER_PLAN.md is built in planning phase before any implementation beginsA Planner Agent designs the full project upfront: all phases, file ownerships, contracts, and cross-cutting dependenciesThe Planner Agent deliberately splits work into phases sized for independent execution, each phase is a self-contained unit of work with clear boundaries, owning specific files and producing specific outputs, so any agent or subagent can pick it up without needing broader project context.You are the Planner Agent. Decompose this project into phases whereeach phase can be executed by an independent agent with no knowledgeof other phases beyond what MASTER_PLAN.md states. No phase shouldrequire a direct conversation with another phase's agent.Every subsequent agent reads the same source of truth MASTER_PLAN.md; no agent depends on another agent’s runtime output.The plan explicitly defines dependencies between phases. Each phase entry lists which phases must be DONE before it can start, so no agent begins work on a broken or incomplete foundation.MASTER_PLAN.md: The Blueprint Every Agent ReadsIt’s a construction contract written once, referenced throughout and updated only to log deviations or blocked states.Each entry in the Phase Registry follows this template:### PHASE-2: Data Layer- **Status**: [ ] NOT_STARTED- **Scope**: Implement all DB models, migrations, repository interfaces- **Inputs**: Global Contracts → schema section- **Outputs**: /src/db/**, /src/repositories/**- **Must NOT do**: Touch /src/api/** or /src/services/**- **Completion check**: All repository unit tests passThe Multiphase Plan ArchitechturePhase 0 — Planner/Architect AgentThe only phase where design happens. No production code is written here.You are the Planner Agent for a multi-phase Claude Code build.Your ONLY deliverable is MASTER_PLAN.md. Do not write production code.Project brief: [your project description]Your job:1. Analyze the full scope of this project2. Design the complete module and file structure3. Define ALL shared contracts (types, interfaces, schemas) in the Global Contracts section — these are frozen after this phase4. Decompose the work into phases where each phase is: - Independent: executable without reading another agent's output - Bounded: owns specific files, does not touch others' files - Verifiable: has an explicit completion check (a test or build command)5. For parallel phases, confirm their file scopes do not overlap6. Write the Phase Registry with one entry per phase7. Leave the Issue Log and Deviation Register emptyThe plan must be complete enough that any agent reading onlyMASTER_PLAN.md and their own phase entry can execute withoutasking questions. Write MASTER_PLAN.md and nothing else.The Planner Agent produces overall design, plan and most importantly the Phase Registry. Everything downstream depends on these. Run it in isolation and review the output carefully before proceeding.Phase 1 — Foundation AgentBuilds the skeleton. Interfaces and stubs, no business logic. Can be run in dedicatated agent or subagent.Start with something like blow.Read MASTER_PLAN.md in full.Locate the PHASE-1 entry. Read the Global Contracts section —do not modify it.Check the Issue Log for any entries referencing PHASE-1.Your job: scaffold the project. Create all files listed in yourOutputs. Implement all interfaces as stubs. Wire all imports.Do not implement business logic.Write one passing test per module confirming the structure compiles.On completion:- Set your phase Status to DONE- Run your completion check before marking done- If you deviated from the plan, log it in the Deviation Register before changing your implementationOr SimplyImplement Phase1 as per instructions in MASTER_PLAN.mdThe goal is a codebase that runs but does nothing yet. Every function exists. Every import resolves. Every test passes against a stub. Later agents can work in their files without accidentally breaking each other’s dependencies.Phase 2–N — Feature AgentsThis is where implementation happens, and where scoping matters most. Each Feature Agent gets one slice of the codebase. One handles auth. Another handles billing. Another handles data ingestion. Each reads MASTER_PLAN.md directly.Read MASTER_PLAN.md in full.Locate the PHASE-2 entry. Read the Global Contracts section —do not modify it.Check the Issue Log for entries referencing PHASE-2.If a previous agent logged an issue affecting your scope,adjust your implementation and note it in your own log entry.Implement full business logic, error handling, and tests forthe files listed in your Outputs only.Do not modify files owned by other phases.If you discover the plan is wrong:- Log it in the Deviation Register before changing anything- Note which downstream phases may be affected- Then implement the best available solutionOn completion, set Status to DONE if your completion check passes.If blocked, set Status to BLOCKED and write a detailed Issue Logentry: what the issue is, what you tried, which phases are impacted.Note: Based on your project use case, you can run Feature Agents in parallel.Final Phase — Integration AgentReads MASTER_PLAN.md, especially the Issue Log and Deviation Register and then wires everything together.Read MASTER_PLAN.md completely.Read every entry in the Issue Log and Deviation Register.Build a list of unresolved cross-phase conflicts: type mismatches,missing interfaces, contract violations.Resolve each conflict. For each fix, note which phase's file youmodified and why.Run the full test suite. For each failure, trace it to eithera bad assumption in the plan or a deviation by a feature agent.Fix the code, not the test.When the full suite passes:- Update all phase statuses to DONE- Write a final summary at the top of MASTER_PLAN.mdWhen Something Goes Wrong Mid-BuildSay PHASE-2 hits a blocker and sets its status to [!] BLOCKED. Agents scheduled to run after it need to know before they start. The recovery prompt:Read MASTER_PLAN.md.Locate all entries in the Issue Log and Deviation Registerwhere severity is "block".For each blocking issue:1. Assess whether it affects your phase's inputs2. If it does, propose a minimum amendment to the affected Global Contract or Phase entry in MASTER_PLAN.md3. Do NOT implement until the plan is updated and you confirm the amendment is consistent with all other phasesIf the issue does not affect your phase, proceed normally andnote in your Issue Log that you reviewed the block anddetermined it is out of scope.The key discipline: agents don’t silently work around problems. They log before they deviate. The Deviation Register becomes an honest record of where reality diverged from the plan which makes the Integration Agent’s job much cleaner.How This Relates to Claude Code’s Native Multi-Agent FeatureIf you’ve used Claude Code’s built-in Agent Teams, the master plan pattern might look like it solves the same problem. The distinction is worth being precise about.Claude Code’s native multi-agent feature runs agents as subagents within a live parent session. The parent orchestrator spins up subagents, delegates tasks to them, receives their outputs, and coordinates the overall flow — all within a single running session. State is held in the parent’s active context.The multiphase pattern is cross-session and disk-mediated. No parent session holds the thread. There is no orchestrator running at coordination time. State lives in MASTER_PLAN.md on disk. Each phase starts completely cold, reads the file, executes its scope, writes back its status, and exits. The plan itself is the coordinator.What’s Your Approach?Like any other versatile tool you can achieve your goal in multiple ways with Claude code. Multi-phase implemenation is just one pattern.I’d love to hear what’s working for you. Let me know how you tackle your large implementation projects.Building Large Projects with Claude Code - A multi-phase implementation approach was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.