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-session-save

v0.1.3

Published

OpenCode plugin that captures shared sessions into Obsidian notes.

Readme

OpenCode Session Save

OpenCode-native npm plugin that captures the current session into an Obsidian note after /share.

Workflow:

  • run /share
  • run /session-save <share-url>

The plugin captures the first user prompt and session metadata from OpenCode event hooks, then writes or updates a note under AI Sessions/ in your Obsidian vault.

What this package installs

  • npm plugin: opencode-session-save
  • custom tool: save_session_note
  • config command: /session-save
  • permission entry: save_session_note: allow

Environment

  • OPENCODE_SESSION_SAVE_VAULT_ROOT: required vault root containing AI Sessions
  • OPENCODE_SESSION_SAVE_ROOT: optional local dev helper root
  • compatibility alias: SESSION_SAVE_ROOT

/session-save fails unless OPENCODE_SESSION_SAVE_VAULT_ROOT is set.

Install

Add the plugin to your OpenCode config:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["opencode-session-save"],
  "permission": {
    "save_session_note": "allow"
  },
  "command": {
    "session-save": {
      "description": "Save the current OpenCode session into the Obsidian AI session tracker",
      "template": "Use this only after `/share` has already returned a share URL.\n\nCall the `save_session_note` tool immediately with:\n\n- `shareUrl`: `$ARGUMENTS`\n\nRules:\n\n- do not generate the note in-model\n- do not summarize the session yourself\n- do not claim success unless the tool returns a note path\n- if `$ARGUMENTS` is missing or invalid, say so briefly"
    }
  }
}

Use either ~/.config/opencode/opencode.json or ~/.config/opencode/opencode.jsonc.

OpenCode installs the npm plugin automatically on startup after it sees "opencode-session-save" in plugin.

Then set your vault root:

export OPENCODE_SESSION_SAVE_VAULT_ROOT="$HOME/obsidian-vault"

Restart OpenCode after installing or changing plugin config.

Local development

Run a temp OpenCode config wired to this checkout:

bin/opencode-session-save-dev

The launcher creates a temporary .opencode config containing:

  • commands/session-save.md
  • plugins/session-save.ts
  • lib/session-save-core.ts
  • lib/note-writer.ts
  • package.json
  • opencode.json

This keeps local plugin development close to how OpenCode loads project plugins.

Package layout

  • dist/index.js published plugin entrypoint loaded from the package root
  • src/plugins/session-save.ts OpenCode plugin entry and tool registration
  • src/lib/session-save-core.ts session capture, validation, and cache helpers
  • src/lib/note-writer.ts Obsidian note creation and update logic
  • commands/session-save.md source template for the installed command

Tests

bun run build
bun test