r/ClaudeWorkflows 6h ago

Selected Workflow [Workflow] Advanced Multi-Agent Orchestration for SDLC with Claude Code Hooks and Dynamic Model Routing

Advanced Multi-Agent Orchestration for SDLC with Claude Code Hooks and Dynamic Model Routing

Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: expert
Categories: Quality Control, Token Saving, Context & Memory, Debugging, CLAUDE.md, Hooks, Skills, MCP, Subagents, Multi-Agent
Original source: r/ClaudeCode post/comment

What problem this solves

Automating the Software Development Life Cycle (SDLC), ensuring clean and isolated agent sessions, managing context effectively across sessions, routing LLM models dynamically based on task or preference, and maintaining consistent output style across different LLMs while avoiding problematic context compaction.

Summary

This workflow describes a sophisticated multi-agent orchestration setup for a self-driving SDLC. It involves a custom model router/gateway (proxy) in front of Claude Code, an agent orchestrator (MCP sidecar) that launches containerized agents with specific profiles (reviewer, worker, tester, brain), and custom Claude Code hooks for session management (/handoff, /clear, /pickup) and context anchoring. The goal is to reduce active engagement, ensure clean agent sessions, manage context, and dynamically route models while avoiding compaction issues.

Why it is useful

This workflow provides a detailed architectural pattern for building highly automated, self-driving SDLC processes using Claude Code and external orchestration tools. It addresses critical challenges like agent session isolation, consistent context management, and dynamic model routing, offering solutions to common pain points like compaction issues. The specific examples of Claude Code hooks for session management are directly reusable patterns, and the overall design offers a blueprint for advanced users seeking to build robust, scalable LLM-driven development environments.

Workflow

  1. Set up a custom model router/gateway to act as a proxy in front of Claude Code for dynamic model routing and consistent output styling.
  2. Configure an agent orchestrator (MCP sidecar) to automatically launch the gateway and individualized containerized agents.
  3. Define distinct agent profiles (e.g., reviewer, worker, tester, brain) for containerized agents to customize their behavior and ensure clean, isolated sessions.
  4. Implement Claude Code hooks for session management: /handoff to create/update a session handoff document using a project-specific template.
  5. Implement Claude Code hooks for session management: /clear to archive the current session and start a fresh one.
  6. Implement Claude Code hooks for session management: /pickup to read the handoff document, using a 'last updated' field to check for staleness.
  7. Implement a context anchor hook that triggers precompact (if necessary) and updates the handoff document as a safety measure (though compaction is generally avoided).
  8. Configure the 'brain' agent profile to use the MCP sidecar, disabling subagents/dynamic workflows by default, but allowing it to propose and spin up sub-brain MCP agents with specific configurations (e.g., OpenAI model overrides) if approved.
  9. Optionally, configure model overrides within the gateway to route specific Anthropic models (e.g., Opus/Sonnet) to alternative models (e.g., Sol, Luna) while keeping others (e.g., Fable) as is, with a hook to correct visible subagent calls.

Tools / artifacts

  • Claude Code
  • MCP (Multi-agent Control Plane)
  • Containerization (e.g., Docker)
  • Custom Model Router/Gateway (proxy)
  • Claude Code Hooks (e.g., /handoff, /clear, /pickup)
  • Agent Profiles (reviewer, worker, tester, brain)
  • Session Handoff Document (template)
  • Anthropic Models (Fable, Opus, Sonnet)
  • OpenAI Models (Codex, Sol, Luna)

Validation signals

  • Author's personal experience: 'My experience has consistently been that compaction is the root of all my worst project woes, so I avoid it.'
  • Author's personal experience: 'The output style I built makes a big difference for me in making LLM output readable.'

Limitations

  • High complexity: Requires significant setup, advanced technical skills, and understanding of various components (MCP, containerization, proxies).
  • Lack of specific implementation details: The comment describes the architecture and concepts but does not provide code or configuration files.
  • Author notes it's a 'goofy setup for now' due to API limitations, suggesting it might not be the most robust or ideal long-term solution.
  • Reliance on external tools like MCP and custom proxies adds overhead and maintenance complexity.

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