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-branch

v1.1.1

Published

Floating Branch panel for OpenCode — quick aside probes without leaving your main session

Readme

opencode-branch

Floating Branch panel for OpenCode — ask a quick aside question, poke at a file, or check history without derailing the main session.

Branch runs as its own isolated session with a deny-by-default tool allowlist. Optional main-session context (compact / full / none) can be injected at prompt time.

Install

opencode plugin -g opencode-branch

Or add to ~/.config/opencode/tui.json:

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["opencode-branch"]
}

Restart OpenCode after installing.

Requires OpenCode >= 1.17 (tested on 1.18+) with TUI plugin support.

Usage

| Command / key | Action | |---------------|--------| | /branch | Toggle the Branch panel | | /branch-clear | Clear the branch conversation | | /branch-model | Change the branch model | | /branch-history | Browse saved branch sessions | | /branch-reload | Reload branch.jsonc | | /branch-context | Cycle main-context mode: Compact → Full → None | | Ctrl+Shift+B | Toggle panel (default keybind) | | Alt+C | Clear | | Alt+T | Toggle thinking blocks | | Alt+H | History | | Alt+D | Delete focused/selected history entry | | Ctrl+Shift+X | Cycle context mode (when panel is open) | | Esc | Stop generation; in history, go back one level |

On macOS, Option/Alt often does not reach the TUI (terminal compose). Prefer /branch slash commands, or configure your terminal so Option acts as Meta (e.g. iTerm2: Left Option = Esc+).

Model changes use /branch-model (no default keybind — Tab is left to the host TUI).

Configuration

Settings live in ~/.config/opencode/branch.jsonc (created on first load):

{
  "model": null,
  "systemPrompt": "You are a concise branch assistant. Answer directly. Use tools only when helpful.",
  "keybind": "ctrl+shift+b",
  "clearKeybind": "alt+c",
  "thinkToggleKeybind": "alt+t",
  "historyKeybind": "alt+h",
  "deleteKeybind": "alt+d",
  "modelKeybind": false,
  "allowedTools": ["glob", "grep", "list", "read", "websearch", "webfetch"],
  "width": 56,
  "tokenLimit": 45000,
  "position": "bottom-right",
  "think": {
    "defaultState": "collapsed",
    "showSummary": false
  },
  "mainContext": {
    "defaultMode": "compact",
    "compactMaxChars": 50000,
    "fullMaxChars": 200000,
    "compactHeadMessages": 4,
    "compactTailMessages": 20,
    "fullIncludeToolOutputs": true,
    "contextKeybind": "ctrl+shift+x"
  }
}

Set any keybind to false or "none" to disable it.

Main-session context

Branch always uses its own session. When context mode is compact or full, the active main-session transcript is appended into the branch system prompt at submit time (not streamed into the main agent).

  • compact (default): head + tail messages, tool summaries, character budget
  • full: ordered transcript with tool details (optional raw outputs)
  • none: no main-session context

The header chip main: compact|full|none shows the current mode (click or Ctrl+Shift+X / /branch-context to cycle).

History

Closing or clearing the panel saves the branch session under ~/.local/share/opencode-branch/history.json (50-entry FIFO). Browse with /branch-history or Alt+H.

In history: Esc / header Back pops one level (detail → list → chat). Up/Down move the list cursor; Enter opens detail; Delete acts on the focused or open entry.

Security

Tools are deny-by-default. Only IDs listed in allowedTools are granted. Full context mode can include main-session tool outputs — use fullIncludeToolOutputs: false or Context: None when that is sensitive.

Troubleshooting

  • /branch missing: confirm opencode-branch is in tui.json (not only opencode.json), then restart. This package ships a prebuilt dist/tui.js TUI entry — required for OpenCode 1.18+ npm plugin loading.
  • Alt keybinds do nothing on macOS: expected without Option-as-Meta; use /branch slash commands.
  • Stale plugin after upgrade: opencode plugin -g -f opencode-branch then restart.

Development

bun install
bun run build
bun run typecheck
bun run test

Point tui.json at a local checkout for iteration:

{
  "plugin": ["file:///absolute/path/to/opencode-branch"]
}

License

MIT — see LICENSE.