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

@counted/opencode

v0.1.1

Published

Counted analytics plugin for OpenCode — track AI agent actions privately

Readme

@counted/opencode

Native OpenCode plugin for Counted — privacy-first analytics for AI agent dev sessions. No code, content, or PII ever leaves the machine.

Install

Add it to your opencode.json plugin array (OpenCode auto-installs it):

{
  "plugin": ["@counted/opencode"]
}

Or drop a re-export in .opencode/plugins/counted.ts (project) or ~/.config/opencode/plugins/counted.ts (global):

export { CountedPlugin } from "@counted/opencode";

Then set your project's client key in the environment:

export COUNTED_AGENT_KEY="ck_your_agent_project_client_key"
# Optional — defaults to https://app.counted.dev
export COUNTED_AGENT_HOST="https://app.counted.dev"

The plugin is a no-op until COUNTED_AGENT_KEY is set. Create the project with the agent dashboard template so the pre-built insights line up.

What it tracks

| OpenCode signal | Counted event | Props | | --- | --- | --- | | session.created | session_start | mode | | tool.execute.after (any) | tool_use | tool, outcome | | tool.execute.after (edit/write) | file_edit | filePath (repo-relative), action, language | | tool.execute.after (bash) | command_run | command (binary name only) | | session.idle / dispose | — (flush) | — |

Events run through a single long-lived @counted/sdk Analytics instance (batched, flushed on idle and on dispose).

Privacy

  • File paths only (repo-relative; basename fallback), never contents or diffs.
  • Command binary name only (git, bun, …) — no arguments, no output.
  • No prompt text, no AI responses, no PII.

OpenCode surfaces tool failures on the event stream rather than the after-hook, so per-tool outcome is currently always success; failures aren't attributed to a specific tool yet.

Compare agent setups

Every event carries a setup fingerprint so you can break metrics down by agentic configuration:

  • setupHash — a stable digest of your opencode.json setup: model, agent/ prompt definitions, tools, permissions, and sampling params. Only the digest is sent — prompt content never leaves the machine. setupHashVersion tracks the scheme.
  • model — sent in the clear so breakdowns are readable.
  • setupLabel — optional human bucket; set COUNTED_SETUP_LABEL="reviewer-v2".

Add a breakdown insight grouped by setupHash (or setupLabel) over tool_use outcome, command_run, or file_edit to compare setups.

Advanced

The package also exports the low-level helpers (init, track, trackToolUse, …) if you want to emit events from your own OpenCode plugin instead of using CountedPlugin directly.

License

MIT