npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kevincojean/opencode-tmuxwindowrenaming

v1.1.2

Published

Updates tmux window name based on OpenCode session

Downloads

224

Readme

OpenCode Tmux Plugin

An OpenCode plugin that automatically updates your tmux window name based on the current OpenCode session.

Features

  • Automatically renames tmux window when a new OpenCode session starts
  • Updates window name when you switch between sessions
  • Updates window name when session title changes
  • Restores the original window name when OpenCode closes (or falls back to the prefix)
  • Tracks all main sessions (ignores subagent sessions)
  • Safe: only runs if you're inside a tmux session

Installation

Add the plugin to your OpenCode config at ~/.config/opencode/opencode.json:

{
  "plugin": [
    "@kevincojean/opencode-tmuxwindowrenaming"
  ]
}

Restart OpenCode or start a new session to activate the plugin.

How It Works

The plugin listens to OpenCode session events and chat messages:

  • session.created: When a main session (non-subagent) is created, it stores the session
  • session.updated: When the session title changes, it updates the window name
  • chat.message: When you send a message in a different session, it detects the switch and updates the window name
  • session.deleted: When a session ends, it removes it from tracking
  • server.instance.disposed: When OpenCode shuts down, it restores the original window name (captured at startup) or falls back to the prefix (default [OC] )

Note: The window name updates when you send a message in a session, not immediately when you switch using /sessions. This means the window reflects the session you're actively working in.

Development

  • Watch mode: npm run watch - automatically rebuilds on file changes
  • Manual build: npm run build

Configuration

The plugin accepts the following configuration options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | maxLength | number | 60 | Max length for the tmux window name | | waitingIndicator | string | "● " | Prefix when waiting for input, set to "" to disable | | namePrefix | string | "[OC] " | Window name prefix | | logFile | string | (none) | Path to log file. If omitted, logging is disabled. |

Example configuration in opencode.json:

{
  "plugin": [
    [
      "/absolute/path/to/opencode-tmux-plugin",
      {
        "maxLength": 60,
        "waitingIndicator": "⏳ ",
        "namePrefix": "[OC] ",
        "logFile": "/tmp/tmux-plugin.log"
      }
    ]
  ]
}

All options are optional. Omitting an option uses its default value.

Requirements

  • tmux must be installed
  • OpenCode must be running inside a tmux session
  • The TMUX environment variable must be set (automatic when inside tmux)

Troubleshooting

  • Check that you're running OpenCode inside a tmux session: echo $TMUX
  • Look for plugin logs in OpenCode's output (they start with [tmux-plugin])
  • Verify the plugin is registered in ~/.config/opencode/opencode.json
  • Make sure the plugin is built: check that dist/index.js exists
  • If your tmux theme (e.g., Nord) shows a white/reversed window status bar, see TROUBLESHOOTING.md for a fix