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-subagent-models

v0.2.3

Published

OpenCode plugin to set global or per-session models and reasoning variants for subagents.

Downloads

236

Readme

opencode-subagent-models

Set one model and reasoning variant for every OpenCode subagent, globally or for one session.

Use a stronger model for a difficult task, move delegated work to a cheaper model, or restore each subagent's configured model. Primary sessions remain unchanged.

Features

  • Applies a global provider/model override to delegated subagents.
  • Lets one session and its delegated subagents override the global selection.
  • Restores each subagent's configured model without rewriting agent files.
  • Adds global and session model commands under Agent in the command palette.
  • Registers /subagents-model and /subagents-model-session.
  • Applies changes to new delegated subagent messages without restarting OpenCode.

Installation

OpenCode loads server and TUI plugins from separate configuration files. Add the same exact package version to both files. OpenCode caches npm plugin specs, so a pinned version avoids reusing an unversioned cache from an older release.

~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["[email protected]"]
}

~/.config/opencode/tui.json:

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

Close every OpenCode instance, then start it again. OpenCode installs the pinned package on startup.

Usage

Open the command palette and choose Global subagent model or Session subagent model. The matching slash commands are:

/subagents-model
/subagents-model-session

Each model selector keeps Default first, followed by models grouped by provider. After choosing a model, select its reasoning variant. Models without variants show only Default in the second selector.

Global Default restores each subagent's configured model. Session Default stops inheritance from session ancestors and uses the global selection.

The session override applies to subagents delegated from that conversation. Other sessions and terminals keep their own session override or inherit the global selection.

Scope

| Context | Result | | --- | --- | | Delegated subagent | Uses the global override when enabled | | Delegated subagent in an overridden session | Uses the session model and variant | | Primary session | Never changed | | Global Default | Each delegated subagent uses its configured model |

How it works

The global selection is stored in ~/.config/opencode/subagent-model.json. Session selections use one file per session under ~/.config/opencode/subagent-models/; selecting session Default writes a default marker there. For each delegated message, a hook resolves the nearest session override and then the global selection.

The default setting skips the matching override. The plugin does not copy, edit, or back up agent files.

Updating

Change the pinned version in both opencode.json and tui.json, then close every OpenCode instance and reopen it. Keep both files on the same version.

Troubleshooting

If the commands do not appear in Ctrl+P, confirm that the package is present in both configuration files and that both use the same exact version. Then inspect the OpenCode startup log at ~/.local/share/opencode/log/opencode.log for plugin loading errors.

If /subagents-model is sent to the LLM as a prompt, OpenCode loaded a release older than 0.2.0. Pin the current version in both files and restart every OpenCode instance. The exact version creates a separate cache, so manual cache deletion is not required.

Local development

npm install
npm test
npm pack --dry-run

Load a local checkout by adding its directory to the plugin array in both opencode.json and tui.json, so the server and TUI entries resolve:

{
  "plugin": [
    "file:///path/to/opencode-subagent-models"
  ]
}

Requirements

  • OpenCode 1.17.18. Other releases work only while they retain the v1 TUI command bridge.
  • Node.js ^22.22.2, ^24.15.0, or >=26.0.0 for local development.

Community

This is an open source collaborative project under the MIT License. Bug reports, feature proposals, and pull requests are welcome.

  • Read CONTRIBUTING.md before submitting a change.
  • Use the issue templates for public bug reports and feature requests.
  • Report suspected vulnerabilities through the private channel in SECURITY.md.
  • Follow CODE_OF_CONDUCT.md in project spaces.

License

MIT