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

opencode-tmux-session-status

v0.1.2

Published

Report opencode session status to tmux (working / waiting / done / error / idle) plus desktop notifications

Readme

opencode-tmux-session-status

GitHub · npm

OpenCode server plugin that stamps the owning tmux session with @opencode_state / @opencode_state_at / @opencode_detail, so a picker or status-line can show whether each session is working / waiting / done / error / idle without scraping pane contents. Terminal states (done / waiting / error) also fire a desktop notification (via omarchy, falling back to notify-send).

Built for the tmux-opencode-session-manager layout: one tmux session per project directory on a dedicated tmux server socket (default opencode-popup), named oc_<cksum-of-dir> (same hash as scripts/helpers.sh session_hash: printf '%s' "$dir" | cksum). The scripts live in the companion tmux-opencode-session-manager repository. The hash uses the exact directory string from the launcher's resolved cwd (or $PWD fallback), with no trimming, symlink resolution, or canonicalization. Configure OpenCode with that same location; a different spelling, trailing slash, or worktree directory intentionally hashes to a different tmux session.

Install

From npm:

opencode plugin add opencode-tmux-session-status@latest

From git or local checkout:

opencode plugin add github:4m1z/opencode-tmux-session-status
# or pin a ref:
opencode plugin add github:4m1z/opencode-tmux-session-status#main

Or declare it in config (opencode.json / opencode.jsonc):

{
  "plugins": ["opencode-tmux-session-status@latest"],
  // "plugins": ["[email protected]"]
  // "plugins": ["github:4m1z/opencode-tmux-session-status"]
  // "plugins": ["./path/to/opencode-tmux-session-status"] // no build needed, loads from src/
}

Requires tmux and cksum on PATH. Notifications are best-effort: omarchy notification send, falling back to notify-send. Missing socket/session never breaks the run; the picker falls back to the API.

Options

{
  "plugins": [
    {
      "package": "opencode-tmux-session-status@latest",
      "options": {
        "socket": "opencode-popup", // tmux server socket (-L)
        "prefix": "oc_", // session name prefix before the cksum hash
        "notifications": true,
        "notifier": "auto", // auto/omarchy: omarchy then notify-send; notify-send: only notify-send
        "notificationCooldownMs": 120000,
        "changedDetailFloorMs": 15000,
        "normalUrgency": "normal", // done
        "attentionUrgency": "critical", // waiting/error
        "notificationDetail": "full", // "state" hides question/error details on desktop
        "debug": false,
      },
    },
  ],
}

State model

| State | Meaning | | --------- | ----------------------------------------------------------- | | working | agent is actively running | | waiting | needs input: permission request or open question | | done | turn finished, unacknowledged (stays until ack on open) | | error | run failed / session errored (stays until next task starts) | | idle | no work outstanding, acknowledged |

Completion is never inferred from silence; only explicit idle/error events produce done / error.

The project stamp belongs to one foreground session ID at a time: a new prompt or execution start can take ownership; old sessions' completion events cannot finish the new one. Queued prompts wait for execution to start. A permission or form request locks that run in waiting until its matching reply/cancellation. Approval/answer resumes working; denial reports permission denied as working without claiming approval, while question rejection/cancellation shows error. Interruption shows error rather than a successful completion; a superseded interruption is ignored because the new run supplies its own start event. Failed runs ignore later idle/completion events until new work starts; completed runs ignore ordinary busy/tool events until new work starts. ack.sh owns the done → idle transition. The plugin only updates @opencode_state_at on a state change, as the status line, picker and reconciler interpret it as time entered, not a heartbeat.

OpenCode 2.0.21's shared ctx.event.subscribe({ signal }) stream carries { type, location, data } events. Earlier question.*, session.next.*, and { directory, payload: { type, properties } } envelopes remain supported. Unlocated events resolve through the session ID cache or ctx.session.get({ sessionID }); an unresolvable event is ignored. When debug is enabled, concise failure/ignored-event diagnostics are rate-limited to once per minute per category. Notification and tmux failures do not interrupt the OpenCode run.

License

MIT