Skip to content
    ↑↓ select↵ openesc close
    davdroman

    Clear Session Keybind

    opencode-clear-session-keybind·v0.1.0·Tools & Commands

    Configure a keyboard shortcut for OpenCode 2's /clear command.

    GitHub stars

    0

    Monthly installs

    140

    140 in 7 days

    Composite score

    33.2

    Multi-signal model

    Last commit

    3 days ago

    2026-10-01

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-clear-session-keybind@0.1.0"]
    }

    OpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    A configurable keyboard shortcut for OpenCode V2's built-in /clear command. It closes the current session tab and returns to a fresh prompt, keeping your selected agent and model. The saved session is not deleted.

    Installation

    Requires the OpenCode V2 CLI. Add this to your cli.json to use leader+C. Disabling the default compaction shortcut frees that key:

    {
      "$schema": "https://opencode.ai/v2/cli.json",
      "keybinds": {
        "session.compact": "none"
      },
      "plugins": [
        {
          "options": {
            "keybind": "<leader>c"
          },
          "package": "opencode-clear-session-keybind"
        }
      ]
    }
    

    Configuration

    options.keybind is required and has no default. Set it to a non-empty shortcut string supported by OpenCode, such as <leader>c or ctrl+l. If you choose a different shortcut, you can keep OpenCode's compaction binding.

    Configure the shortcut through the plugin's options. OpenCode does not accept session.clear under keybinds.

    License

    MIT

    Similar plugins