Bring Your Own Agent (BYOA)
Genie is an orchestration layer, not an AI provider. It manages teams, worktrees, messaging, state, and task dispatch — the agent that does the actual coding is pluggable. We have strong opinions about orchestration. We have zero opinions about your model vendor. Today, Genie ships with built-in adapters for Claude Code and Codex. But the architecture is designed so that any CLI-based agent can be plugged in as a provider. The agent is the muscle. Genie is the brain.Why BYOA Matters
- No vendor lock-in — switch providers without changing your workflow
- Best tool for the job — use Claude for reasoning-heavy tasks, Codex for fast iteration
- Cost control — mix expensive and cheap models in the same team
- Future-proof — new agents appear constantly; Genie adapts without rewriting your setup
- Team flexibility — different team members can prefer different agents
Supported Providers
| Provider | Status | Binary | Notes |
|---|---|---|---|
| Claude Code | Built-in | claude | Full native team integration, session resume, model selection |
| Codex | Built-in | codex | Autonomous mode (--yolo), inline terminal output |
| Gemini CLI | Planned | gemini | Google’s CLI agent — adapter in development |
| Open Claw | Planned | openclaw | Open-source agent — community adapter |
| Aider | Planned | aider | Git-native coding assistant |
| Custom | Extensible | Any binary | Build your own adapter (see architecture below) |
Built-in providers work today with
genie spawn --provider. Planned providers follow the same adapter pattern and can be contributed as community adapters.The --provider Flag
Every genie spawn command accepts a --provider flag that selects which AI agent backs the worker:
claude. When you specify a different provider, Genie translates your spawn options into the provider-specific CLI invocation.
Examples
What Changes Between Providers
Genie normalizes the interface, but each provider has its own capabilities:| Capability | Claude Code | Codex |
|---|---|---|
| Native team integration | Yes (--agent-id, --team-name) | No |
| Session resume | Yes (--resume) | No |
| Model selection | Yes (--model) | No |
| System prompt injection | --append-system-prompt-file | --instructions |
| Permission mode | --dangerously-skip-permissions | --yolo |
| Inline terminal | Default | --no-alt-screen |
What Stays the Same
Regardless of provider, Genie handles:- Worker registry — all agents tracked in PostgreSQL
- Messaging —
genie sendworks the same for any provider - Team chat — broadcast messages reach all agents regardless of provider
- Task dispatch — wish execution groups are provider-agnostic
- Lifecycle —
genie ls,genie stop,genie killwork uniformly - Worktree isolation — git worktrees are shared infrastructure, not provider-specific
Auto-Respawn Templates
When Genie spawns an agent, it saves a template — a snapshot of the spawn configuration. If an agent goes offline (tmux pane dies, process crashes), Genie can automatically respawn it from the saved template.How It Works
- Spawn — You run
genie spawn engineer --provider codex --team auth-fix - Template saved — Genie stores the spawn config in the worker registry:
- Agent goes offline — The tmux pane dies or the process exits
- Message triggers respawn — When another agent (like the team-lead) sends a message to the offline agent, Genie’s auto-spawn hook detects the dead pane and respawns from the template
- Same config, fresh process — The respawned agent gets the same provider, team, role, and working directory
Template Resolution
When a message targets an offline agent, the auto-spawn handler:- Checks the worker registry for a live tmux pane — skips if the agent is alive
- Looks up the agent in the directory for identity resolution
- Searches saved templates by name, ID, or role within the team
- Spawns using the matched template’s provider and configuration
Auto-respawn is triggered by message delivery, not by a heartbeat or timer. If no one sends a message to a dead agent, it stays dead. This is intentional — it prevents unnecessary respawns of agents that are no longer needed.
Template Fields
| Field | Description |
|---|---|
id | Agent identifier (matches spawn name) |
provider | Which agent binary to use (claude or codex) |
team | Team the agent belongs to |
role | Agent role (engineer, reviewer, etc.) |
skill | Pre-loaded skill (optional) |
cwd | Working directory for the respawned agent |
extraArgs | Additional CLI flags forwarded to the provider |
lastSpawnedAt | Timestamp of the most recent spawn |
Multi-Provider Team Patterns
Pattern 1: Specialization
Problem: Different tasks need different strengths. Reasoning-heavy architecture work benefits from a stronger model, while straightforward implementation can use a faster, cheaper agent. Solution: Assign providers based on task type within the same team.Pattern 2: Cost Optimization
Problem: Running every agent on Claude Opus is expensive. For a 5-agent team running 2 hours, model costs add up fast. Solution: Use the most capable (and expensive) model only where it matters. Use cheaper providers for high-volume, lower-complexity work.Pattern 3: Manual Failover
Problem: A provider goes down or hits rate limits during an active wish. Your team is blocked. Solution: Manually respawn affected agents with a different provider. Genie’s orchestration layer is provider-agnostic — switching providers doesn’t lose team state, messages, or wish progress.Failover is manual by design. Automatic provider switching introduces complexity around session state, model capability differences, and cost surprises. Manual failover keeps you in control.
How Provider Adapters Work
Under the hood, each provider is a function that translatesSpawnParams into a shell command:
- Binary selection — which CLI to invoke (
claude,codex) - Flag translation — mapping Genie options to provider-specific flags
- Environment setup — setting
GENIE_AGENT_NAME,GENIE_TEAM, etc. - Preflight checks — verifying the provider binary exists on PATH
Adding a New Provider
Provider adapters live insrc/lib/provider-adapters.ts. Each adapter implements a build*Command() function that takes SpawnParams and returns a LaunchCommand:
- Add the provider name to the
ProviderNametype - Implement a
build*Command()function - Add a case to the
buildLaunchCommand()switch - Ensure the binary passes the
preflightCheck()
Best Practices
Start with the default provider
Start with the default provider
Claude Code is the default for a reason — it has the deepest integration with Genie (native teams, session resume, model selection). Use it unless you have a specific reason to switch.
Match provider to task complexity
Match provider to task complexity
Use stronger providers for tasks that require reasoning (architecture, review, debugging). Use faster/cheaper providers for straightforward implementation and testing.
Keep the team-lead on Claude
Keep the team-lead on Claude
The team-lead orchestrates the entire wish lifecycle. It benefits most from Claude’s native team integration and session resume capabilities.
Test your wish with one provider first
Test your wish with one provider first
Don’t start with a multi-provider team. Get the wish working with a single provider, then optimize by switching specific roles to cheaper alternatives.
Document your provider choices
Document your provider choices
When using mixed providers in a team, note why in the wish or team config. Future you (or your teammates) will want to know why the QA agent is on Codex.
Questions?
Something not working with your provider setup? Adapter behaving weird? Want to argue about whether Codex or Claude is better for review tasks? (Spoiler: we have opinions, but we’ll let you form your own.)Ask on Discord
Provider questions, adapter help, and healthy debates about which AI is best at what.