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

claude-ccsave

v0.1.0

Published

Automatic context snapshot and restore for Claude Code sessions

Readme

ccsave banner

ccsave

Never lose Claude Code session context again.


The Problem

Claude Code sessions hit their context window and /compact destroys your working state. The next session starts cold — no memory of decisions made, files touched, or what you were about to do. ccsave fixes this by snapshotting your session into CLAUDE.md before the context is gone.


Screenshot

ccsave status bar

Status bar integration coming in Pro — see below.


Installation

npm install -g ccsave

Requires Node.js 18+.


Quick Start

# 1. Set your Anthropic API key (for AI-powered summaries)
ccsave config --api-key sk-ant-...

# 2. Save your first snapshot
ccsave save

# 3. Install hooks (auto-saves before /compact, on session start)
ccsave hooks install

# 4. List snapshots for the current project
ccsave list

Commands

ccsave save

Snapshot the current Claude Code session and inject the summary into CLAUDE.md.

ccsave save                        # AI summary via Haiku (cheap, fast)
ccsave save --no-ai                # Skip AI, use basic file list instead
ccsave save --api-key sk-ant-...   # Override API key for this run

What it does:

  • Reads the latest session JSONL from ~/.claude/projects/
  • Sends the first 20 + last 40 messages to claude-haiku-4-5 for summarization (~$0.01 per save)
  • Writes a structured snapshot block into your project's CLAUDE.md

ccsave restore

Inject a previously saved snapshot back into CLAUDE.md.

ccsave restore                     # Restore the most recent snapshot
ccsave restore --list              # Pick from all saved snapshots interactively
ccsave restore --id <snapshot-id>  # Restore a specific snapshot by ID

ccsave list

Show all saved snapshots for the current project.

ccsave list

Output includes snapshot ID, timestamp, message count, and token estimate.


ccsave config

Configure ccsave settings stored in ~/.ccsave/config.json.

ccsave config --api-key sk-ant-...    # Set Anthropic API key
ccsave config --threshold 2mb         # File size that triggers auto-save
ccsave config --interval 30           # Auto-save interval in minutes (watch mode)
ccsave config --show                  # Print current configuration

Config Options

| Option | Default | Description | |--------|---------|-------------| | apiKey | (none) | Anthropic API key for AI summarization | | fileSizeThreshold | 2mb | Session file size that triggers auto-save in watch mode | | messageCountThreshold | 80 | Message count that triggers auto-save in watch mode | | intervalMinutes | 30 | Polling interval for watch mode | | maxSnapshotsPerProject | 3 | Max snapshots to keep per project (oldest pruned) | | enableWatchLog | false | Write watcher activity to ~/.ccsave/watch.log | | enableNotifications | true | Show system notifications on auto-save |


ccsave hooks install

Register ccsave hooks in ~/.claude/settings.json so saves happen automatically.

ccsave hooks install

Installs two hooks:

  • UserPromptSubmit — checks session size on each message; saves when thresholds are crossed
  • PreCompact — saves a snapshot immediately before Claude compacts the context

After installing, you never need to run ccsave save manually again.


How It Works

  1. ccsave finds your session JSONL file in ~/.claude/projects/<hash>/
  2. It windows the transcript (first 20 + last 40 meaningful messages) and sends it to claude-haiku-4-5
  3. The AI returns a structured markdown summary (current task, decisions, files touched, next step)
  4. The summary is written into a delimited block inside your CLAUDE.md — invisible to normal readers, loaded automatically by Claude Code at session start

The block looks like this in CLAUDE.md:

<!-- [CCSAVE:START] -->
### Current Task
...
<!-- [CCSAVE:END] -->

When you start a new session, Claude Code reads CLAUDE.md and picks up exactly where you left off.


Pro — Coming Soon

The free version covers manual saves and hook-based auto-saves. ccsave Pro will add:

  • Watch mode (ccsave watch) — background daemon that polls your session file and auto-saves based on size, message count, and time interval, with no hooks required
  • Status bar integration — live token count and last-save time displayed in the Claude Code status bar
  • Multi-project dashboard — view all projects and their snapshot history in one place

Sign up for early access: ccsave.dev (coming soon)


Contributing

Bug reports and pull requests are welcome.

git clone https://github.com/olex/ccsave
cd ccsave
npm install
npm run build
npm run dev -- save   # run from source

The source is TypeScript. npm run build compiles to dist/. The entry point is src/index.ts.

Please open an issue before submitting large PRs — it's worth aligning on approach first.


License

MIT — see LICENSE.