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

agentstash

v0.2.1

Published

Encrypted incremental backups for AI coding agents — Claude Code, OpenCode, Gemini CLI, Codex, and more

Readme


AI coding agents store sessions, config, credentials, and memory locally. If your disk dies, you lose everything. agentstash fixes that with encrypted, deduplicated, incremental backups to any S3-compatible storage.

Supported agents

| Agent | Data directory | What gets backed up | |-------|---------------|---------------------| | Claude Code | ~/.claude/ | Sessions, credentials, settings, skills, history, plans | | OpenCode | ~/.local/share/opencode/ | SQLite DB (sessions), auth, snapshots, state, history | | Gemini CLI | ~/.gemini/ | Settings, API keys, checkpoints, history, memory | | OpenAI Codex | ~/.codex/ | Config, auth | | OpenClaw | ~/.openclaw/ | Config, credentials, workspace, sessions, memory, skills | | Aider | ~/ (dotfiles) | Config, chat history, model settings | | Continue | ~/.continue/ | Config, sessions | | Cursor | ~/.cursor/ | Settings, keybindings | | GitHub Copilot | ~/.config/github-copilot/ | Auth, settings |

Auto-detects which agents are installed during setup.

Install

Requires Node >= 18.

# Run without installing
npx agentstash setup

# Or install globally
npm install -g agentstash

Quick start

# Interactive setup wizard — auto-detects your agents
agentstash setup

# That's it. The daemon backs up every hour.
# Check status anytime:
agentstash status

# Disaster recovery on a new machine:
agentstash restore --agent claude-code

How it works

agentstash wraps restic, the battle-tested backup tool. It auto-downloads the restic binary on first run.

~/.claude/                            S3-compatible storage
~/.local/share/opencode/              (Cloudflare R2, AWS S3,
~/.gemini/               ──encrypt──   Backblaze B2, MinIO)
~/.openclaw/             ──dedup───▶
~/.codex/                ──upload──   Only changed blocks
~/.continue/                          get transferred.
~/.*aider*                            AES-256 encrypted.

First backup: full upload. Subsequent backups: only changed blocks. Change 1 byte in a 200MB SQLite file? ~4KB uploaded.

Commands

agentstash setup                              Interactive wizard
agentstash backup                             Backup all enabled agents
agentstash backup --agent claude-code         Backup a specific agent
agentstash backup --only sessions             Backup only session data
agentstash backup --dry-run                   Show what would be backed up
agentstash restore --agent claude-code        Restore an agent's data
agentstash restore --at "3 days ago"          Point-in-time restore
agentstash restore --only config              Restore only config files
agentstash restore --target ~/tmp             Restore to custom directory
agentstash snapshots                          List all backup snapshots
agentstash snapshots --agent opencode         List snapshots for one agent
agentstash status                             Show backup health and info
agentstash forget                             Apply retention policy
agentstash doctor                             Run diagnostic checks
agentstash daemon install                     Install background backup service
agentstash daemon uninstall                   Remove background service
agentstash daemon status                      Check service status

Selective backup and restore

Each agent's data is categorized into standard categories:

| Category | What it includes | |----------|-----------------| | config | Main configuration files | | secrets | Credentials, API keys, auth tokens | | sessions | Conversation history and chat logs | | memory | Persistent memory and knowledge bases | | skills | Custom skills, plugins, extensions | | workspace | Workspace and project-specific data | | settings | User preferences and UI state | | history | Input and prompt history |

# Backup only sessions across all agents
agentstash backup --only sessions

# Restore only config for Claude Code
agentstash restore --agent claude-code --only config

# Restore from 3 days ago
agentstash restore --agent opencode --at "3 days ago"

Configuration

Stored at ~/.agentstash/config.json. Created by agentstash setup.

{
  "version": 1,
  "agents": [
    { "id": "claude-code", "enabled": true },
    { "id": "opencode", "enabled": true },
    { "id": "gemini", "enabled": true },
    { "id": "openclaw", "dataDir": "~/.openclaw", "enabled": true }
  ],
  "storage": {
    "provider": "r2",
    "bucket": "my-agentstash",
    "accountId": "...",
    "accessKeyId": "...",
    "secretAccessKey": "..."
  },
  "retention": {
    "keepLast": 7,
    "keepDaily": 30,
    "keepWeekly": 12,
    "keepMonthly": 6
  },
  "daemon": {
    "enabled": true,
    "intervalMinutes": 60
  },
  "exclude": []
}

Passphrase

The encryption passphrase is not stored in the config file. During setup, agentstash saves it to your system keychain:

  • macOS: Keychain Access
  • Linux: GNOME Keyring / KDE Wallet

Resolution order: --passphrase flag > AGENTSTASH_PASSPHRASE env var > system keychain.

Supported storage providers

| Provider | Config | Notes | |----------|--------|-------| | Cloudflare R2 | r2 | Generous free tier, no egress fees | | AWS S3 | s3 | Standard S3 | | Backblaze B2 | b2 | Affordable, S3-compatible | | MinIO | minio | Self-hosted |

Background service

agentstash daemon install sets up:

  • macOS: launchd LaunchAgent
  • Linux: systemd user timer + service

Runs agentstash backup at the configured interval (default: every 60 minutes).

Security

  • AES-256 encryption before data leaves your machine
  • Key derived from passphrase via scrypt (restic default)
  • Storage provider only sees opaque encrypted blobs
  • Passphrase stored in OS-native keychain, never in config files

Platforms

  • macOS (Intel + Apple Silicon)
  • Linux (x64 + arm64)
  • Windows via WSL2

Based on

agentstash is a fork of clawstash, extended to support all major AI coding agents.

License

MIT