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

@r3nic1e/opencode-evidence

v0.1.3

Published

Records tool observations, adds citation handles, and lets you inspect the source of assistant citations.

Downloads

948

Readme

Tool evidence

Records tool observations and lets you inspect the source of assistant citations. Targets OpenCode V2; checked against 2.2.3. The plugin ID is evidence.

Use

  • The top of the session sidebar has an Evidence box. Scroll through all saved records, newest first, and click a row to inspect it.
  • The box updates as tools finish. Browse / search all opens the searchable browser.
  • Run /evidence or select Browse tool evidence in the command palette.
  • Search the execution list by handle, tool, or argument preview. Select a record to inspect its captured arguments and result.
  • Run /evidence E17 or /evidence <uuid> to open one record directly.
  • Missing citations appear as BROKEN CITATION in the browser. The check scans assistant text in the session's available message history.

The plugin assigns each recorded invocation a UUID and a session-local handle such as [E17]. It adds citation instructions and an index of the latest 30 records to model requests. The assistant can use evidence_lookup to retrieve older records, page through large records, or validate references after compaction.

The UI only reads snapshots. It never reruns commands. Inline citation links in assistant messages are not implemented; use the sidebar, browser, or direct lookup instead.

Install

Add the package to plugins in opencode.json(c). The package exports server, TUI, and RPC parts; the TUI loads its part automatically and uses OpenCode's Solid and OpenTUI runtime.

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": [
    {
      "package": "@r3nic1e/[email protected]",
      "options": { "maxSnapshotBytes": 262144 }
    }
  ]
}

maxSnapshotBytes bounds each argument or result snapshot. The default is 256 KiB; accepted values are 1 KiB through 4 MiB. Invalid values use the default.

What a record means

Records contain the session, message, native call ID, tool name, plugin location, captured arguments, result or error, and capture timestamps. A shell's explicit working directory stays in its arguments; the plugin location is not necessarily the shell's working directory.

The recorder uses execute.after hooks, including for nested Code Mode tools and tools registered by later plugins. Each completed invocation gets its own UUID even when parallel nested calls share a native call ID. Short handles follow capture order, not source-code order.

The outer Code Mode execute gets an initial record before execution. Nested records link to that parent. An outer record with status started has no captured completion; it does not prove that execution is still running or that it succeeded.

Other tools are recorded when their completion hook runs. Interruption, validation failure, permission rejection, or a plugin that stops execution before that hook can leave no record. evidence_lookup excludes itself to avoid recursively storing retrieved history. Code Mode's fetch and search helpers are not separate registered tool invocations; only the outer execution covers them. User shell commands outside tool execution are not captured.

Snapshots show the result at this plugin's capture hook. Another plugin can modify it later, and OpenCode can normalize content or images afterward. A nested tool's full result is not necessarily what the model saw after Code Mode filtered it. Snapshot timestamps are capture times, not execution durations. Background tools capture the immediate tool response, not later job output unless another tool reads it.

Storage and privacy

Records use OpenCode's durable, plugin-scoped local storage, partitioned by session. They survive plugin reloads, server restarts, and context compaction. Removing a session does not automatically delete this plugin's records. There is no retention cleanup or export command in this version.

The recorder removes common credential-key values and bearer tokens before saving. This is best-effort redaction, not a secret scanner: arbitrary secrets in command strings, URLs, or file contents can remain. The original tool arguments and results are not modified.

Each snapshot includes its full redacted byte count, SHA-256 hash, and explicit redaction and truncation flags. The hash covers the full redacted JSON serialization, not the original secret-bearing result. Truncation stores only a UTF-8-safe prefix; the omitted tail cannot be recovered from this plugin. Upstream tools may already truncate their own output.

If capture fails, the original tool still returns or throws normally. The plugin logs a generic warning and adds a capture warning to subsequent model requests. Partial records remain visibly incomplete. Concurrent allocation is serialized within one server process; do not use separate server processes writing the same OpenCode database.

Valid references prove that a record exists in this session. They do not prove that its contents support a claim, identify the assistant's internal reasoning, or provide tamper-resistant audit storage.

Development

From the repository root, run:

node --test packages/evidence/test/evidence.test.mjs

Tests cover SQLite persistence, concurrent nested calls, session isolation, pagination, redaction, bounded snapshots, capture failures, model and compaction instructions, read-only TUI browsing, and sidebar live updates and cleanup.