Skip to content

Discrete Phase Separation NEW

Problem

When AI agents attempt to simultaneously research, plan, and implement solutions, context contamination occurs. Competing priorities within a single conversation degrade output quality as the agent struggles to balance exploration, strategic thinking, and execution. This results in incomplete research, unclear plans, and suboptimal implementations.

Solution

Break development workflows into isolated phases with clean handoffs between them. Each phase runs in a separate conversation with a fresh context window, focusing exclusively on its objective:

Research Phase (Opus 4.1):

  • Deep exploration of requirements, existing code, and constraints
  • Comprehensive background investigation
  • No implementation concerns

Planning Phase (Opus 4.1):

  • Create structured implementation roadmap
  • Define clear steps and dependencies
  • No coding distractions

Implementation Phase (Sonnet 4.5):

  • Execute each plan step systematically
  • Focus purely on code quality and functionality
  • Leverage the distilled outputs from previous phases

Key principle: Pass only distilled conclusions between phases, not full conversation history. This prevents context pollution while maintaining necessary information flow.

graph LR A[Research Phase<br/>Opus 4.1] -->|Distilled Findings| B[Planning Phase<br/>Opus 4.1] B -->|Implementation Roadmap| C[Execution Phase<br/>Sonnet 4.5] style A fill:#e1f5ff style B fill:#fff4e1 style C fill:#e8f5e9

How to use it

When to apply:

  • Complex features requiring significant background research
  • Refactoring projects where understanding existing code is critical
  • New codebases where architectural decisions need careful consideration
  • Any task where mixing research and implementation degrades quality

Implementation approach:

  1. Research phase - Start fresh conversation with Opus 4.1:
  2. "Research the authentication system and document all OAuth flows"
  3. Compile findings into a structured document
  4. Close conversation

  5. Planning phase - New conversation with Opus 4.1:

  6. Provide distilled research findings (not full transcript)
  7. "Create implementation plan for adding Google OAuth support"
  8. Generate step-by-step roadmap
  9. Close conversation

  10. Execution phase - New conversation with Sonnet 4.5:

  11. Provide the implementation plan
  12. "Implement step 1: Create OAuth configuration module"
  13. Execute systematically through each step

Prerequisites:

  • Clear handoff documents between phases
  • Discipline to resist combining phases
  • Understanding of which model strengths to leverage

Trade-offs

Pros:

  • Higher quality outputs in each phase due to focused attention
  • Prevents context contamination from competing objectives
  • Leverages model-specific strengths (Opus for reasoning, Sonnet for execution)
  • Clearer mental model for complex projects
  • Easier to debug which phase introduced issues

Cons:

  • Requires more explicit phase management and handoffs
  • May feel slower for simple tasks where single-pass is sufficient
  • Requires discipline to maintain phase boundaries
  • Information loss risk if handoffs are poorly structured
  • Higher total token usage across multiple conversations

References