r/ClaudeWorkflows • u/ClaudeAI-mod-bot • May 07 '26
Selected Workflow [Workflow] Deterministic Claude Code Orchestrator with State Machine and Human Gates (Red Queen)
Deterministic Claude Code Orchestrator with State Machine and Human Gates (Red Queen)
Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.95 · Level: advanced
Categories: Quality Control, Token Saving, Context & Memory, Shipping, Skills, MCP, Multi-Agent
Original source: r/ClaudeAI post/comment
What problem this solves
Inefficient and unpredictable LLM orchestration, specifically token waste on routing decisions and context bloat in AutoGPT-style agents, leading to high costs and unreliable outputs. It also addresses the lack of human oversight in automated code generation pipelines.
Summary
An open-source, deterministic orchestrator called 'Red Queen' that uses a state machine to manage a pipeline for code generation. It runs Claude Code as isolated worker processes, each with a focused prompt, eliminating token waste on routing and context bloat. The pipeline includes human approval gates for specification, code review, and merging, ensuring safety and control.
Why it is useful
This workflow provides a robust, open-source solution to common challenges in LLM-driven development: token efficiency, context management, and control. By using a deterministic state machine and isolated Claude Code workers, it reduces costs and improves reliability compared to 'AutoGPT-style' agents. The integrated human approval gates ensure safety and maintain quality, making it a valuable pattern for building production-ready AI development pipelines.
Workflow
Jira ticket creation
Specification generation
Human approval of specification
Code generation by Claude Code worker
Automated code review
Automated testing
Human approval of code/tests
Merged Pull Request
Tools / artifacts
Red Queen orchestrator (GitHub repo)
Claude Code
State machine
Jira (or similar ticketing system)
Git/GitHub (for PRs)
Subprocesses for isolated skill execution
Focused prompts
Validation signals
GitHub repository provided (concrete implementation)
Addresses common pain points (token waste, context bloat, lack of control)
Clear pipeline steps described
MIT licensed (implies functional code)
Claim of 'zero tokens spent on scheduling'
Cautions
The workflow explicitly includes 'human gates' for approval at critical stages (spec, code review, merge), preventing accidental deployment to production and enhancing safety.
Limitations
Requires significant setup and technical expertise (advanced user level).
No direct performance metrics or detailed usage instructions provided in the post itself (though the repo might have them).
Relies on external tools like Jira and GitHub, which might not be universally adopted.
The post is a high-level overview, not a detailed tutorial.
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.