@capybearista/opencode-double-tap-timeline
v1.0.0
Published
Double-tap Escape key to open the timeline modal, inspired by Claude Code's /rewind feature
Downloads
395
Readme
opencode-double-tap-timeline
Why?
Inspired by Claude Code's double-tap-to-invoke-
/rewindfeature. Instead of typing/timelineor reaching for the mouse, just double-tap Escape while in a session to open the timeline modal instantly.
Philosophy: Extending OpenCode
OpenCode's TUI plugin system enables keyboard-driven UI extensions. This plugin hooks into the app slot to listen for Escape key presses globally, detects a double-tap within 800ms, and triggers the timeline command. It cleanly disposes of its timers on deactivation.
Architecture
src/index.ts
└── tui hook
├── lifecycle.onDispose() — cleanup
└── slots.register({ app() })
└── useKeyboard() — Escape key listener
└── double-tap detection (800ms window)
└── api.command.trigger("session.timeline")Features
- Global Escape key listener via the
appslot — works regardless of which screen is active - 800ms double-tap window, matching Claude Code's behavior
- Only triggers timeline when in a session with a valid session ID
- Single Escape still works normally (closes modals, cancels operations)
- Proper timer cleanup on plugin deactivation
- Skips trigger if a dialog is already open
Install
Add the plugin to tui.json or tui.jsonc:
{
"plugin": ["@capybearista/opencode-double-tap-timeline"]
}You can also install it through the CLI:
opencode plugin -g @capybearista/opencode-double-tap-timeline # global install
opencode plugin @capybearista/opencode-double-tap-timeline # project-local installUsage
- Open a session in OpenCode
- Double-tap
Escapequickly (within 800ms) - The timeline modal opens
Note: Hitting Escape two times in quick succession to interrupt a running prompt will also invoke the timeline modal. Hit Escape again to quickly exit.
Configuration
This plugin requires no manual configuration.
Troubleshooting
- If double-tap doesn't work, ensure you're in a session screen (not the home screen)
- If a dialog is open, the timeline won't trigger — close any open dialogs first
- The plugin uses OpenTUI's
useKeyboardhook, which requires@opentui/solidinstalled
Contributing
This package lives in the opencode-plugins monorepo.
- Run
bun run build,bun run typecheck,bun run lint, andbun testbefore opening a PR. - Keep the plugin focused on the double-tap timeline trigger.
- Prefer small, direct changes.
Please open an issue or check for existing ones before creating a pull request.
