OpenCode does not provide an fzf-like searchable prompt history. This TUI plugin
adds Ctrl+R search across prompts from up to the 50 most recently active
non-archived sessions in projects opened by OpenCode.
Prompts appear in OpenCode's native searchable list, newest first. Exact prompt
text is deduplicated, keeping its newest occurrence. Selecting a prompt inserts
it into the active editor without submitting it; supported file attachments and
agent references are retained when their saved metadata is valid.
Recoverable subtask commands appear as /<command>; OpenCode does not persist
their original arguments, so those cannot be restored.
- OpenCode 1.18.8 or newer
- Git on
PATHto install thegit+httpspackage - Bun for development only
Add the plugin to tui.json, not opencode.json. The plugin intentionally takes
priority over OpenCode's default Ctrl+R session rename binding, so remap session
rename at the same time:
{
"$schema": "https://opencode.ai/tui.json",
"plugin": [
[
"opencode-prompt-history@git+https://github.com/dimaunx/opencode-prompt-history.git",
{ "sessionLimit": 50 }
]
],
"keybinds": {
"session_rename": "<leader>shift+r"
}
}Restart OpenCode after updating the file.
sessionLimit is optional and defaults to 50. It must be a positive integer;
invalid values also use the default.
Ctrl+R: open prompt history- Type: filter prompts
Up/DownorCtrl+P/Ctrl+N: move through resultsEnter: insert the selected promptEscape: close without selecting
The plugin uses only OpenCode's stable project, session, message, and TUI APIs. It does not read SQLite or other private files and does not use experimental APIs. Prompt data stays local to OpenCode; the plugin neither logs prompts nor sends them elsewhere.
Archived sessions are excluded. Inaccessible projects or sessions are skipped and reported by count without exposing prompt contents.
History is scanned on demand from up to the configured number of most recently active non-archived sessions with bounded message-loading concurrency. No persistent index or cache is created.
bun install
bun test
bun run typecheck