OpenCode
OpenCode is one of the three coding agents Band ships out of the box. Band runs
the opencode CLI binary as a child process and reads JSONL events
line-by-line from stdout. The adapter supports session listing, model discovery,
and skill discovery, but does not surface per-turn cost tracking.
Prerequisites
- Install OpenCode so the
opencodebinary is on yourPATH. - Authenticate via the OpenCode CLI's normal flow.
- Verify the binary works:
opencode --version.
On first launch Band detects opencode automatically and adds an entry
to the codingAgents setting. You can override the executable path or
the model from Settings.
Models
The adapter caches the model list returned by OpenCode and uses it to validate per-message overrides. If a chat pane requests a model that OpenCode doesn't advertise (for example, a Claude model passed through from a switched agent), Band drops the override and lets OpenCode use its own default.
Session Listing & Resume
OpenCode persists session transcripts under ~/.opencode/sessions/
(or wherever your OpenCode install configures them). Band reads this directory to
populate the session list per workspace, and resumes threads by passing the
session ID through to a follow-up runSession call.
Skills
Band discovers OpenCode skills via the standard
readSkillsFromDir helper, looking under
~/.opencode/skills/ and <workspace>/.opencode/skills/.
Configuration Options
- model — Default model id (validated against the cached OpenCode model list).
- executablePath — Path to the
opencodebinary if it isn't onPATH. - maxTurns — Maximum number of agentic turns per session.
Differences vs Claude Code
- No cost tracking. The adapter's
supportedFeatures.costTrackingisfalse; Band's session-result event reports zero cost. - No interactive tool prompts. All tool calls are auto-approved.
- No status hooks. Agent status comes from Band's own session events, not from out-of-process hooks.