explaingit

karamanliev/opencode-mini-session

13TypeScriptAudience · developerComplexity · 2/5ActiveSetup · easy

TLDR

A side-chat plugin for OpenCode that lets you ask quick follow-up questions without cluttering your main coding session, with context from the conversation history.

Mindmap

mindmap
  root((repo))
    What it does
      Side chat overlay
      Context-aware replies
      Temporary isolated thread
    Key features
      Alt+B hotkey
      Token budget trimming
      Model switching
      Inject back option
    Use cases
      Quick clarifications
      Tangential questions
      Follow-ups without context loss
    Tech stack
      TypeScript
      OpenCode plugin
      Terminal UI

Things people build with this

USE CASE 1

Ask a quick follow-up question mid-session without losing context or cluttering the main thread.

USE CASE 2

Explore a tangential idea or debug a side issue while keeping your main conversation intact.

USE CASE 3

Get clarification on a specific point and optionally merge the answer back into your main session.

Tech stack

TypeScriptOpenCode

Getting it running

Difficulty · easy Time to first run · 5min

Add one entry to ~/.config/opencode config file; no external dependencies or API keys required.

License information not provided in the explanation.

In plain English

opencode-mini-session is a small plugin for OpenCode, an open-source terminal AI coding assistant. The plugin solves a specific workflow problem: you are deep in a long coding session with the AI, and a side question pops into your head that you do not want to clutter the main thread with. Pressing alt+b, or typing /mini in the command palette, pops up a small overlay window with a text input. You ask the side question there, get an answer, and the main conversation is left untouched. The overlay is not a fresh chat. The plugin first reads the current session's history, including user questions, assistant replies, and short summaries of any tool calls the AI ran. That text is then trimmed to fit a configurable token budget, by default 50000 tokens, and wrapped in a session-context block placed in the side conversation's system prompt. The result is that the mini session knows what was being discussed when you opened it, so a follow-up like why does that approach not work makes sense without having to re-explain. The mini session itself is a temporary isolated thread. Replies stream in as they arrive. You can ask several follow-up questions inside the popup. When you close it, the ephemeral session is deleted. There is also an option to inject the full mini-session transcript back into the main thread if you decide the side conversation was useful enough to keep. Several keys are bound inside the overlay: enter sends the question, alt+b hides the overlay so you can come back to it later, tab switches the model for the next question, and esc or ctrl+c cancels and closes. A command called /mini-model changes the model used for future mini sessions. The plugin is installed by adding an entry to the OpenCode TUI config file under ~/.config/opencode. Options include the model identifier, the token limit, the trigger keybind, and the list of tools the mini agent is allowed to call. The tool list defaults to read-only operations such as glob, grep, list, read, and webfetch.

Copy-paste prompts

Prompt 1
I'm using OpenCode with the mini-session plugin. How do I set up the keybind to alt+b and configure the token budget to 30000?
Prompt 2
Show me how to change which tools the mini session can call, I only want it to use read and grep, not webfetch.
Prompt 3
I asked a useful follow-up question in a mini session. How do I inject that conversation back into my main thread?
Prompt 4
What's the difference between pressing alt+b to hide the overlay versus esc to close it completely?
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.