Skip to content

bscholar-tt/opencode-btw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-btw

A BTW (by the way) side-conversation plugin for OpenCode. Inspired by pi-btw.

Ask parallel side questions in isolated sessions without polluting your main agent context.

How it works

Each /btw command creates (or reuses) a dedicated sub-session. Questions are answered by a focused assistant that optionally receives the recent main session context for background. The main agent never acts on BTW exchanges unless you explicitly inject them.

Installation

Local (project-level):

Copy src/index.ts to .opencode/plugins/btw.ts in your project, then install deps:

cd .opencode && bun add @opencode-ai/plugin @opencode-ai/sdk

Global:

cp src/index.ts ~/.config/opencode/plugins/btw.ts
cd ~/.config/opencode && bun add @opencode-ai/plugin @opencode-ai/sdk

NPM (once published):

// opencode.json
{
  "plugin": ["opencode-btw"]
}

Commands

Command Description
/btw <question> Ask a side question. Result stored in BTW thread.
/btw --save <question> Ask and immediately inject the Q&A into main context.
/btw:new <question> Clear current thread and start fresh.
/btw:tangent <question> Ask a contextless question (no main session context passed).
/btw:inject [instructions] Inject full BTW thread into main session as context.
/btw:summarize [instructions] Summarize BTW thread and inject summary into main session.
/btw:clear Discard the current BTW thread.
/btw Show status of active BTW thread.

Workflow example

# Ask a quick side question while working on a feature
/btw what's the difference between ReadableStream and AsyncIterator in Node 20?

# Continue main work ... later, when it's relevant:
/btw:inject

# Or get a concise summary injected
/btw:summarize focus on the performance implications

Differences from pi-btw

Feature pi-btw opencode-btw
TUI modal overlay ❌ (no plugin TUI API in OpenCode)
Isolated sub-session
Main context inheritance
Tangent mode
Thread persistence (reload) ❌ (in-memory only)
Inject / summarize
Model/thinking override ❌ (use opencode model picker)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors