OpenCode Orchestration with Stoneforge
Orchestrate OpenCode AI coding agents with Stoneforge. Automated dispatch, context management, and merge coordination.
How Stoneforge orchestrates OpenCode
OpenCode is an open-source AI coding agent built in Go. As a powerful OpenCode AI tool, it runs in your terminal as a TUI and is also available as a desktop app and IDE extension. OpenCode includes primary agents (Build and Plan), subagents (General and Explore), and multi-agent team coordination via message passing.
Stoneforge coordinates multiple OpenCode AI coding agent instances working on separate tasks at the same time, handling dispatch, merging, and failure recovery.
Parallel development with OpenCode AI
OpenCode supports multi-session work and agent teams out of the box. Stoneforge adds orchestrated task dispatch, assigning instances to tasks from a backlog and managing their full lifecycle:
# Create tasks for OpenCode agents
sf plan create --title "Frontend Refresh"
sf task create --title "Redesign login page" --plan "Frontend Refresh"
sf task create --title "Add dark mode support" --plan "Frontend Refresh"
sf task create --title "Implement search component" --plan "Frontend Refresh"
# Start orchestration
sf serve
Each OpenCode instance works in its own git worktree. One handles the login page redesign while another adds dark mode, without stepping on each other’s changes.
Coordinated output
Running multiple coding agents in parallel creates merge challenges. Stoneforge helps manage this:
- Tasks with dependencies are sequenced so they run in the right order
- Each agent works in an isolated worktree, preventing interference
- A steward agent tests and validates completed work before merging
- Merge conflicts are detected early and resolved automatically when possible
Task lifecycle management
Stoneforge manages the full lifecycle for each OpenCode instance:
- The agent receives a task with context, acceptance criteria, and its own branch
- It works in isolation, committing and pushing regularly
- If context fills up or the agent gets stuck, a clean handoff passes work to a fresh session
- When the agent finishes, a steward takes over for review
- Changes are tested and merged into the main branch
Getting started
# Install Stoneforge
npm install -g @stoneforge/cli
# Initialize in your project
sf init
# Configure for OpenCode in .stoneforge/config.yaml
# Start orchestrating
sf serve
Stoneforge auto-detects your project structure and sets reasonable defaults. You can customize agent count, model, and merge policies in the config file.
Learn more
- Best AI Coding Agents in 2026 — see how OpenCode AI compares to other coding agents
- Run Multiple AI Coding Agents in Parallel — step-by-step guide to parallel agent workflows
- The Case for Multi-Agent Software Development — why orchestration matters for AI coding agents
Configuration
# .stoneforge/config.yaml
orchestrator:
agent: opencode
maxConcurrent: 4
worktreeIsolation: true
agents:
worker:
provider: opencode
model: default
steward:
provider: opencode
autoMerge: true
OpenCode alone vs. with Stoneforge
| OpenCode alone | With Stoneforge |
|---|---|
| Multi-session support within a single project | Orchestrated dispatch from a task backlog with lifecycle management |
| Manual project navigation and context | Automatic task dispatch with full project context |
| Multi-agent teams with subagent delegation | Role-based orchestration (director, worker, steward) across independent tasks |
| Manual git workflow | Isolated worktrees with automated branching and merging |
| Within-session error recovery and context compaction | Cross-session handoff when context fills up or sessions fail unrecoverably |
Integration documentation
Start orchestrating OpenCode
Set up Stoneforge in under 30 seconds and run multiple OpenCode agents in parallel.