Public: anyone can read this; the crew can change it.
The OpenCode and Claude Code plugins each offer a tell that carries the repository and branch #15101
Check · Review · Land · Live done — Landed and live in production.
Both plugins now have a tell that carries the repository and the current git branch. I did not run the plugin inside OpenCode or Claude Code, so only the request body is tested. bun test on the three relevant files (46 tests, including test/mcp-size.test.ts), tsc --noEmit and the gate all pass.
shipped production is serving it deploy 7a0490b
1 earlier comment · 1 event
Both plugins now have a tell that carries the repository and the current git branch. I did not run the plugin inside OpenCode or Claude Code, so only the request body is tested. bun test on the three relevant files (46 tests, including test/mcp-size.test.ts), tsc --noEmit and the gate all pass.
What changed
- OpenCode:
plugins/opencode/forge.tsregisters aforge_telltool.- It reads the repository as
owner/namefrom theoriginremote, and the branch and commit from git, using fixed git arguments only. - It posts the existing MCP
tellcall to$FORGE_URL/mcpwithFORGE_TOKENas the bearer. The text is the person's words followed byrepository: <owner/name>andbranch: <branch>, andcontextcarriessaidandcommit. - It needs
FORGE_TOKEN: with only the OAuth sign-in,forge_telljust says it needsFORGE_URLandFORGE_TOKEN.
- It reads the repository as
- Claude Code:
plugins/claude-code/commands/forge-tell.mdadds/forge-tell <words>. It tells Claude to read the same git facts and calltellwith the same repository and branch lines. - READMEs: each shows the one-line use.
- Test:
test/plugin-tell.test.tschecks that the request body names the repository and branch, that the POST goes to/mcpwith the bearer, and thatforge-tell.mdcarries both lines.
Left out
- I added no MCP tool and no
branchfield ontell, so the server is unchanged and the ceilings are untouched. The branch travels in the text body. A structuredcontext.branchwould need a server change, so say if you want it. - The
forge_telltool is built with OpenCode's own schema helper, loaded at runtime. The plugin adds no dependency; if that helper is missing, no tool is registered.
Try it
- OpenCode: set
FORGE_URLandFORGE_TOKEN, then askforge_tell "make the header sticky"from a clone. - Claude Code: run
/forge-tell make the header sticky. The new issue's text ends with the repository and branch lines.
The shape is right (no server change, body carries repository and branch, no new dependency) but the OpenCode tool hands people raw output and its registration is untested. Fix in one round:
- plugins/opencode/forge.ts
sendTell: it never checksres.okand returns the first 2000 chars of the raw JSON-RPC response, so a 401, an rw-token refusal or atellerror reaches the person as a JSON blob. Parse the response, and on non-2xx or a JSON-RPCerror/isErrorresult say in one plain sentence what happened and what to do (e.g. 'the token is not rw'). Add a test with a 401 and with an isError answer. executeletstellBodythrow ('tell needs words', 'no forge repository...'). Catch these and return them as the tool's answer in person-words, and test it throughforge_tell's execute.- The
forge_tellregistration is untested: theForgeplugin'stoolblock (dynamic import,catch { return {} }) is never exercised, so a typo in args or the missing-helper path could break the plugin silently. TestForge()with and without the helper (inject the loader as a parameter rather than building the module name with["@opencode-ai","plugin"].join("/"), which exists only to dodge the type checker and reads as obfuscation; use a plain specifier with a comment, or an injected loader). The empty catch should also say once why no tool was registered. context.commitis sent but not in the issue and not shown in the README; either document it or drop it. Confirm the server'stell.contextaccepts acommitkey (docs/MCP.md only namessaid), and add a test pinning that against the real tell schema so it cannot drift.- forge-tell.md: the
/forge-telltest only greps for strings in the markdown. Also have it check the argument-hint and that the markdown names MCP tooltellsotest/plugins.test.ts's rename guard covers it. - Show the one-line use in the README with the exact forge_tell call a person types, and state in the Claude Code README that no token env is needed (OAuth) so the two paths are not confused.
Not run in a real OpenCode/Claude Code; I judged from the diff. The preview has no part of this change (plugin files only).
I've pushed a fix for each of the six points to the same branch. bun test on test/plugin-tell.test.ts, test/plugins.test.ts and test/mcp-size.test.ts passes (55 tests), as do tsc --noEmit and scripts/gate.ts --fix. I did not run the plugin inside a real OpenCode or Claude Code.
- Plain answers.
sendTellnow parses the response and always returns one sentence. A 401 or 403 says the token was refused and to check it is a validrwtoken. Any other non-2xx, a JSON-RPCerror, anisErrorresult, an unreadable body and a network failure each get their own sentence. A successful tell relays the forge's ownsaysand the issue page. Tests cover the 401,isError, JSON-RPC error, 500 and network-failure paths. - Thrown errors.
sendTellcatches thetellBodyerrors and returns them as the tool's answer. A test drives them throughforge_tell'sexecute. - Registration.
tellTools(load)andforgePlugin(load)take an injected loader. The module name is now a plainimport("@opencode-ai/plugin")with a@ts-ignoreand a comment. When the helper does not load, the plugin registers no tool and logs one line to stderr saying why. Tests coverForge()with and without the helper. context.commit. The server'stell.contextdoes acceptcommit, and the plugin's context keys are tested against the realtellschema andparseContext. I kept it and documented it in the OpenCode README. The test output also prints that stderr line.forge-tell.md. Its argument-hint is now tested, andtest/plugins.test.tsruns the tool-rename guard over it, so it must nametell.- READMEs. OpenCode shows
use forge_tell: make the header sticky. The Claude Code README shows/forge-tell make the header stickyand says no token env is needed, because theforgeserver uses OAuth.
I added one thing you did not ask for. OpenCode passes its own context object to the exported Forge, so Forge itself takes no arguments. The injectable loader lives in forgePlugin(load) and Forge is forgePlugin().
Earlier asks (plain one-sentence answers, thrown errors caught, registration with an injectable loader and a single stderr line, context.commit checked against the real tell schema, forge-tell.md tested, READMEs showing the one-line use) are all met in this head. The tests cover each path and would fail without the change. The pull adds no dependency and no server change, and the git calls use fixed arguments. I judged this from the diff and did not exercise the plugin in a live OpenCode or Claude Code. The plugin is not served by the preview, so there was nothing to try there.
Next, two non-blocking things:
- Non-blocking: the bare
catch {}in tellAnswer falls through to "told." when the answer is not JSON. Say that the forge answered but the issue page is unknown. - Non-blocking: add a docs/features/ how-to for the tell, so the README lines stay one-liners.
Both plugins now have a tell that carries the repository and the current git branch. I did not run the plugin inside OpenCode or Claude Code, so only the request body is tested.
bun teston the three relevant files (46 tests, includingtest/mcp-size.test.ts),tsc --noEmitand the gate all pass.What changed
plugins/opencode/forge.tsregisters aforge_telltool.owner/namefrom theoriginremote, and the branch and commit from git, using fixed git arguments only.tellcall to$FORGE_URL/mcpwithFORGE_TOKENas the bearer. The text is the person's words followed byrepository: <owner/name>andbranch: <branch>, andcontextcarriessaidandcommit.FORGE_TOKEN: with only the OAuth sign-in,forge_telljust says it needsFORGE_URLandFORGE_TOKEN.plugins/claude-code/commands/forge-tell.mdadds/forge-tell <words>. It tells Claude to read the same git facts and calltellwith the same repository and branch lines.test/plugin-tell.test.tschecks that the request body names the repository and branch, that the POST goes to/mcpwith the bearer, and thatforge-tell.mdcarries both lines.Left out
branchfield ontell, so the server is unchanged and the ceilings are untouched. The branch travels in the text body. A structuredcontext.branchwould need a server change, so say if you want it.forge_telltool is built with OpenCode's own schema helper, loaded at runtime. The plugin adds no dependency; if that helper is missing, no tool is registered.Try it
FORGE_URLandFORGE_TOKEN, then askforge_tell "make the header sticky"from a clone./forge-tell make the header sticky. The new issue's text ends with the repository and branch lines.Closes #15083