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-backup

v1.3.0

Published

OpenCode plugin that automatically backs up sessions to Google Drive or any folder

Readme

Session Backup Plugin for Opencode

opencode plugin that backs up your sessions to google drive (or anywhere) so you stop losing work when things crash.


what you get

  • auto-backup after every message, session update, and deletion
  • incremental sync using robocopy (windows) or rsync (unix)
  • debounced so it doesn't hammer your disk (30s minimum between syncs)
  • restore tool to get your sessions back after a crash
  • status tool to see backup stats

install

cd ~/.opencode
npm install opencode-session-backup

that's it. plugin loads automatically.


configuration

add to your opencode config:

{
  "session-backup": {
    "backupPath": "/path/to/backup/folder"
  }
}
export OPENCODE_BACKUP_PATH="/path/to/backup/folder"

debug mode

enable debug logging:

{
  "session-backup": {
    "backupPath": "/path/to/backup/folder",
    "debug": true
  }
}
export OPENCODE_BACKUP_DEBUG="true"

default paths

| platform | default destination | |----------|---------------------| | windows | ~/Google Drive/opencode-sessions | | macos | ~/Library/CloudStorage/GoogleDrive/My Drive/opencode-sessions | | linux | set via config or env var |


tools

session_backup_sync

manual backup. use when you want to force a sync.

session_backup_sync force=true

session_backup_status

shows backup stats: session count, size, last sync time, pending syncs.

session_backup_status

example output:

Backup path: G:\Mi unidad\opencode-sessions
Sessions backed up: 47
Backup size: 12.3 MB
Last backup: 1/29/2026, 9:15:00 PM
Last sync success: yes
Syncs this session: 3

session_backup_restore

restores sessions from backup. requires confirmation because it overwrites current sessions.

session_backup_restore confirm=true

restart opencode after restore to see your sessions.


how it works

  1. plugin hooks into opencode events (message.updated, session.updated, session.deleted)
  2. schedules a sync after 5s delay (debounced)
  3. runs robocopy/rsync with /MIR flag for incremental sync
  4. logs to sync.log in backup folder
opencode storage  ──robocopy/rsync──▶  backup folder
     │                                      │
     └── session/                           └── session/
     └── message/                           └── message/
     └── part/                              └── part/
     └── todo/                              └── todo/

troubleshoot

backup not running

check if destination exists and is writable:

# windows
Test-Path "G:\Mi unidad\opencode-sessions"

# unix
ls -la ~/Library/CloudStorage/GoogleDrive/My\ Drive/opencode-sessions

restore not working

make sure backup folder exists and has data:

session_backup_status

if Sessions backed up: 0, your backup is empty.

google drive sync conflicts

google drive desktop can lock files during sync. if you see errors, wait for drive to finish syncing or use a local folder instead.


license

MIT