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

@kojoru/opencode-advisor

v0.1.3

Published

opencode plugin: advisor strategy — lets a smaller model consult a larger model when stuck

Readme

opencode-advisor

An opencode plugin that implements the advisor strategy: a smaller model working on a task gets access to an ask_advisor tool that routes questions to a larger, more capable model.

The plugin automatically gathers the full session transcript (including tool inputs and outputs) so the advisor model sees complete context without the working model having to describe its own situation.

How it works

  1. The working model hits a hard problem — architectural decision, tricky bug, non-obvious tradeoff
  2. It calls ask_advisor with a concise question
  3. The plugin fetches the full session transcript and sends it along with the question to the advisor model
  4. The advisor responds with targeted, actionable guidance
  5. The working model synthesizes the advice and continues

The advisor runs as a separate, ephemeral session — it can't take actions, only give advice.

Installation

Option A: local plugin (recommended for now)

Copy src/index.ts into your project as .opencode/plugins/advisor.ts, then install its dependency:

cd .opencode
npm install @opencode-ai/plugin

No changes to opencode.json needed — opencode auto-loads files in .opencode/plugins/.

Option B: npm package

npm install opencode-advisor

Then add to your opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["opencode-advisor"]
}

Configuration

Create .opencode/advisor.json in your project:

{
  "model": "anthropic/claude-opus-4-7",
  "maxToolOutput": 10000
}

| Field | Default | Description | |---|---|---| | model | anthropic/claude-opus-4-7 | Advisor model in provider/model format. Must be a model available in your opencode setup. | | maxToolOutput | (none) | Truncate tool call outputs in the transcript at this many characters. Useful to prevent token overload when sessions contain large file reads. Omit to include full outputs. |

You can also set ADVISOR_MODEL=provider/model as an environment variable — this takes precedence over the config file.

Choosing a model

The advisor model must be a provider/model pair configured in opencode (e.g. via your opencode.json or environment variables). Examples:

  • anthropic/claude-opus-4-7
  • anthropic/claude-opus-4-5
  • openai/o3
  • google/gemini-2-5-pro

The whole point is to use a more capable model than your working model — pick accordingly.

When should the working model use it?

The tool description instructs the model to use it sparingly:

Consult a more powerful model for guidance when you are genuinely stuck, need architectural advice, or face a critical decision with non-obvious tradeoffs. Use sparingly — only for hard problems where expert input materially changes the outcome.

Good uses: stuck on a hard bug, uncertain between two architectures, need a second opinion on a risky refactor.

Bad uses: simple questions the model can answer itself, routine tasks, fishing for validation.

Viewing logs

The plugin logs to opencode's structured log. On Windows:

%APPDATA%\opencode\log\

On macOS/Linux:

~/.local/share/opencode/log/

Or run opencode with --print-logs to stream logs to stdout.

Filter for plugin activity:

grep "opencode-advisor" opencode.log

Development

npm install       # installs @opencode-ai/plugin in root node_modules/
npm run build     # compile to dist/
npm run dev       # watch mode

src/index.ts is the single source of truth. .opencode/plugins/advisor.ts is a thin re-export that lets opencode load the plugin when working in this repo itself — it relies on npm install having been run at the root so that @opencode-ai/plugin is resolvable from src/.

License

MIT