opencode

A workflow for running the OpenCode command-line tool as a coding sub-agent. OpenCode can use configured AI models to implement code, review it, debug problems, research, or provide another opinion.

In plain words
What is it for?
Use it to ask OpenCode to build or modify code, analyse a project in read-only planning mode, review changes, investigate bugs, or continue an existing session.
Why use it?
It provides a defined command and the required options for running OpenCode automatically from a project. This helps delegate coding work while keeping the task directory, model, agent type, and output format explicit.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/maystudios/claude-skills/opencode
Any agent
npx skills add maystudios/claude-skills --skill opencode
Clone the repo
git clone --depth 1 https://github.com/maystudios/claude-skills

Made for: Claude Code, Codex.

Per session 174 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,018 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00174 $0.05018
Opus 5 $0.00087 $0.02509
Sonnet 5 $0.00035 $0.01004
Haiku 4.5 $0.00017 $0.00502

Measured 2d ago against content hash 0eb4f8a3cdfd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opencode scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/parse_output.py, scripts/test_skill.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

opencode/SKILL.md · 521 lines

How it starts

The opening of the file, as written. The whole thing — 521 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

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
step_start Session/message IDs
step_finish .part.tokens (usage), .part.cost, .part.reason

Parse with the helper script (always redirect stderr):

opencode run --format json ... 2>/dev/null | python .claude/skills/opencode/scripts/parse_output.py [--mode text|full|tools|cost|session|diff|summary]

Parse modes:

  • text -- model's text response (default)
  • full -- text + tool calls + tool results
  • tools -- tool calls and results only
  • cost -- token usage and cost breakdown
  • session -- extract session ID for continuation
  • diff -- extract file modifications from tool calls
  • summary -- one-line summary (status, tokens, cost, duration)

Read the full file on GitHub · 521 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 521 lines · 174 tokens per session scan A 0eb4f8a3cdfd

Subscribe to this mod's changes

opencode is a skill published in the GitHub repository maystudios/claude-skills (21 stars, last pushed 17d ago), licensed MIT. It adds 174 tokens to every session and 5,018 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

unreal-mcp

Automate Unreal Engine editor scenes, actors, and renders.

NousResearch/hermes-agent · 17 tokens

unity-agent-workflows

Use for AI-assisted Unity work that needs live repo discovery, project-derived routing, runtime-owner proof, runtime-visible output hard stops, runtime numeric proof for repeated visible-output failures, state-step guards, multi-agent scope ownership, modular C#/asmdef safety, UI/scene/visual asset gates, data-first…

hashgraph-online/awesome-codex-plugins · 146 tokens

level-actors

List, find, place, move, rotate, and modify actors in the current level (ActorService + editor subsystems). Use when the user asks to find/list actors in the level, move or rotate an actor, set an actor's properties/folder/transform, or spawn/delete level actors.

kevinpbuckley/VibeUE · 64 tokens

asset-management

Import/export textures crash-safely, query the Content Browser selection, and check if an asset is open (AssetDiscoveryService). Search, load, save, move, rename, duplicate, and delete assets are handled by Unreal's native AssetTools toolset or EditorAssetLibrary. Use when the user asks to import an image from disk…

kevinpbuckley/VibeUE · 92 tokens

materials

Create and edit materials and material instances — graph nodes, parameters, functions, custom HLSL, and instance overrides (MaterialService + MaterialNodeService). Use when the user asks to create or edit a material/material instance, wire material nodes, add material parameters, set blend/shading modes, or recreate a…

kevinpbuckley/VibeUE · 75 tokens

vibeue

Unreal Engine 5 development using the VibeUE Python API. Use when working in Unreal Engine — blueprints, state trees, materials, actors, landscapes, animation, niagara, widgets, sound, foliage, gameplay tags, enhanced input, skeletons, PCG (procedural content generation), and more. VibeUE is an extension of Unreal's…

kevinpbuckley/VibeUE · 82 tokens