An OpenCode TUI plugin that opens an interactive mini temporary session for side questions, with full session context and multi-turn conversation.
output2.mp4
Press alt+b (or run /mini from the command palette) during any OpenCode session. A popup overlay opens immediately with a text input at the bottom. Type a question and press Enter to send it. The plugin:
- Gathers context from the current session (token-limited)
- Creates a temporary isolated session with that context
- Sends your question to the AI and streams the response
- Lets you ask follow-up questions in the same mini session
- Optionally injects the full mini-session transcript back into the main thread
- Deletes the ephemeral session on close
| Key | Action |
|---|---|
alt+b (configurable) |
Toggle mini session overlay |
/mini |
Open mini session (command palette) |
/mini-model |
Change model for future mini sessions |
| Key | Action |
|---|---|
enter |
Send question / follow-up |
shift+enter |
Inject mini transcript into the main thread |
alt+b (configurable) |
Hide overlay (resumable) |
tab |
Change the model for the next question |
esc / ctrl+c |
Cancel and close |
Add to your OpenCode TUI config (~/.config/opencode/tui.json):
{
"plugin": [
"opencode-mini-session"
]
}OpenCode installs it automatically with Bun on startup.
All options are optional. Defaults are shown below.
| Option | Type | Default | Description |
|---|---|---|---|
model |
string | null |
null |
Override model as providerID/modelID, for example "anthropic/claude-sonnet-4.6". null auto-detects from the current session. |
agent |
string | null |
null |
null or omitted uses plugin-managed mini mode. A string uses an existing OpenCode agent by name. |
tokenLimit |
number |
50000 |
Maximum tokens of session context to include. |
keybind |
string | false |
"alt+b" |
Global keybind. Set to false or "none" to disable. |
allowedTools |
string[] | null |
null |
Deprecated. Use custom OpenCode agents for custom permissions. |
If you want to customize the plugin, your config should look something like this:
{
"plugin": [
["opencode-mini-session", {
"model": "anthropic/claude-sonnet-4.6",
"tokenLimit": 10000,
"keybind": "alt+m",
"agent": "build",
...
}]
]
}If agent is not set or is invalid, mini uses a plugin managed custom mini agent with read only tools: glob, grep, list, read, and webfetch.
To customize permissions, tone, instructions, or other behavior, set agent to an existing OpenCode agent name. The plugin will use that agent's settings directly.
See the OpenCode agent docs for more info on custom agent setup.
For example, configure mini to use a custom pirate agent:
{
"plugin": [
["opencode-mini-session", { "agent": "pirate" }]
]
}The mini session receives the main session's conversation as plain text:
- User questions
- Assistant responses
- Tool calls summarized inline (name + up to 4 input params, e.g.
[tool: read path=src/foo.ts])
Oldest messages are dropped to fit the tokenLimit, and the result is injected into the system prompt inside <session-context> tags.
Older versions may stay cached by OpenCode. To force a fresh install, close OpenCode, remove the cached npm plugin package, then start OpenCode again.
Linux and macOS:
rm -rf ~/.cache/opencode/node_modules/opencode-mini-session
opencodeWindows PowerShell:
Remove-Item -Recurse -Force "$HOME\.cache\opencode\node_modules\opencode-mini-session"
opencodeFor more information, see the official OpenCode docs for npm plugins and plugin cache and configuration locations.
