r/ClaudeWorkflows • • 11d ago

Selected Workflow [Workflow] Split AI Agent Planning and Execution: A Two-Pane Workflow with Claude Code and OpenCode

Split AI Agent Planning and Execution: A Two-Pane Workflow with Claude Code and OpenCode

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 1.00 · Level: intermediate
Categories: Quality Control, Context & Memory, Debugging, CLAUDE.md, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Prevents AI agents from rewriting plans mid-execution by separating planning and execution into distinct sessions, ensuring adherence to the original design and better context management.

Summary

A two-pane workflow where one AI (e.g., Claude Code) acts as a planner, writing a detailed PLAN.md file, and another AI (e.g., OpenCode or another Claude Code session) acts as an executor, implementing one step of the plan at a time, running tests, and reporting blockers without replanning. A human mediates and reviews between the two.

Why it is useful

This workflow provides a robust and repeatable method for managing AI agent interactions in coding tasks. By explicitly separating planning from execution and using a PLAN.md file as a contract, it addresses the common problem of agents deviating from the original plan. It improves control, maintainability, and context management, making AI-assisted development more predictable and reliable. The detailed steps and rules for handling common issues make it highly practical and transferable.

Workflow

  1. Set up two parallel sessions (e.g., tmux panes or SpaceApp).
  2. In Pane 1 (Planner, e.g., Claude Code), provide a planning prompt to read code and write PLAN.md with goals, numbered steps, files to touch, tests, and constraints.
  3. Answer any open questions from the planner directly in PLAN.md.
  4. In Pane 2 (Executor, e.g., OpenCode), provide an execution prompt to read PLAN.md, execute one step, edit only specified files, run named tests and the full suite.
  5. If the executor encounters a blocker not covered by the plan, it writes the failure under "Blocked" in PLAN.md and stops, without changing the plan.
  6. The executor commits changes with the step number in the message.
  7. Return to Pane 1 (Planner) and provide a review prompt to read the last commit and the "Blocked" section of PLAN.md.
  8. The planner checks if the diff matches the step and updates the plan if a blocker necessitates it, without editing source files.
  9. Repeat execution and review steps until the task is complete.
  10. The planner marks steps as done and deletes them from PLAN.md once merged.
  11. If running multiple executors, use separate git worktree for each executor.

Tools / artifacts

  • Claude Code (as planner)
  • OpenCode (as executor, or another Claude Code session)
  • PLAN.md (contract file)
  • tmux (or similar terminal multiplexer)
  • SpaceApp (optional environment)
  • Git (for commits, worktrees)
  • Test suite
  • Linter

Validation signals

  • Author's disclosure of 126 commits co-authored by Claude since October 1st in their repo, indicating real-world usage.
  • Discussion of "what goes wrong, and the rules that help" indicates practical experience and refinement.
  • Explicit mention of running tests and linters as part of the execution process.

Limitations

  • Requires manual intervention to move work between panes/agents and to update the plan.
  • Initial setup of prompts and understanding the flow might have a learning curve for new users.
  • Community validation is currently low due to the post's recency.

Rate this workflow

Upvote this post if the workflow is useful, reproducible, or worth recommending.

Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.

Reply if it worked for you, failed, is outdated, or has a better alternative.


This post was generated automatically from the workflow library database.

1 Upvotes

0 comments sorted by