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-forking-agents-plugin

v0.2.0

Published

OpenCode plugin: synchronous and background subagent tools with optional forked context and model selection

Downloads

88

Readme

opencode-forking-agents-plugin

OpenCode plugin that adds namespaced subagent tools for synchronous runs, background delegation, optional forked parent-session context, and explicit model selection.

Install

In opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-forking-agents-plugin"]
}

OpenCode installs npm plugins automatically. For local development, point plugin at ./src/index.ts.

Tools

| Tool | Purpose | | --- | --- | | subagents_run | Run a subagent synchronously and return the result. | | subagents_delegate | Start a read-only background subagent and return a delegation ID. | | subagents_read | Read a persisted background delegation result. | | subagents_list | List background delegations for the plugin instance. | | subagents_cancel | Cancel a running background delegation. | | subagents_models | List available models with providerID, modelID, and provider/model references. |

Forking

Forking means the parent session transcript is prepended to the child prompt in <parent_session_transcript>.

fork is a boolean tool argument. If omitted, the plugin uses config defaults:

  • true by default for most agents
  • false by default for review-like agents such as review and code-review
  • explicit tool arguments always win

Example:

{
  "prompt": "Find where auth is implemented",
  "agent": "explore",
  "fork": true
}

Model Selection

Models can be selected either as model: "provider/model" or explicit providerID and modelID fields.

Explicit fields win, and both must be supplied together:

{
  "prompt": "Review this change",
  "agent": "code-review",
  "providerID": "anthropic",
  "modelID": "claude-sonnet-4-5"
}

Use subagents_models to inspect available model IDs.

Configuration

Plugin options can tune defaults:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    [
      "opencode-forking-agents-plugin",
      {
        "fork": {
          "default": true,
          "reviewDefault": false,
          "agents": {
            "code-review": false,
            "explore": true
          }
        },
        "model": {
          "agents": {
            "explore": "anthropic/claude-sonnet-4-5",
            "code-review": {
              "providerID": "openai",
              "modelID": "gpt-5.5"
            }
          }
        },
        "background": {
          "timeoutMs": 900000,
          "allowWriteCapable": false
        },
        "transcript": {
          "maxChars": 400000,
          "redact": false
        }
      }
    ]
  ]
}

Safety

Background delegation rejects write-capable agents by default because background sessions run outside normal parent-session undo flow. Use subagents_run for write-capable work, or explicitly set background.allowWriteCapable after accepting that risk.

Optional transcript redaction can reduce accidental propagation of common token/password patterns into forked subagent prompts.

Disable

Set OPENCODE_DISABLE_FORK_SUBAGENT_PLUGIN=1.

Release to npm

This package is configured for public npm publishing with provenance. The workflow supports either npm trusted publishing or an NPM_TOKEN repository secret.

  1. In npm, enable trusted publishing for the GitHub repository wkronmiller/forking-agents-plugin and workflow filename release.yml.
  2. If trusted publishing is not enabled, add a GitHub Actions secret named NPM_TOKEN with publish access to opencode-forking-agents-plugin.
  3. Ensure package.json has the release version and publishConfig.access is public.
  4. Push a matching version tag, for example v0.2.0 for package version 0.2.0.
  5. The release workflow runs tests, typecheck, and npm publish --access public --provenance.

The workflow can also be run manually with a tag input, but the tag must exist and match package.json.

For local publishing, authenticate first with npm login; unauthenticated local publishes fail even when the package is public.

License

MIT