opencode-concise
v0.1.1
Published
OpenCode plugin that appends a fixed concise-communication instruction to every session's system prompt.
Maintainers
Readme
opencode-concise
An OpenCode plugin that appends one fixed concise-communication instruction to every session's system prompt, so the agent reports results instead of narrating its process.
Install
OpenCode installs npm plugins automatically at startup. Add the package to the plugin array in your project's opencode.json — or in the global ~/.config/opencode/opencode.json to enable it everywhere:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-concise"]
}Restart OpenCode. Every session then gets the default compact policy.
To pin a version, use an npm specifier:
{
"plugin": ["[email protected]"]
}Options
Pass options as a [name, options] tuple:
{
"plugin": [
["opencode-concise", { "level": "balanced" }]
]
}| Option | Type | Default | Description |
| ------- | ------------------------------------------- | ----------- | -------------------------------------------------- |
| level | "compact" \| "balanced" \| "expansive" | "compact" | Which communication policy to inject. |
| bypass| boolean | false | Load the plugin but do no work. |
| log | boolean | false | Log one info entry per policy injection. |
Levels
level is resolved once at plugin-load time and stays fixed for the lifetime of the plugin. Unknown values fall back to compact.
- compact (default) — results only, at most three lines:
Communication: concise. Results only. No preamble, no process narration, no praise, no summaries. Omit optional information. Stay silent during routine work. Do not narrate actions, intentions, tool calls, searches, edits, or tests. Do not reduce detail in task artifacts. Reply in three lines or fewer unless correctness requires more.
- balanced — results, decisions, and brief explanations:
Communication: concise. Report results, decisions, blockers, unexpected findings, and requests for input. Briefly explain decisions when they matter. Do not narrate routine tool work. Do not reduce detail in task artifacts.
- expansive — context, explanations, options, natural prose:
Communication: expansive. Include context, explanations, options, and natural prose. Prefer prose over terse lists when the user benefits from seeing the reasoning. Do not affect detail in task artifacts.
Bypass
bypass: true keeps the plugin installed while disabling its effect: the system-transform hook becomes a no-op and never mutates output.system. Unlike removing the entry, the plugin still loads and registers its hooks.
Logging
log: true emits one info-level entry through OpenCode's log channel on each actual policy injection (service concise-plugin, message [concise-plugin] injected policy (level=<level>)). The default is silent, and nothing is logged on the bypass path or when the instruction is already present.
How it works
On every session the plugin inserts the instruction as a new entry at index 1 of output.system — directly after the primary system block. The entry's first line is the marker [concise-communication], the second names the configured level (Level: <name>), and the rest is the level-specific policy text.
The insertion is guarded: if any segment of output.system already contains [concise-communication], the hook returns without changing the array, so the instruction is never duplicated across nested transformers or repeat invocations.
Backend caveat. This plugin targets the common OpenCode backend that joins the system-prompt entries into a single string verbatim. Strict single-system backends — one entry, no concatenation, as with some OpenAI-compatible deployments (e.g. Qwen/vLLM) — can reject or ignore requests that carry multiple system entries, so on those backends the extra entry at index 1 may not be visible. Multi-system backends that concatenate segments get exactly one copy of the instruction, never two.
Compatibility
The plugin pins its runtime dependency on @opencode-ai/[email protected], because it relies on the experimental.chat.system.transform hook. The experimental.* hook surface may change between OpenCode releases; the pinned version keeps it locked.
Development
npm install
npm run build # tsc -> dist/
npm run typecheck
npm test # or: bun test src/index.test.tsThe unit tests assert that the plugin registers the experimental.chat.system.transform hook (and no text-rewriting hooks) and that invoking the hook appends the instruction to a mock system prompt.
This repository consumes its own plugin through a local loader at .opencode/plugins/concise.js, which re-exports the built bundle from dist/index.js, rather than through the npm plugin: array — so the effect is verifiable without publishing. Rebuild after changing src/.
License
MIT © Andrés Sommariva
