opencodelisted
Install: claude install-skill maystudios/claude-skills
# OpenCode Sub-Agent Protocol
This is an executable protocol for delegating work to OpenCode agents. Follow it precisely.
## Prerequisites
- `opencode` CLI installed and in PATH (verify: `opencode --version`)
- At least one provider authenticated (`opencode providers list`)
- Available models listed via `opencode models`
## Core Command
```bash
OPENCODE_DISABLE_AUTOUPDATE=true opencode run --format json --model <provider/model> --agent <build|plan> --dir "<working-dir>" --dangerously-skip-permissions [options] "<prompt>" 2>/dev/null
```
Key flags:
- `--format json` -- machine-parseable ndjson output (always use this)
- `--model provider/model` -- e.g., `openai/gpt-5.4`, `openai/gpt-5.3-codex`
- `--variant <level>` -- reasoning effort: `minimal`, `medium`, `high`, `xhigh` (provider-specific)
- `--dir <path>` -- working directory for the task
- `--dangerously-skip-permissions` -- auto-approve tool calls (required for headless)
- `-f/--file <path>` -- attach file(s) to the prompt
- `--agent <name>` -- `build` for implementation (filesystem+bash), `plan` for analysis (read-only)
- `-c/--continue` -- continue last session
- `-s/--session <id>` -- continue specific session
## Output Parsing
The `--format json` flag emits ndjson (one JSON object per line):
| type | Contains |
|------|----------|
| `text` | `.part.text` -- model's text response |
| `tool_call` | `.part.name`, `.part.input` -- tool invocations |
| `tool_result` | `.part.output` -- tool execution results |
| `