mirror of
https://github.com/mikeyobrien/ralph-orchestrator.git
synced 2026-04-25 15:15:57 +03:00
[GH-ISSUE #161] [Feature]: support Claude Agent Teams in ralph plan for parallel research and design #61
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ralph-orchestrator#61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @The-Zona-Zoo on GitHub (Feb 7, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/161
Originally assigned to: @The-Zona-Zoo on GitHub.
Use case
ralph planspawns a single interactive Claude session that executes the PDD (Prompt-Driven Development) SOP sequentially -- one research topic at a time, one design perspective at a time. For complexfeatures, the research phase (Step 4) and design phase (Step 6) become bottlenecks because a single agent must serially:
Claude Code now has an experimental Agent Teams feature that allows a session to spawn parallel teammates that work independently and communicate with each other. This is a natural fit for PDD's research and design phases:
This aligns with Ralph's philosophy of "letting agents do the work" -- Agent Teams lets Claude self-organize the most effective research strategy rather than being constrained to sequential execution.
Proposed solution
Core plumbing (~20 lines across 2 files)
ralph planalready spawns Claude viaspawn_interactive()usingstd::process::Command. The integration requires:ralph plan --teams "Build a rate limiter"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1on the spawned process when--teamsis passedTaskCreate,TaskUpdate,TaskList,TaskGetfrom--disallowedToolswhen teams are enabled (Agent Teams uses these internally for coordination)SOP handling: separate team-aware variant
The PDD SOP content must differ based on whether teams are enabled. If the base
pdd.mdmentions teams when they're not available, the agent gets confused. If it doesn't mention teams when they are available, it won't leverage them.Approach: Duplicate the SOP into
pdd.md(current, unchanged) andpdd-teams.md(team-aware variant). The SOP runner selects which to use based on the--teamsflag.The team-aware variant would modify specific PDD steps:
Files affected
crates/ralph-cli/src/main.rs--teamstoPlanArgs, thread toSopRunConfigcrates/ralph-cli/src/sop_runner.rsagent_teamsflag, select SOP variant, inject env var inspawn_interactive(), conditionally adjust--disallowedToolscrates/ralph-cli/sops/pdd-teams.mdArea
CLI
Backend(s) impacted
claude
Alternatives considered
1. Conditional prompt assembly (no SOP duplication)
Keep a single
pdd.mdand havebuild_prompt()conditionally append a<teams-guidance>section to the prompt only when--teamsis passed. This avoids maintaining two SOP files but adds complexity to prompt assembly. Could be a follow-up refinement if the duplicated files drift out of sync.2. Hat-level integration (agent teams in the orchestration loop)
Instead of enhancing
ralph plan, integrate Agent Teams into the hat-based event loop so that any hat (e.g., Builder) could spawn a team. This is a much larger architectural change and doesn't address the specific pain point of slow planning/research. Could be a separate future feature.3. Worktree-based parallelism for planning
Ralph already supports parallel loops via git worktrees. Multiple
ralph plansessions could theoretically run in parallel worktrees. However, worktrees are designed for isolated execution -- they don't enable the inter-agent communication (debate, synthesis, adversarial review) that makes Agent Teams valuable for research and design work.Additional context
End-to-end flow
$ ralph plan --teams "Build a rate limiter"- Teammate A: explores codebase patterns
- Teammate B: researches external approaches
- Teammate C: investigates edge cases
Key technical details
spawn_interactive()insop_runner.rsusesstd::process::Commandwhich makes env var injection trivial (.env("CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS", "1"))-pflag),OutputFormat::Text, and inherit stdin/stdout/stderrinclude_str!("../sops/pdd.md")Considerations
--teamswith a warning@The-Zona-Zoo commented on GitHub (Feb 7, 2026):
Happy to work on this if it sounds like a good feature.
@mikeyobrien commented on GitHub (Feb 7, 2026):
I like it. Go for it!
@aappddeevv commented on GitHub (Feb 11, 2026):
I think I see that this requires a claude backend, is that right? Or can it be setup to work with different backends?
@The-Zona-Zoo commented on GitHub (Feb 11, 2026):
Only Claude. The feature being utilized under the hood is a claude code feature.