Skip to content

Latest commit

 

History

21 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

opencode-prompt-history

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.

Prompt history Ctrl+R flow

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.

Requirements

  • OpenCode 1.18.8 or newer
  • Git on PATH to install the git+https package
  • Bun for development only

Install

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.

Controls

  • Ctrl+R: open prompt history
  • Type: filter prompts
  • Up / Down or Ctrl+P / Ctrl+N: move through results
  • Enter: insert the selected prompt
  • Escape: close without selecting

Privacy and compatibility

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.

Development

bun install
bun test
bun run typecheck

License

MIT

About

Adds fzf-like Ctrl+R search across recent OpenCode prompt history.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages