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

@tim_hilde/opencode-insights

v1.4.0

Published

OpenCode plugin that analyses your session history and generates an HTML insights report

Readme

opencode-insights

A native opencode plugin that generates usage insights reports from your session history.

Registers a /insights slash command that:

  • Reads sessions from opencode's SQLite database
  • Extracts per-session facets via LLM (with caching)
  • Runs 7 aggregate analysis prompts + an at-a-glance synthesis
  • Generates a self-contained HTML report + diffable insights.json

The report

/insights produces a single self-contained HTML file — no server, no build step, just open it in a browser. It loads light by default with an opt-in dark mode, every section is collapsible for quick skimming, and Export insights.json downloads the underlying data so you can diff reports over time.

OpenCode Insights example report

The image above is a static preview. For the interactive version — collapsible sections, dark-mode toggle, and JSON export — open docs/sample-report.html in a browser, or preview it online. The data shown is an illustrative example.

Installation

Runtime: Requires Bun. The engines.node field in package.json is npm registry metadata only — the plugin uses bun:sqlite and cannot run under plain Node.js.

Add to ~/.config/opencode/opencode.json:

{
  "plugin": ["@tim_hilde/[email protected]"]
}

Usage

In the opencode TUI:

/insights                                       # current project only (default)
/insights --all                                 # analyze every project
/insights --days 7
/insights --force
/insights --model anthropic/claude-haiku-4-5
/insights --output ~/Desktop/my-insights.html

By default /insights analyzes only the current project's sessions. Pass --all to include every project in your opencode history. Scoping to the current project also limits how much unrelated session content is fed to the analysis model.

Configuration

On the first run, the plugin creates ~/.config/opencode/insights.json with defaults:

{
  "model": "anthropic/claude-haiku-4-5",
  "days": 30,
  "concurrency": 4
}

Edit this file to change the defaults for every /insights run.

| Field | Default | What it does | |---|---|---| | model | anthropic/claude-haiku-4-5 | LLM used for all analysis calls. Format: providerID/modelID. Haiku-class models are recommended — they're fast, cheap, and sufficient for JSON extraction. Use a smarter model if you want richer analysis at higher cost. | | days | 30 | How many days of session history to include. | | concurrency | 4 | Max parallel LLM calls during per-session facet extraction. Increase to speed up the first run, decrease if you're hitting rate limits. |

Argument flags override config file values for a single run:

/insights --days 7              # override days
/insights --model anthropic/claude-sonnet-4-5  # use a smarter model this run
/insights --force               # re-analyze all sessions, ignoring cache

How it works

  1. Extract — reads sessions from opencode.db (current project + last 30 days by default; use --all for every project), filters out sub-agent sessions and [insights] sessions
  2. Facet extraction — per-session LLM call extracting: goal, outcome, satisfaction, friction (cached to ~/.local/share/opencode/insights/facets/)
  3. Aggregate analysis — 8 prompts: project areas, interaction style, agent performance, friction, suggestions, tool health, horizon
  4. At-a-Glance synthesis — final summary with split fault attribution (agent vs user-side)
  5. Report generation — self-contained HTML + machine-readable insights.json for tracking over time

Development

bun install
bun test
bun run scripts/smoke-db.ts  # LLM-free validation against real DB

Attribution

This plugin ports and extends opencode-usage by rchardx (MIT License).

Prompt improvements are based on Claude Code's /insights system prompts as documented by Piebald-AI/claude-code-system-prompts.