Preview OpenCode sessions with fzf in a tmux popup.
# Add to .tmux.conf
set -g @plugin 'den-tanui/opencode-sessions'
# Reload tmux config
tmux source-file ~/.tmux.confThen press Prefix + I to install the plugin.
# Clone somewhere
git clone https://github.com/den-tanui/opencode-sessions ~/.local/share/tmux/opencode-sessions
# Add to tmux.conf
bind-key -n "o" run-shell -b "~/.local/share/tmux/opencode-sessions/bin/opencode_sessions.sh --tmux --width '80%' --height '80%' --days '7'"- 🔍 Fuzzy search across session titles and directories
- 📁 Directory view — group sessions by project directory
- 🎨 Rich preview — session metadata, last message, modified files
- 🖥️ Tmux popup — press
oto open sessions in a floating window - ⌨️ Keyboard-driven — full fzf navigation
- opencode CLI must have been run at least once to create the database (
~/.local/share/opencode/opencode.db) - fzf installed (
brew install fzforapt install fzf) - sqlite3 installed
Run directly in your terminal:
# Just sessions
./bin/opencode_sessions.sh
# As directories
./bin/opencode_sessions.sh --directories
# Filter by directory
./bin/opencode_sessions.sh --dir ~/projects/myappPress Prefix + o (or your custom key) to open the sessions browser.
| Key | Action |
|---|---|
Enter |
Resume selected session |
Alt+D |
Toggle sessions ↔ directories view |
Alt+Y |
Copy session ID to clipboard |
Ctrl+O |
Open in new tmux window |
? |
Toggle preview |
↑/↓ |
Navigate |
# List sessions
./bin/opencode_sessions.sh --list
# Show directories instead of sessions
./bin/opencode_sessions.sh --directories
# Filter by directory
./bin/opencode_sessions.sh --dir /path/to/project
# Limit by days
./bin/opencode_sessions.sh --days 14
# Show all sessions (no time filter)
./bin/opencode_sessions.sh --all
# Run in tmux popup
./bin/opencode_sessions.sh --tmux --width 80% --height 80%Configure in tmux.conf:
# Days to show (default: 7)
set -g @opencode-sessions-days "14"
# Popup size (default: 80%)
set -g @opencode-sessions-popup-width "80%"
set -g @opencode-sessions-popup-height "80%"
# Show border (default: false)
set -g @opencode-sessions-popup-border "true"
# Key binding (default: o)
set -g @opencode-sessions-key "s"No sessions found
- Make sure you've run opencode at least once
- Use
--allto show sessions regardless of age
Popup doesn't appear
- Check that
@opencode-sessions-keyis set to an unbound key - Try with
--borderflag to debug
MIT — GitHub

