@khalilgharbaoui/opencode-claude-code-plugin 0.26.3 → 0.27.1
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 +30 -4
- package/dist/index.d.ts +44 -9
- package/dist/index.js +267 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/claude-code-plugin/SKILL.md +26 -9
package/package.json
CHANGED
|
@@ -107,7 +107,8 @@ Defaults below describe normal headless opencode use when the key is absent.
|
|
|
107
107
|
| `ignoreAnthropicApiKey` | boolean | `false` | Strip `ANTHROPIC_API_KEY` and `ANTHROPIC_AUTH_TOKEN` from headless/interactive spawn env, allowing stored auth to be used. Does not log in, change the parent env, or guarantee subscription billing if other CLI/cloud auth is configured. Warns at startup when either nonempty variable is present, regardless of the flag. |
|
|
108
108
|
| `idleProcessTimeoutMs` | number | unset | Kill a conversation's idle `claude` worker this many ms after a finished turn. The timer starts when a turn completes, reuse cancels it, and a worker found mid-turn when it fires is re-timed rather than killed. The session id is kept, so the next message resumes transparently. Unset or `0` keeps workers until LRU eviction (16 processes, oldest idle first). Values above `2147483647` are ignored. Not applied to the interactive transport. Deleting a chat in opencode releases its workers and session ids immediately regardless. |
|
|
109
109
|
| `turnStats` | boolean | `false` | Append one `▌ **stats:**` line to each finished turn: cost, wall duration, CLI turn count, and input/output/cache-read/cache-write tokens, taken from the CLI's own `result`. Never on a compaction turn or a turn that ended in error. Its own text part, stripped from transcripts rebuilt for the CLI, so the model never sees it. The same numbers are logged at INFO regardless, and `modelUsage` plus `permission_denials` always reach `providerMetadata`. Reported cost is the CLI's figure, not a billing guarantee. |
|
|
110
|
-
| `bridgeOpencodeSkills` | boolean | `false` | Stage the user's opencode skills for Claude's native Skill tool as `opencode-skills:<name>`, on headless, interactive and direct `doGenerate` spawns (never compaction). Requires the CLI's `--help` to advertise `--plugin-dir`; otherwise no-op. Bridged skills are also listed in opencode's forwarded system prompt, so a large skill set costs prompt tokens twice, which is why it is off by default; `true` opts the user's skills in. Bundled skill staging ignores this option, but still requires flag support and successful discovery/staging. |
|
|
110
|
+
| `bridgeOpencodeSkills` | boolean | `false` | Stage the user's opencode skills for Claude's native Skill tool as `opencode-skills:<name>`, on headless, interactive and direct `doGenerate` spawns (never compaction). Covers every root opencode reads: project `.opencode/`, `.claude/`, `.agents/` walking up, the opencode config dirs (`skill/` and `skills/`), and global `~/.claude/skills` and `~/.agents/skills` under opencode's own `OPENCODE_DISABLE_EXTERNAL_SKILLS` / `OPENCODE_DISABLE_CLAUDE_CODE_SKILLS` switches. Requires the CLI's `--help` to advertise `--plugin-dir`; otherwise no-op. Bridged skills are also listed in opencode's forwarded system prompt, so a large skill set costs prompt tokens twice, which is why it is off by default; `true` opts the user's skills in. Bundled skill staging ignores this option, but still requires flag support and successful discovery/staging. |
|
|
111
|
+
| `bridgeSkipNativeSkills` | boolean | `true` | Leave a skill unbridged when the Claude session already loads it: from `<CLAUDE_CONFIG_DIR>/skills`, the project's `.claude/skills`, or an installed plugin's `skills/`. Matched by resolved directory, by byte-identical SKILL.md, or (user/project scope only, since plugin skills are namespaced `<plugin>:<name>`) by name. A name match means `Skill("<name>")` answers from Claude's copy, not opencode's, so it is logged at WARN with both paths. The plugin scan reads `installed_plugins.json` and does not check whether the plugin is enabled. `false` bridges everything and reinstates the duplicates. |
|
|
111
112
|
| `interactive` | boolean | unset (headless) | Experimental PTY transport; explicit boolean wins over `CLAUDE_CODE_INTERACTIVE_TRANSPORT`. Needs `Bun.Terminal`; otherwise headless fallback. Compaction stays headless. Does not wire the headless proxy server or disallowed-tools controls; no equivalent opencode permission guarantee or `/btw`. The skill bridge does apply. Never enable to bypass a billing/access restriction. |
|
|
112
113
|
| `interactiveBypass` | boolean | `false` | Deprecated no-op. The TUI asks for a manual safety confirmation on `bypassPermissions`, so the plugin never passes it. |
|
|
113
114
|
| `interactiveAllowTools` | string[] | `["Bash", "Edit", "Write", "Read", "WebFetch"]` | With `interactive`: replaces the built-in pre-allow list. MCP wildcards from discovered bridge names plus `mcp__opencode_proxy__*` are added even with `[]`. Not a capability denylist; review permissions before enabling. |
|
|
@@ -392,13 +393,26 @@ streaming, interactive and direct `doGenerate` spawns, never compaction. Set `tr
|
|
|
392
393
|
only when the user asks for it, since a large skill set costs prompt tokens twice; the
|
|
393
394
|
bundled skill is staged either way. Reusing a process does not load a new skill catalog.
|
|
394
395
|
|
|
395
|
-
User roots:
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
396
|
+
User roots, in precedence order: walking from cwd to filesystem root, `.opencode/skills`
|
|
397
|
+
then `.claude/skills` then `.agents/skills` at each level; home `.opencode/skills`;
|
|
398
|
+
`OPENCODE_CONFIG_DIR/{skills,skill}`; `XDG_CONFIG_HOME/opencode/{skills,skill}` (home
|
|
399
|
+
`.config` fallback); then `~/.claude/skills` and `~/.agents/skills`. Those last two are
|
|
400
|
+
opencode's external scans and obey its own `OPENCODE_DISABLE_EXTERNAL_SKILLS` and
|
|
401
|
+
`OPENCODE_DISABLE_CLAUDE_CODE_SKILLS` variables; they are never reached through the
|
|
402
|
+
walk-up. First name wins, so a project shadows a global and an opencode-managed copy
|
|
403
|
+
shadows an external one; enabled user bridging can shadow bundled names. A skill is known
|
|
404
|
+
by the `name:` its SKILL.md frontmatter declares (directory basename when it declares
|
|
405
|
+
none or an unusable one), which is the name opencode advertises. Only immediate
|
|
406
|
+
`<name>/SKILL.md` directories are collected; arbitrary `skills.paths` and `skills.urls`
|
|
407
|
+
are not scanned.
|
|
408
|
+
|
|
409
|
+
Those roots overlap Claude's own, so `bridgeSkipNativeSkills` (on by default) drops
|
|
410
|
+
anything the session already loads rather than advertising it twice. If the user reports
|
|
411
|
+
a skill that went missing, grep `plugin.log` for `skills claude code already loads` (one
|
|
412
|
+
line naming both paths and the reason) or the `claude already registers a different
|
|
413
|
+
skill under this name` warning, and only then consider `bridgeSkipNativeSkills: false`.
|
|
414
|
+
Broad bridging can duplicate advertised skill context and exposes every discovered skill,
|
|
415
|
+
not just one.
|
|
402
416
|
|
|
403
417
|
### Change when idle workers are freed
|
|
404
418
|
|
|
@@ -548,7 +562,9 @@ commands are preserved. Do not use it as an automatic diagnostic probe.
|
|
|
548
562
|
| A config change did nothing | Options are read at startup; another opencode window is still running the old process | Fully quit every opencode window and relaunch |
|
|
549
563
|
| New plugin version or model not in the picker after upgrading | Frozen `@latest` in opencode's package cache | Remove the cache dir (recipe "Upgrade the plugin") and relaunch |
|
|
550
564
|
| `/btw` shows "Queued" or "requires an idle Claude Code session" | Plugin older than 0.15.2, or a window started before the current build | Upgrade and restart. `/btw` also needs Claude Code 2.1.258+ |
|
|
551
|
-
| Model calls `Skill("x")` and gets `Unknown skill` | Wrong namespace (`opencode-skills:x`), a CLI without `--plugin-dir`,
|
|
565
|
+
| Model calls `Skill("x")` and gets `Unknown skill` | Wrong namespace (`opencode-skills:x`), a CLI without `--plugin-dir`, a compaction turn, or `bridgeOpencodeSkills: false` | Check the namespace and `claude --help`; remove the `false` only with approval |
|
|
566
|
+
| One skill's name and description appear twice in a session | Plugin predates `bridgeSkipNativeSkills`, or it is set to `false` | Upgrade, or drop the `false` |
|
|
567
|
+
| A skill opencode lists is bridged under neither name nor namespace | `bridgeSkipNativeSkills` treated it as natively loaded (most often a plugin that is installed but disabled) | Grep `plugin.log` for `skills claude code already loads`; the line names both paths and the reason. `bridgeSkipNativeSkills: false` is the escape hatch |
|
|
552
568
|
| `Subagent failed (task_id …): Tool execution aborted` while the child finished fine | Bug fixed in 0.15.1 | Upgrade |
|
|
553
569
|
| A `subtask: true` command's subagent output is "lost" | Bug fixed in 0.15.4 | Upgrade |
|
|
554
570
|
| Two subagents run one after another | The CLI serialises MCP calls | Plugin 0.17.0+; the model must use `mcp__opencode_proxy__task_batch` |
|
|
@@ -567,6 +583,7 @@ commands are preserved. Do not use it as an automatic diagnostic probe.
|
|
|
567
583
|
| A turn ended with no answer and nothing said why | The CLI's `result` carried a failure subtype, or a rate limit was rejected | Both are now written into the transcript as `▌` lines; read the subtype or the limit reason there |
|
|
568
584
|
| A CLI tool row looks successful but its output is an error | Plugin older than this release forwarded `is_error` results as successes | Upgrade; failed CLI tools now render as failed |
|
|
569
585
|
| Claude "forgot" the earlier part of a long conversation | Claude Code compacted its own context | Look for the `▌ **context compacted:**` note in the transcript |
|
|
586
|
+
| Claude forgot the whole conversation at once | Claude Code cleared it (`/clear` sent as a message, or a plan-mode exit that clears context) | Look for the `▌ **claude code reset:**` note. The plugin does not replay history there on purpose; a new opencode session gets a clean slate |
|
|
570
587
|
| Wanting the per-turn cost in the chat | Not shown by default | Set `turnStats: true` and restart opencode |
|
|
571
588
|
| Turn ends with an error naming an exit code or signal and a stderr tail | The `claude` child died mid-turn without emitting its terminal `result` | Read the quoted stderr; that is the CLI's own reason. Older builds reported this as a normal stop, so a truncated answer looked finished |
|
|
572
589
|
| An answer is cut off with no error, in a window with many open chats | Plugin older than this fix: LRU eviction could kill a process mid-turn | Upgrade. Eviction now takes the oldest idle process and skips the round when all 8 are busy; the 30-minute idle timer spares a busy worker too |
|