@khalilgharbaoui/opencode-claude-code-plugin 0.13.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +369 -221
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,7 +78,9 @@ The plugin auto-registers the following. They appear in the model picker without
|
|
|
78
78
|
| `claude-opus-4-6` | Claude Opus 4.6 | 1M | 128,000 | low/medium/high/xhigh/max | 5× |
|
|
79
79
|
| `claude-opus-4-7` | Claude Opus 4.7 | 1M | 128,000 | low/medium/high/xhigh/max | 5× |
|
|
80
80
|
| `claude-opus-4-8` | Claude Opus 4.8 | 1M | 128,000 | low/medium/high/xhigh/max | 5× |
|
|
81
|
+
| `claude-opus-4-8-fast` | Claude Opus 4.8 Fast | 1M | 128,000 | low/medium/high/xhigh/max | 10× |
|
|
81
82
|
| `claude-opus-5` | Claude Opus 5 | 1M | 128,000 | low/medium/high/xhigh/max | 5× |
|
|
83
|
+
| `claude-opus-5-fast` | Claude Opus 5 Fast | 1M | 128,000 | low/medium/high/xhigh/max | 10× |
|
|
82
84
|
| `claude-fable-5` | Claude Fable 5 | 1M | 128,000 | low/medium/high/xhigh/max | 10× |
|
|
83
85
|
| `claude-mythos-5` | Claude Mythos 5 | 1M | 128,000 | low/medium/high/xhigh/max | 10× |
|
|
84
86
|
|
|
@@ -86,9 +88,25 @@ The plugin auto-registers the following. They appear in the model picker without
|
|
|
86
88
|
|
|
87
89
|
Capabilities for every model: text + image input, text output, tool use, attachments. No temperature control, no PDF/audio/video, no interleaved streaming.
|
|
88
90
|
|
|
89
|
-
**Price ×** is each model's per-token list price relative to Haiku, the cheapest model. It's derived exactly from Anthropic's published pricing
|
|
91
|
+
**Price ×** is each model's per-token list price relative to Haiku, the cheapest model. It's derived exactly from Anthropic's published pricing (input and output ratios both come out the same: Haiku $1/$5 = 1×, Sonnet $3/$15 = 3×, Opus $5/$25 = 5×, Fable 5 / Mythos 5 / Opus fast mode $10/$50 = 10×). So **Fable 5, Mythos 5, and fast-mode Opus all cost 2× standard Opus 5**. Sonnet 5's `2×` uses its introductory $2/$10 pricing through August 31, 2026; standard $3/$15 pricing begins September 1. The same multiplier is shown as a `(N×)` suffix on the display name in opencode's model picker, since opencode has no dedicated multiplier field. On a flat Max/Pro subscription it doubles as a rough guide to how fast each model drains your usage limit.
|
|
90
92
|
|
|
91
|
-
The model ID is passed straight through to `claude --model`, so anything Claude Code accepts works.
|
|
93
|
+
The model ID is passed straight through to `claude --model`, so anything Claude Code accepts works. The two `-fast` IDs are the one exception, described below.
|
|
94
|
+
|
|
95
|
+
### Fast mode
|
|
96
|
+
|
|
97
|
+
`claude-opus-5-fast` and `claude-opus-4-8-fast` run the same models at up to 2.5× the output tokens per second, at 2× the price ($10/M input, $50/M output, the 10× column). Pick them in the model selector like any other model.
|
|
98
|
+
|
|
99
|
+
The `-fast` suffix is this plugin's own marker, not a model name Anthropic serves. The plugin strips it and spawns `claude --model claude-opus-5 --settings '{"fastMode":true}'`, because that settings layer is the only way to opt a headless (`--print`) session into fast mode: there is no `--fast` flag, and the old `claude-opus-4-6-fast` style model names are retired. Requires Claude Code 2.1.220+; below that the plugin skips the opt-in and you get standard speed.
|
|
100
|
+
|
|
101
|
+
Fast mode is not available everywhere, and it **fails soft**: an ineligible account drops back to standard speed with no error. Known blockers:
|
|
102
|
+
|
|
103
|
+
- **Usage credits are off.** The most common one. Run `/usage-credits` in an interactive `claude` session to enable them.
|
|
104
|
+
- **Not first-party.** Fast mode is Anthropic-API-only; Bedrock, Vertex, and Foundry are excluded.
|
|
105
|
+
- **Free tier**, or an organization that has turned fast mode off.
|
|
106
|
+
- **Cooldown.** Fast mode has its own rate limit; after a hit, Claude Code falls back to standard until it clears.
|
|
107
|
+
- `CLAUDE_CODE_DISABLE_FAST_MODE=1` in the environment turns it off outright.
|
|
108
|
+
|
|
109
|
+
Because a downgrade is otherwise invisible, and because the picker shows these IDs at 10× regardless, the plugin logs a **warning** (once per reason) when a fast turn actually ran at standard speed, naming the reason. If you see it, switch to the non-fast ID so the picker's price matches your bill.
|
|
92
110
|
|
|
93
111
|
### Picking a variant
|
|
94
112
|
|
|
@@ -299,6 +317,24 @@ recovery step for harnesses that defer MCP tool schemas. Both apply per Claude
|
|
|
299
317
|
process at spawn, and provider options are read once at opencode startup, so
|
|
300
318
|
`proxyTools` changes need a full opencode restart.
|
|
301
319
|
|
|
320
|
+
### Proxy endpoint security
|
|
321
|
+
|
|
322
|
+
The proxy is a small HTTP MCP server on an ephemeral loopback port, and calling it runs Bash, Edit and Write through opencode's executor. Since 0.13.2 it requires a 256-bit bearer token, generated per server and handed to Claude in the `headers` block of the `0600` MCP config file the plugin writes. Requests are also rejected unless the `Host` header matches the bound `127.0.0.1:<port>` authority, no `Origin` header is present, and the content type is `application/json`.
|
|
323
|
+
|
|
324
|
+
**Upgrade if you are on 0.13.1 or earlier.** Before this, any local process could post to that port and execute commands as you, and a web page you visited could do the same blind, without reading the response. Reported by @willmcginnis in [#28](https://github.com/khalilgharbaoui/opencode-claude-code-plugin/pull/28); tracked as [GHSA-3mxm-w7gf-3c5x](https://github.com/khalilgharbaoui/opencode-claude-code-plugin/security/advisories/GHSA-3mxm-w7gf-3c5x) (High, CVSS 7.5). No exploitation is known: it was found by code audit, not an incident.
|
|
325
|
+
|
|
326
|
+
**Restart every opencode you have running.** A plugin is read once, when the process starts, so an opencode you left open keeps the old code and keeps serving an unauthenticated proxy port for as long as it lives, however new the installed version is. Long-lived sessions are the ones to check:
|
|
327
|
+
|
|
328
|
+
```sh
|
|
329
|
+
lsof -nP -iTCP -sTCP:LISTEN | grep opencode
|
|
330
|
+
curl -s -o /dev/null -w '%{http_code}\n' -X POST http://127.0.0.1:PORT/mcp \
|
|
331
|
+
-H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
A patched process answers `401`. A `200` is a pre-0.13.2 process still running, and restarting it is the fix.
|
|
335
|
+
|
|
336
|
+
Nothing to configure. If proxied tools ever stop working after a Claude Code upgrade, check the plugin log for `proxy-mcp rejected a request`, which names which guard failed.
|
|
337
|
+
|
|
302
338
|
### Closing a tool with no proxy
|
|
303
339
|
|
|
304
340
|
`proxyTools` only reaches built-ins the plugin can replace. A built-in with no opencode equivalent, `NotebookEdit` today and whatever Claude Code ships next, stays enabled and unmediated no matter what you put in that list. `extraDisallowedTools` names them directly:
|
package/dist/index.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ type OpenCodeModel = {
|
|
|
31
31
|
video: boolean;
|
|
32
32
|
pdf: boolean;
|
|
33
33
|
};
|
|
34
|
-
interleaved: boolean | {
|
|
35
|
-
field: "reasoning_content" | "
|
|
34
|
+
interleaved: boolean | string | {
|
|
35
|
+
field: "reasoning" | "reasoning_content" | "reasoning_text" | string;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
cost: {
|
|
@@ -432,6 +432,8 @@ interface ClaudeStreamMessage {
|
|
|
432
432
|
type: string;
|
|
433
433
|
subtype?: string;
|
|
434
434
|
request_id?: string;
|
|
435
|
+
fast_mode_state?: "on" | "off" | "cooldown";
|
|
436
|
+
fast_mode_disabled_reason?: string;
|
|
435
437
|
event?: ClaudeStreamMessage;
|
|
436
438
|
request?: {
|
|
437
439
|
subtype?: string;
|