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

@bubblebuffer/opencode-workspaces

v0.1.0

Published

OpenCode plugin for git-workspace-based isolation

Downloads

142

Readme

opencode-workspaces

Directory-level workspace isolation for OpenCode agents. Wraps git worktrees behind a small set of tools so agents don't interact with git worktree directly.

Problem

Agents struggle with git worktree lifecycle. Common failure modes: stale worktrees left on disk after sessions end, merge targeting the wrong base branch, abandoned metadata, and directory collisions during parallel dispatch.

Worktrees are the correct primitive for parallel agent work, but the raw git worktree CLI surface requires orchestration that LLMs get wrong.

What this does

Exposes five tools to OpenCode agents:

| Tool | Behavior | |---|---| | workspace_create | Creates a git worktree on a new branch (rejects duplicates) | | workspace_activate | Activates a workspace or returns to project root | | workspace_list | Returns active workspaces for the current project | | workspace_remove | Removes a worktree; optionally merges to base branch first | | workspace_clean | Batch cleanup by age or specific workspace ID |

Workspace names serve directly as IDs, branch names, and directory names. Duplicates are rejected at creation time with a clear error. The metadata file (~/.config/opencode/workspaces.json) acts as the global registry.

Workspaces are created under .opencode/workspaces/. Metadata is stored in ~/.config/opencode/workspaces.json (overridable via WORKSPACES_METADATA_PATH).

Installation

Add the plugin name to the plugin array in opencode.json:

{
  "plugin": ["@bubblebuffer/opencode-workspaces"]
}

OpenCode installs plugin dependencies at startup. No manual steps.

Tool details

workspace_create(name, base_branch)

Creates a new git worktree from base_branch on a new branch named name.

Throws Workspace already exists: <name> if a workspace with the same name is already active for this project.

Returns { id, name, directory }. The id is the workspace name.

workspace_activate(id)

Activates a workspace by id (same as the workspace name), returning { id, name, branch, directory, baseBranch }.

Pass "." as the id to return to the project root: { id: ".", directory: "<project>" }.

Throws if the workspace is not found.

workspace_list

Returns all active workspaces for the project as { id, name, branch, directory }.

workspace_remove(id, merge?)

Removes a workspace by id. When merge is true, checks out the base branch and merges the workspace branch before removing the worktree.

Throws if the workspace is not found.

workspace_clean(workspace_id?, older_than_days?, force?)

Removes one or more workspaces. Can target a single workspace by workspace_id or filter by older_than_days. Bulk operations require force: true.

Returns a summary: count of cleaned, skipped, and errored workspaces, plus per-workspace details.

Usage with SuperPawers

This plugin provides the backend for the using-workspaces and finishing-a-workspace skills in SuperPawers. Those skills handle workspace lifecycle decisions (when to create, when to merge, when to discard) so agents don't need to reason about it.

The plugin itself does not depend on SuperPawers and can be used independently.

Requirements

  • OpenCode with plugin support
  • Node.js >= 18
  • git >= 2.5

License

MIT