π Orchestrator Setup
The GitHub Issue Bot uses a primary Claude Code session as orchestrator that dispatches 4 parallel workflows. Each workflow is an independent session that receives an issue, implements the fix, runs tests, and creates the PR.
"We can use Archon to send off workflows to run in parallel, handling multiple GitHub issues at the exact same time. And this is very much like loop engineering because we have our primary cloud code here as our orchestrator."
π Orchestrator Prompt
You are the orchestrator for a GitHub issue fixing system.
1. Read the list of open issues from the GitHub API
2. For each issue, dispatch a worker workflow in a separate worktree
3. Each worker will: extract context, classify (bug/feature), implement, validate, create PR
4. Monitor all workers. When all PRs are ready, dispatch review workflows
5. Report final status with PR links
Issues to handle: #42, #45, #51, #58
π³ Worktrees for Isolation
When multiple workers edit code in parallel, they need complete isolation. Git worktrees solve this: each worker operates in its own repository checkout, with its own branch.
"Work trees are also a really important part of loop engineering. Boris talks about this as well. If we're having many different agents handling tasks in a loop, we need to make sure they're running in isolation so they're not stepping on each other's toes."
π» Worktree Commands
# Criar worktree para cada issue
git worktree add ../worktree-42 -b fix/issue-42
git worktree add ../worktree-45 -b fix/issue-45
git worktree add ../worktree-51 -b fix/issue-51
git worktree add ../worktree-58 -b fix/issue-58
# Cada worker roda em seu diretorio
cd ../worktree-42 && claude --prompt "Fix issue #42..."
# Limpar apos merge
git worktree remove ../worktree-42
πΎ Database Branches with Neon
Code isolation (worktrees) solves half the problem. The other half is data isolation. Neon lets you create Postgres database branches for each worker, preventing migrations and test data from conflicting.
"One thing that you have to do a lot is branches in your database. If each coding agent is working on something in parallel, you don't want them to be stepping on each other's toes, not just with code changes, but also database changes. So work trees and Neon is a super powerful thing."
π Branch per Worker
# Criar branch de banco para cada worker (via Neon CLI)
neonctl branches create --name worker-42 --parent main
neonctl branches create --name worker-45 --parent main
# Cada worker recebe sua DATABASE_URL isolada
export DATABASE_URL=$(neonctl connection-string --branch worker-42)
# Apos merge do PR, deletar branch
neonctl branches delete worker-42
π― Reflection Point
Database branches are essential when workers run migrations or modify the schema. Without them, one worker can break the database another is using. Neon makes this trivial, but any database branching system (PlanetScale, Supabase branching) works.
π Full Flow: Issue to PR
Each worker follows a deterministic 7-step pipeline. The process is fixed (the human defines the steps), but each step uses an LLM to execute. This combines the best of loops and deterministic workflows.
"Another really important thing about Archon is that we donβt let the agent drive everything. The process is more deterministic because we configure it in this workflow file."
π§ Worker Pipeline (7 Steps)
Extract issue number
Deterministic: parses the input to get the issue ID
Fetch issue context
GitHub API: title, description, labels, comments
Classify (bug vs. feature)
Small LLM (Haiku/Kimi): decides the issue type
Research
Medium LLM: investigates the codebase, identifies relevant files
Implement
Strong LLM (Claude): writes the fix code
Validate
Deterministic: runs tests, lint, and type checks
Create PR
Deterministic: git push + gh pr create
π° Model Mix by Step
One of the biggest advantages of deterministic workflows over pure loops is the ability to use different models at each step. This drastically reduces cost without sacrificing quality where it matters.
"One of the other big issues I see with using slash goal or routines or loops in cloud code is you're just using one model for pretty much everything. That's part of the problem of why it's so expensive."
π― Model Map by Step
| Step | Model | Rationale |
|---|---|---|
| Extract / Fetch | Deterministic | No LLM, pure code |
| Classify | Haiku / Kimi K2.7 | Simple decision, inexpensive model |
| Research | Kimi K2.7 | Exploration, medium model |
| Implement | Claude Code | Requires maximum quality |
| Validate | Deterministic | Runs tests, no LLM |
| Review | Codex / Claude | Code review requires reasoning |
β Questions
The issue bot is powerful, but it's not magic. Real questions that come up in practice.
Actual cost of 4 issues in parallel
Cole reports that a single run with an orchestrator and workers cost more than 1 million tokens. With 4 running in parallel, multiply that. A mix of models helps, but the cost is still significant for anyone without an infinite budget.
Quality of generated PRs
Automatic PRs need human review. Agent code review helps, but Cole emphasizes keeping a human in the loop: "we can always have it pause for us to validate something before it continues."
When it is and isn't worth it
For batches of simple issues (typos, dependency updates, standard refactorings), it's very useful. For complex issues that require design thinking, the agent will produce superficial fixes. Use it judiciously.
π― Reflection Point
The issue bot is the bridge between the simple loop (module 4.1) and the multi-agent orchestrator (module 4.3). It introduces parallelism, isolation, and a model mix. Once you master these concepts, the jump to multi-agent will feel natural.
π Module Summary
Next Module:
4.3 -- Advanced Loop: Multi-Agent Orchestrator (spec, rounds, HITL)