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

@mcmunder/opencode-git-memory

v0.0.4

Published

An OpenCode plugin that gives your AI agent conversation context scoped to your branch and traveling with your code.

Readme

opencode-git-memory

An OpenCode plugin that gives your AI agent conversation context scoped to your branch and traveling with your code.

Why This Plugin

When you start a fresh AI session, the agent has no idea what was discussed in previous sessions — the decisions made, the approaches tried, the reasoning behind changes. All of that context has to be rebuilt from scratch.

OpenCode stores session history locally on your machine, but this history isn't portable across machines, and collaborators have no visibility into the AI conversations that shaped the code. Git notes solve this: they live in the repository itself, scoped to individual commits, and can be pushed and fetched just like branches.

This plugin attaches conversation transcripts to git commits using git notes. When a new session starts, it surfaces the conversation context from the current branch, so the AI can pick up where the last session left off. This is not a full project history — it's the conversation context from your branch's commits.

How It Works

Write path — saving conversations

When a git commit is executed during an OpenCode session, the plugin:

  1. Captures the conversation messages since the last commit
  2. Renders them as a Markdown transcript (text, reasoning, and tool names only — no file paths or tool output for privacy)
  3. Attaches the transcript to the new commit as a git note under refs/notes/opencode

If multiple commits happen in one session, each gets its own transcript appended with a separator.

Warning: Git notes are stored in the repository and can be pushed to remotes. While the plugin strips tool input/output to reduce exposure, conversation text itself is captured. If secrets (API keys, passwords, tokens) appear in your conversation messages, they could end up in the notes. Avoid pasting secrets directly into the chat, and review notes before pushing with git notes --ref=refs/notes/opencode show <commit>.

Read path — restoring context

When a new OpenCode session starts, the plugin:

  1. Scans commits on the current branch for attached notes — on feature branches, all commits since the branch point; on the default branch, the last 10 commits
  2. Injects a summary of available context into the AI's system prompt
  3. Provides a git_notes_read tool that the agent can use to retrieve full conversation transcripts for any commit

Notification

When a session opens and notes are available, a visible message lists the commits with attached conversation history, so you know context is available before you start working.

Important: Commits must be made within an OpenCode session for the plugin to capture conversations. The plugin hooks into OpenCode's tool execution pipeline — it detects when the AI agent runs git commit via the bash tool. Commits made in an external terminal or Git GUI will not have conversation history attached.

Installation

Add the plugin to your OpenCode configuration in .opencode/opencode.json:

{
  "plugin": ["@mcmunder/opencode-git-memory"]
}

Working with Git Notes

Notes are stored under the custom ref refs/notes/opencode, separate from the default git notes ref.

View a note:

git notes --ref=refs/notes/opencode show <commit>

Push notes to a remote (to share context with your team):

git push origin refs/notes/opencode

Fetch notes from a remote:

git fetch origin refs/notes/opencode:refs/notes/opencode

Development

bun install        # install dependencies
bun test           # run tests
bun run build      # build bundle + type declarations

To test the plugin end-to-end, create a temporary git repo and link the plugin:

mkdir -p /tmp/test-git-notes && cd /tmp/test-git-notes
git init
mkdir -p .opencode

Create .opencode/opencode.json pointing to your local build using a relative path:

{
  "plugin": ["../../dist/index.js"]
}

Then run OpenCode from the test repo:

cd /tmp/test-git-notes
opencode

Any commits made through the OpenCode session will have conversation history attached as git notes. Verify with:

git notes --ref=refs/notes/opencode show HEAD

License

MIT