@khalilgharbaoui/opencode-claude-code-plugin 0.9.1 → 0.9.3
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 +7 -31
- package/dist/index.js +26 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,10 +73,12 @@ The plugin auto-registers the following. They appear in the model picker without
|
|
|
73
73
|
| `claude-haiku-4-5` | Claude Haiku 4.5 | 200k | 8,192 | – | 1× |
|
|
74
74
|
| `claude-sonnet-4-5` | Claude Sonnet 4.5 | 1M | 16,384 | low/medium/high/xhigh/max | 3× |
|
|
75
75
|
| `claude-sonnet-4-6` | Claude Sonnet 4.6 | 1M | 16,384 | low/medium/high/xhigh/max | 3× |
|
|
76
|
+
| `claude-sonnet-5` | Claude Sonnet 5 | 1M | 128,000 | low/medium/high/xhigh/max | 2×* |
|
|
76
77
|
| `claude-opus-4-5` | Claude Opus 4.5 | 1M | 16,384 | low/medium/high/xhigh/max | 5× |
|
|
77
78
|
| `claude-opus-4-6` | Claude Opus 4.6 | 1M | 16,384 | low/medium/high/xhigh/max | 5× |
|
|
78
79
|
| `claude-opus-4-7` | Claude Opus 4.7 | 1M | 16,384 | low/medium/high/xhigh/max | 5× |
|
|
79
80
|
| `claude-opus-4-8` | Claude Opus 4.8 | 1M | 16,384 | low/medium/high/xhigh/max | 5× |
|
|
81
|
+
| `claude-opus-5` | Claude Opus 5 | 1M | 128,000 | low/medium/high/xhigh/max | 5× |
|
|
80
82
|
| `claude-fable-5` | Claude Fable 5 | 1M | 16,384 | low/medium/high/xhigh/max | 10× |
|
|
81
83
|
| `claude-mythos-5` | Claude Mythos 5 | 1M | 16,384 | low/medium/high/xhigh/max | 10× |
|
|
82
84
|
|
|
@@ -84,7 +86,7 @@ The plugin auto-registers the following. They appear in the model picker without
|
|
|
84
86
|
|
|
85
87
|
Capabilities for every model: text + image input, text output, tool use, attachments. No temperature control, no PDF/audio/video, no interleaved streaming.
|
|
86
88
|
|
|
87
|
-
**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
|
|
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 — 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 $10/$50 = 10×), so **Fable 5 and Mythos 5 cost 2× 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.
|
|
88
90
|
|
|
89
91
|
The model ID is passed straight through to `claude --model`, so anything Claude Code accepts works.
|
|
90
92
|
|
|
@@ -94,37 +96,11 @@ Variants set the underlying reasoning effort. They're regular opencode model var
|
|
|
94
96
|
|
|
95
97
|
---
|
|
96
98
|
|
|
97
|
-
## Billing
|
|
98
|
-
|
|
99
|
-
This plugin drives Claude Code headlessly (`claude --print`), which Anthropic bills as [`claude -p` / Agent SDK usage](https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan). Starting **June 15, 2026**, on subscription plans that usage no longer counts toward your normal plan limits — it draws from a separate monthly **Agent SDK credit**:
|
|
100
|
-
|
|
101
|
-
| Plan | Monthly credit |
|
|
102
|
-
|---|---|
|
|
103
|
-
| Pro | $20 |
|
|
104
|
-
| Max 5x | $100 |
|
|
105
|
-
| Max 20x | $200 |
|
|
106
|
-
| Team (Standard seats) | $20 |
|
|
107
|
-
| Team (Premium seats) | $100 |
|
|
108
|
-
| Enterprise (usage-based) | $20 |
|
|
109
|
-
| Enterprise (seat-based Premium seats) | $200 |
|
|
110
|
-
|
|
111
|
-
Credits are **per user, not pooled** across a team, and Standard seats on seat-based Enterprise plans aren't eligible. See Anthropic's [Agent SDK credit article](https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan) for the authoritative table.
|
|
112
|
-
|
|
113
|
-
What this means for plugin users:
|
|
114
|
-
|
|
115
|
-
- **Claim the credit once.** It's a one-time opt-in via your Claude account; eligible users get an email with claim instructions before June 15, 2026. After that it refreshes every billing cycle, and unused credit does not roll over.
|
|
116
|
-
- **Agent SDK usage drains the credit first**, before any other source.
|
|
117
|
-
- **When the credit runs out, plugin requests stop** until the next billing cycle — unless you enable usage credits in your Claude account, in which case overflow is billed at standard API rates.
|
|
118
|
-
- **The credit is denominated in dollars at standard API rates**, so the Price × column above maps directly to how fast each model drains it — Fable 5 / Mythos 5 burn it 10× faster than Haiku, 2× faster than Opus 4.8.
|
|
119
|
-
- **API-key auth is unaffected.** If your `claude` CLI authenticates with an Anthropic API key / Console billing instead of a subscription, nothing changes — pay-as-you-go as before.
|
|
120
|
-
- **Watch for a stray `ANTHROPIC_API_KEY`.** If that variable (or `ANTHROPIC_AUTH_TOKEN`) is present in your environment, Claude Code uses it and bills pay-as-you-go — silently bypassing the subscription credit even when `claude` is logged into a plan. The plugin logs a one-time warning when it detects a key. To force subscription auth, set `ignoreAnthropicApiKey: true`, which strips the key from the `claude` spawn environment.
|
|
121
|
-
- **Interactive Claude Code in your terminal is unaffected.** The change targets programmatic usage only: the Agent SDK, `claude -p`, Claude Code GitHub Actions, and third-party apps like this plugin.
|
|
122
|
-
|
|
123
|
-
Two related dates:
|
|
124
|
-
|
|
125
|
-
- **June 15, 2026** also retires the original Claude 4 model IDs `claude-sonnet-4-20250514` and `claude-opus-4-20250514` from the API. The plugin doesn't register either, but model IDs pass straight through to `claude --model` — if you've configured one of these as an override, migrate to `claude-sonnet-4-6` / `claude-opus-4-8` before then.
|
|
126
|
-
- **June 22, 2026** is the last day [Fable 5 is included at no extra cost](https://platform.claude.com/docs/en/about-claude/models/introducing-claude-fable-5-and-claude-mythos-5) on Pro, Max, Team, and seat-based Enterprise plans. From June 23, `claude-fable-5` requires usage credits (Anthropic says it aims to fold it back into plans once capacity allows). `claude-mythos-5` is unaffected — it's Glasswing access-gated either way.
|
|
99
|
+
## Billing
|
|
127
100
|
|
|
101
|
+
This plugin drives Claude Code headlessly (Agent SDK > `claude --print`)
|
|
102
|
+
check out this page for updated information about billing: https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan
|
|
103
|
+
|
|
128
104
|
---
|
|
129
105
|
|
|
130
106
|
## Configuration
|
package/dist/index.js
CHANGED
|
@@ -2583,7 +2583,7 @@ function isAskUserQuestionTool(name) {
|
|
|
2583
2583
|
const n = name.toLowerCase();
|
|
2584
2584
|
return n === "askuserquestion" || n === "ask_user_question";
|
|
2585
2585
|
}
|
|
2586
|
-
var ASK_USER_QUESTION_DENY_MESSAGE = "Your question and its options have already been presented to the operator verbatim. Stop now: end your turn without calling any more tools and without answering the question yourself.
|
|
2586
|
+
var ASK_USER_QUESTION_DENY_MESSAGE = "Your question and its options have already been presented to the operator verbatim. This is NOT a cancellation or a refusal \u2014 the operator simply has not answered yet. Stop now: end your turn without calling any more tools and without answering the question yourself. Do not say the question was cancelled, skipped, or declined, and do not guess, assume, or proceed on their behalf. Wait for the operator's reply, which arrives as the next user message.";
|
|
2587
2587
|
function denyMessageForTool(toolName, configuredDenyMessage) {
|
|
2588
2588
|
if (isAskUserQuestionTool(toolName)) return ASK_USER_QUESTION_DENY_MESSAGE;
|
|
2589
2589
|
return configuredDenyMessage ?? `Denied by opencode-claude-code policy for tool ${toolName}`;
|
|
@@ -2659,6 +2659,7 @@ function shouldAutoContinueIncompleteTurn(state, snapshot) {
|
|
|
2659
2659
|
if (state.enabled === false) return { continue: false, reason: "disabled" };
|
|
2660
2660
|
if (snapshot.isError) return { continue: false, reason: "error" };
|
|
2661
2661
|
if (state.aborted) return { continue: false, reason: "aborted" };
|
|
2662
|
+
if (state.sawAskUserQuestion) return { continue: false, reason: "question" };
|
|
2662
2663
|
if (snapshot.stopReason) {
|
|
2663
2664
|
return {
|
|
2664
2665
|
continue: false,
|
|
@@ -4114,6 +4115,7 @@ ${plan}
|
|
|
4114
4115
|
} catch {
|
|
4115
4116
|
}
|
|
4116
4117
|
if (isAskUserQuestionTool(tc.name)) {
|
|
4118
|
+
autoContinueState.sawAskUserQuestion = true;
|
|
4117
4119
|
const askId = startTextBlock();
|
|
4118
4120
|
controller.enqueue({
|
|
4119
4121
|
type: "text-delta",
|
|
@@ -4809,6 +4811,7 @@ function defineModel(opts) {
|
|
|
4809
4811
|
}
|
|
4810
4812
|
var haikuCost = { input: 1e-6, output: 5e-6, cacheRead: 1e-7, cacheWrite: 125e-8 };
|
|
4811
4813
|
var sonnetCost = { input: 3e-6, output: 15e-6, cacheRead: 3e-7, cacheWrite: 375e-8 };
|
|
4814
|
+
var sonnet5Cost = { input: 2e-6, output: 1e-5, cacheRead: 2e-7, cacheWrite: 25e-7 };
|
|
4812
4815
|
var opusCost = { input: 5e-6, output: 25e-6, cacheRead: 5e-7, cacheWrite: 625e-8 };
|
|
4813
4816
|
var fableCost = { input: 1e-5, output: 5e-5, cacheRead: 1e-6, cacheWrite: 125e-7 };
|
|
4814
4817
|
function toConfigModel(model) {
|
|
@@ -4877,6 +4880,17 @@ var defaultModels = {
|
|
|
4877
4880
|
multiplier: 3,
|
|
4878
4881
|
releaseDate: "2025-06-19"
|
|
4879
4882
|
}),
|
|
4883
|
+
"claude-sonnet-5": defineModel({
|
|
4884
|
+
id: "claude-sonnet-5",
|
|
4885
|
+
name: "Claude Sonnet 5",
|
|
4886
|
+
family: "sonnet",
|
|
4887
|
+
reasoning: true,
|
|
4888
|
+
context: 1e6,
|
|
4889
|
+
output: 128e3,
|
|
4890
|
+
cost: sonnet5Cost,
|
|
4891
|
+
multiplier: 2,
|
|
4892
|
+
releaseDate: "2026-06-30"
|
|
4893
|
+
}),
|
|
4880
4894
|
"claude-opus-4-5": defineModel({
|
|
4881
4895
|
id: "claude-opus-4-5",
|
|
4882
4896
|
name: "Claude Opus 4.5",
|
|
@@ -4921,6 +4935,17 @@ var defaultModels = {
|
|
|
4921
4935
|
multiplier: 5,
|
|
4922
4936
|
releaseDate: "2026-05-28"
|
|
4923
4937
|
}),
|
|
4938
|
+
"claude-opus-5": defineModel({
|
|
4939
|
+
id: "claude-opus-5",
|
|
4940
|
+
name: "Claude Opus 5",
|
|
4941
|
+
family: "opus",
|
|
4942
|
+
reasoning: true,
|
|
4943
|
+
context: 1e6,
|
|
4944
|
+
output: 128e3,
|
|
4945
|
+
cost: opusCost,
|
|
4946
|
+
multiplier: 5,
|
|
4947
|
+
releaseDate: "2026-07-24"
|
|
4948
|
+
}),
|
|
4924
4949
|
"claude-fable-5": defineModel({
|
|
4925
4950
|
id: "claude-fable-5",
|
|
4926
4951
|
name: "Claude Fable 5",
|