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

unforget

v0.2.1

Published

re-inject working state lost when Claude Code compacts context

Readme

unforget

Re-inject the working state Claude Code loses when it compacts context.

npm version npm downloads CI License: MIT Zero dependencies

unforget recovering working state after a compaction

When Claude Code compacts a long session it swaps the transcript for a short summary, and that summary is lossy: the file you were mid-edit on, the command that just failed, the approach you ruled out, the constraint you set 40 turns ago — gone.

unforget reads the on-disk transcript (append-only, survives compaction), works out exactly what was dropped, and re-injects a compact digest of it through a SessionStart hook — so the fresh context picks up where you left off.

  • Zero runtime dependencies. Local only, never a network call.
  • Reads only ~/.claude (or $CLAUDE_CONFIG_DIR); writes nothing but its own hook config.
  • Silent when there's nothing to recover — safe to wire to a hook.

Install

npm install -g unforget   # or: bunx unforget / npx unforget

Use

Add the hook once; every post-compaction session then starts with the digest re-injected:

unforget init           # shows the settings.json change, asks, backs up, then writes
unforget init --remove  # uninstall
unforget init --print   # print the hooks block instead of writing

It registers a SessionStart hook (matcher compact) with absolute paths, so it still fires when Claude Code launches from a GUI app with a minimal PATH. Symlink-safe; refuses a settings file it can't parse.

Inspect or verify by hand:

unforget digest [path]   # what the newest compaction dropped (--boundary N, --json)
unforget doctor    # hook installed? paths on disk? last injection fresh?

Does it work?

The built-in summary already covers most mechanical rediscovery; unforget catches what it drops. In the author's own dogfooding — 28 post-install compactions, self-measured:

  • 1.0 vs 3.06 median rediscoveries per compaction (files re-read / commands re-run that were already known). The mean is noisier (2.21 — a few image-heavy UI sessions rediscover a lot).
  • 97% of the working state the summary dropped was carried by the digest.
  • ~1,100 tokens of that state re-injected per compaction that needed it.

Small single-machine sample — directional, not a guarantee. Run bun bench/retro.ts against your own ~/.claude to measure it yourself.

How it works

  1. Find the newest transcript's last compact_boundary; read which message UUIDs survived.
  2. Dropped set = messages since the previous boundary that weren't preserved.
  3. Extract a deterministic digest from the dropped records: active task, in-flight edits, failed commands + last test result, dead-ends, constraints (don't / always …), next step.
  4. Drop anything the built-in summary already carries (summary read as a filter, never a source).
  5. Render markdown, empty sections omitted, capped at 9,500 characters.

Claude Code flushes the new boundary to disk only after hooks run, so the live hook (inject) windows from the last flushed boundary to end-of-file — the just-compacted turns — while digest reconstructs it after the fact. See docs/hook-contract.md.

Privacy

Reconstructing working state means reading message content — but only under your own ~/.claude, writing nothing outside its own config, with no network calls. Nothing leaves your machine.

Development

bun test && bunx tsc --noEmit && biome check src test && bun run build

MIT