Agent Backends
An agent backend is the runtime that actually drives the coding agent behind OpenShrimp. The top-level backend: key selects it for the whole instance, and any context can override it with its own backend: key. Everything else — contexts, tool approval, sandboxes, sessions — works the same regardless of which backend is active.
Two backends ship:
backend: claude_sdk # global default; can be overridden per contextComparison
Section titled “Comparison”claude_sdk | opencode | |
|---|---|---|
| Default? | Yes | No |
| Runtime | Claude Agent SDK (bundled Claude Code CLI) | sst/opencode over its HTTP serve API |
| Models | Anthropic models (sonnet, opus, haiku, or a full model ID) | OpenAI, Anthropic, and Google models — must be provider-qualified (provider/model) |
| Auth | ANTHROPIC_API_KEY or /login OAuth | opencode auth login (out-of-band, on the host) |
| Extra binary needed? | No (bundled) | Yes — the opencode binary must be discoverable |
OpenCode setup
Section titled “OpenCode setup”OpenCode is not bundled. Before selecting it, satisfy three preconditions on the host:
- Provider-qualified models. Every OpenCode context’s
model:must be written asprovider/model. OpenCode has no implicit default provider, so an unqualified model fails fast at startup. Examples:openai/gpt-5.5anthropic/claude-opus-4-7google/gemini-2.5-pro
- Pre-authenticate out-of-band. Run
opencode auth loginon the host. This writes credentials to~/.local/share/opencode/auth.json, which OpenShrimp reuses. - Discoverable binary. At startup OpenShrimp locates the
opencodebinary by checking, in order:- the
$OPENCODE_BINenvironment variable, ~/.opencode/bin/opencode,- your
PATH.
- the
Minimal example
Section titled “Minimal example”backend: opencodecontexts: my-project: directory: /home/you/projects/my-project model: openai/gpt-5.5 # provider/model REQUIREDInteraction with sandboxes
Section titled “Interaction with sandboxes”OpenCode works inside sandboxes, with a few backend-specific details:
- Docker — OpenCode contexts use a separate image,
openshrimp-opencode:latest, built lazily on first use (distinct from theopenshrimp-claudeimage used byclaude_sdk). - Libvirt and Lima — when the host has an
opencodebinary, OpenShrimp auto-installs it into the guest. Otherwise the base image orprovision:script must supply it.
See the Docker Sandbox, VM Sandbox, and Lima Sandbox guides for sandbox setup, and the Configuration Reference for all fields.