Skip to content
This repository was archived by the owner on Apr 26, 2026. It is now read-only.

feat: support --effort flag via provider option and model suffix#15

Open
waveywaves wants to merge 1 commit into
unixfox:masterfrom
waveywaves:feat/effort-option
Open

feat: support --effort flag via provider option and model suffix#15
waveywaves wants to merge 1 commit into
unixfox:masterfrom
waveywaves:feat/effort-option

Conversation

@waveywaves

Copy link
Copy Markdown

Summary

  • Adds an effort provider option (low | medium | high | xhigh | max) that forwards to claude --effort <level>.
  • Also supports a per-model override using a modelId:effort suffix (e.g. opus:high), so one provider entry can expose multiple effort tiers without duplicating the whole block.

Why

Claude CLI's --effort controls reasoning depth, and there's currently no way to set it from opencode — the plugin only forwards --model and --dangerously-skip-permissions. This unblocks using e.g. opus at high effort alongside sonnet at default effort.

Usage

{
  "provider": {
    "claude-code": {
      "npm": "opencode-claude-code-plugin",
      "models": {
        "opus":     { "name": "Opus" },
        "opus:max": { "name": "Opus (max)" },
        "sonnet":   { "name": "Sonnet" }
      },
      "options": {
        "cliPath": "claude",
        "effort": "high"
      }
    }
  }
}

Resolution order:

  1. If modelId has a :<effort> suffix and the suffix is valid, the suffix wins and is stripped before --model.
  2. Otherwise fall back to options.effort.
  3. If neither is set, --effort is omitted (current behavior).

Invalid suffixes are left untouched (treated as part of the model name) so existing configs keep working.

Test plan

  • bun run typecheck
  • bun run build
  • Manual: DEBUG=opencode-claude-code opencode with effort: "high" set, verify --effort high appears in the spawned claude args.
  • Manual: model keyed as opus:max, verify --model opus --effort max is spawned.

Adds an `effort` provider option ("low" | "medium" | "high" | "xhigh" |
"max") that forwards to `claude --effort <level>`. Also supports a
per-model override using a `modelId:effort` suffix (e.g. `opus:high`),
which lets a single provider expose multiple effort tiers without
duplicating provider entries.

Usage:

  "provider": {
    "claude-code": {
      "npm": "opencode-claude-code-plugin",
      "models": {
        "opus": { ... },
        "opus:max": { ... }
      },
      "options": { "cliPath": "claude", "effort": "high" }
    }
  }

If the model ID contains a valid effort suffix, it overrides the
provider-level default and is stripped before being passed to `--model`.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant