agentleFS
AhmetSIRIMAhmetSIRIM/claude-setup/skills/opencode-delegate/SKILL.md

opencode-delegate

Skill0 starsChanged 3 months agoMITView on GitHub

Use when a task is about to run on the opencode CLI (`opencode run`), when the user wants a second opinion from another model family, or when an `opencode run` call hangs or errors, or when choosing between a Claude subagent and opencode for a subtask.

  • Reads credentials

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Start long calls in the background.

    line 16
  2. Very specific:

    Never pass --auto (it approves permissions on the model's behalf).

    line 18
  3. Distinctive:

    Read the answer from the CLI at the moment of use, never from a name written here:

    line 47
  4. Distinctive:

    Prefer it over Zen for paid work: the fee is already spent, the tokens are not.

    line 69

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

opencode-delegate

Reference for running subtasks on another model through the opencode CLI. Claude may propose delegation and a fitting model, stays the orchestrator either way: it writes the task, reads the result, verifies it, then reports.

Running

opencode run --dir <target-dir> -m <provider/model> "<task>" --format default
  • Start long calls in the background; if nothing comes back in two minutes, kill the process and diagnose.
  • Never pass --auto (it approves permissions on the model's behalf); delegated work stays read-only unless the user explicitly asks for file writes.
  • --variant <effort> sets provider-specific reasoning effort where the model supports it; --thinking shows the reasoning blocks.
  • Auth doubts: opencode auth list. Log: ~/.local/share/opencode/log/opencode.log; sessions: opencode session list, run from inside the target project (it lists that project's sessions; it has no --dir, and directories outside a git checkout share one global list).
  • Several models at once: batch by four; concurrent runs share one SQLite state and serialize when overloaded.

Lane choice

WorkLane
Needs this session's tools, permissions, or a structured returnClaude subagent
Noisy discovery whose output would flood the conversationClaude subagent on a cheap model
Second opinion on design or architectureopencode, strong tier; a different family sees different things
Low-risk mechanical bulk: scans, summaries, format conversionopencode, free or light tier
House-style code, files next to secrets, anything needing this conversation's contextstays in the session

Model choice

opencode models prints what this machine can actually reach: the providers it holds a credential for, narrowed again by the account's own console settings, so two machines on the same plan can see different lists. The catalog in ~/.cache/opencode/models.json holds every provider models.dev knows, reachable or not; it answers "what does it cost", never "can I call it". An id the catalog has and opencode models does not print fails at run time with Unexpected server error and an err_... ref, not with a clear "no such model", so a stale id reads as an outage.

Read the answer from the CLI at the moment of use, never from a name written here:

opencode models                       # reachable now
opencode models <provider> --verbose  # adds cost and context metadata per model
opencode models --refresh             # re-pull the catalog from models.dev
TierHow to recognize itFit
Freethe id ends in -freefirst try for mechanical work: scans, summaries, format conversion
Lightcost.input below $1 per 1Mmechanical work when free fails; medium tasks
Strongcost.input at $1 per 1M or abovesecond opinion on design or architecture

Two providers carry opencode's own models and their ids overlap, so the prefix decides what is billed. The same console API key unlocks both, but a credential is stored per provider: opencode auth login registers it under one provider at a time, so a Zen entry alone leaves opencode-go/* unreachable. The OPENCODE_API_KEY environment variable is the one route both providers read from a single value.

  • opencode/* is OpenCode Zen, charged per token against an account balance. It is the provider that carries the -free ids and the claude-* ones.
  • opencode-go/* is the OpenCode Go subscription, a flat monthly fee with dollar-denominated limits per rolling window. Open models only, no claude-*. Prefer it over Zen for paid work: the fee is already spent, the tokens are not.

For a second opinion pick a family the user has not consulted on this question yet; the family is the part of the id before the version (kimi, qwen, glm, grok, minimax, gpt, gemini, deepseek). The catalog's own family field is finer than that (it splits one vendor by generation), so it does not serve this purpose.

Known failures

SymptomCauseFix
Hangs; log shows Cannot connect to API retry every 30 sthe network blocks opencode.ai at the TLS layer; opencode never gives upkill the process; verify with curl -sS --max-time 6 https://models.opencode.ai/api.json, switch network
Session opens, no output within the two-minute window, log shows no connect errorsthe model stalls on the provider sidekill the process; pick another family and say which one stalled
UnknownError on stderr, body Unexpected server error with an err_... ref, exit 1the id is not in this account's live list, usually one that was retiredopencode models <provider>, use an id it prints
Insufficient balance, with a billing linka Zen (opencode/*) paid model on an empty balancemove to opencode-go/* while the plan is active, else a -free id, and say the balance is empty
Go calls start failing after heavy usea Go usage window is exhausted and the console's balance fallback is offwait for the window to reset, or ask the user to enable the fallback
Provider not found: <id>no credential for that provider hereopencode auth list; only configured providers are usable
only available hosted in China and requires explicit opt inthe account's China-hosting setting is offask the user; it is a console toggle, not a reason to drop the model
Output carries stray CJK charactersfree-tier modelsclean them when the content is otherwise right

The rows are keyed to symptoms, not to an id list. Re-test a model with one small request before recommending it; what an account exposes changes under the skill.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.