Codex CLI Orchestration with Stoneforge
Orchestrate OpenAI Codex CLI as an AI coding agent with Stoneforge. Parallel dispatch, worktree isolation, and automated merging.
How Stoneforge orchestrates Codex CLI
OpenAI’s Codex CLI is an AI coding agent that runs in a sandboxed terminal environment with built-in safety controls. As a Codex AI coding agent, each session handles one task in isolation.
Stoneforge adds multi-agent orchestration on top of OpenAI Codex, dispatching multiple tasks to parallel Codex CLI agents and handling coordination, merging, and failure recovery.
How Stoneforge dispatches to Codex CLI
When you create tasks, the Daemon watches the queue and dispatches work to available Codex agents:
sf plan create --title "Backend Improvements"
sf task create --title "Add rate limiting to API" --plan "Backend Improvements"
sf task create --title "Optimize database queries" --plan "Backend Improvements"
sf task create --title "Add request logging middleware" --plan "Backend Improvements"
# Codex agents pick up tasks automatically
sf serve
Each Codex agent gets its own worktree, task context, and acceptance criteria.
Sandboxed execution at scale
Codex CLI’s sandboxing keeps each agent contained. Stoneforge adds git-level isolation through worktrees, so multiple Codex agents run in parallel on separate branches without interfering with each other.
Merge and review pipeline
When a Codex agent completes its task, the Steward:
- Validates the branch builds and tests pass
- Checks for merge conflicts with other completed work
- Creates a merge request with a summary of changes
- Merges automatically if checks pass, or flags for human review
Getting started with Codex
# Install Stoneforge
npm install -g @stoneforge/cli
# Initialize and configure for Codex
sf init
# Update .stoneforge/config.yaml to use codex provider
# Start orchestrating
sf serve
Codex CLI has three approval modes: suggest (approve everything), auto-edit (auto-apply file changes, approve shell commands), and full-auto (no confirmation). Set the approval field in your Stoneforge config to match your preferred level of oversight.
Learn more
- Best AI Coding Agents in 2026 — see how Codex CLI compares to other AI coding agents
- Run Multiple AI Coding Agents in Parallel — a practical guide to parallel agent workflows
- Claude Code Orchestration — compare with another supported AI coding agent provider
Configuration
# .stoneforge/config.yaml
orchestrator:
agent: codex
maxConcurrent: 4
worktreeIsolation: true
agents:
worker:
provider: codex
model: o4-mini
approval: auto-edit
steward:
provider: codex
model: o4-mini
autoMerge: true
Codex CLI alone vs. with Stoneforge
| Codex CLI alone | With Stoneforge |
|---|---|
| Single sandboxed session per task | Multiple Codex agents dispatched to parallel tasks |
| Manual task assignment and tracking | Automatic dispatch with priority and dependency awareness |
| Sandbox isolation per session | Git worktree isolation with automatic merge coordination |
| No built-in multi-agent coordination | Director-worker-steward role hierarchy |
| Manual review of each change | Steward agent runs tests and merges automatically |
Integration documentation
Start orchestrating Codex CLI
Set up Stoneforge in under 30 seconds and run multiple Codex CLI agents in parallel.