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

ccbaton

v0.3.5

Published

Context-aware session baton for Claude Code. Statusline + /baton + PreCompact safety net.

Readme

baton

baton is a Claude Code session snapshot and handoff tool. It writes the current working state into a structured BATON.md so a fresh Claude Code session can resume with the goal, recent decisions, active files, gotchas, and next concrete action intact instead of relying on degraded compacted context.

Prerequisites

  • Node.js >=20
  • Claude Code

Bun is only required for local development from this repository.

Install

npx ccbaton@latest

Or with Bun:

bunx ccbaton@latest

The installer patches ~/.claude/settings.json with self-locating commands that keep working after npx/bunx exits. Published installs use the bundled Node.js CLI; source-tree installs use bun run src/cli.ts.

If you install globally (npm install -g ccbaton), the postinstall script runs the installer automatically.

What gets installed:

  • a statusline command
  • UserPromptSubmit, PreCompact, and SessionStart hooks
  • /baton and /drop slash commands
  • the baton skill at ~/.claude/skills/baton/SKILL.md

After installing, restart Claude Code. If the installer warns that ~/.claude/skills/ was newly created, a full restart is required before the /baton skill is available.

Daily Flow

Use /baton when you reach a natural stopping point. Claude writes .claude/baton/BATON.md with the current session state.

Use /clear to start a clean session that automatically resumes from the baton. The SessionStart hook injects the baton into context, then archives it so the resume is one-shot.

Use /drop before /clear when you want to discard the pending baton and start completely fresh.

Use baton catch when the original session or terminal is already gone but .claude/baton/BATON.md still exists. If installed from the renamed package binary, use baton catch.

baton catch
baton catch --dry-run

Statusline

The statusline shows model, branch, context usage, baton state, rate limit, duration, and cost in one compact row:

Sonnet 4.5 | main* | [======----] 82k/200k | baton:fresh | 5h 71% | 12m | $1.24

When context gets high, baton nudges Claude to snapshot. At the hard threshold, it injects the baton protocol directly so Claude writes the baton before auto-compaction can discard useful state.

Configuration

BATON_FRESH_MS controls how long an existing BATON.md is considered fresh. The default is ten minutes:

BATON_FRESH_MS=1800000 claude

SESSION_AGE_NUDGE_MS controls the session-age nudge threshold. After 5 hours in a session with at least 30k tokens in context, baton suggests a snapshot even if token pressure is low. Configurable if you prefer a different window:

SESSION_AGE_NUDGE_MS=10800000 claude  # nudge after 3 hours instead

Commands

npx ccbaton@latest          # install or upgrade
npx ccbaton check           # verify current install state (exits 1 if anything missing)
npx ccbaton uninstall       # remove hooks, statusline, commands; restore settings.json from backup

After installing globally, the baton binary is available directly:

baton --version
baton install [--force]     # --force replaces a non-baton statusLine
baton uninstall
baton check
baton catch [--dry-run]
baton drop

Development

Bun is used to run tests and build the npm package:

bun install
bun test
bun run build
bun run src/cli.ts install

The package binary is baton; bun run build writes the portable Node.js CLI to dist/cli.js with a Node shebang for npm/npx execution.

Migrating From Handoff To Baton

  • In-flight .claude/baton/HANDOFF.md files can be renamed to BATON.md manually and will be picked up by the SessionStart hook as usual.
  • The installer automatically removes old ~/.claude/commands/handoff*.md and ~/.claude/skills/handoff/ on next install.