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

v0.1.1

Published

git blame says WHO. claude-blame says WHICH CLAUDE SESSION. Link every git commit to the Claude Code conversation that wrote it, then jump back into it with one command.

Readme

claude-blame

git blame says WHO. claude-blame says WHICH CLAUDE SESSION.

Link every git commit to the Claude Code conversation that wrote it — then jump back into it with one command.

$ claude-blame src/auth.ts:42
commit a1b2c3d4e5f6  fix: handle expired refresh tokens
session 9e297d8a-ef72-483e-8599-d2d6c2874a6a
first prompt: refresh tokens are getting rejected after 24h, debug this

→ opening: claude --resume 9e297d8a-ef72-483e-8599-d2d6c2874a6a

A tiny CLI that records which Claude Code session was active when each commit was made. Later, you can run claude-blame <file>:<line> and jump straight back into the exact conversation that produced that code — full context, intact.

No cloud. No telemetry. Everything stays local in .git/ai-sessions.json.


Why this exists

You're 3 weeks into a project. A bug surfaces. You open the file, find the suspect line, and think:

"I wrote this with Claude... last Tuesday? Wednesday? Which session was it?"

Claude Code already saves every session as a .jsonl file. The conversation is on your disk. The problem is finding the specific one that wrote the specific line you're staring at.

claude-blame solves that with a post-commit hook + git blame.


Install

npm install -g claude-blame

Then, in any git repository where you use Claude Code:

claude-blame install

This adds a post-commit hook. From now on, every commit gets linked to your currently-active Claude Code session.

For commits made before you installed, try:

claude-blame backfill

It matches past commits to sessions by timestamp (best-effort — not perfect, but usually close).


Usage

# By file + line — jumps to the session that authored that line
claude-blame src/auth.ts:42

# By commit SHA — direct lookup
claude-blame a1b2c3d

# Print the transcript instead of opening Claude Code
claude-blame src/auth.ts:42 --print

# List recent commits and their linked sessions
claude-blame list
claude-blame list -n 25

How it works

  1. claude-blame install writes a post-commit hook into .git/hooks/post-commit.
  2. After every commit, the hook calls claude-blame _record, which:
    • reads ~/.claude/projects/<encoded-cwd>/*.jsonl,
    • picks the most recently modified session file (= the one you were just using),
    • saves commit_sha → session_id into .git/ai-sessions.json.
  3. When you run claude-blame <file>:<line>, it:
    • runs git blame on that line to find the commit,
    • looks up the session in .git/ai-sessions.json,
    • runs claude --resume <session_id> to drop you back into the conversation.

All local. No daemon. No network call.

How matches are scored

Claude Code stores each session under ~/.claude/projects/<encoded-cwd>/, where <encoded-cwd> is the directory Claude Code was launched from. So which session wrote your commit depends on where you launched Claude Code, not where the commit lives.

claude-blame reports three match qualities:

| Tag | Meaning | |---|---| | (no tag) | Exact match. Claude was launched from the repo root. Most accurate. | | ~ / (parent-dir match) | Claude was launched from a parent directory (e.g., your home folder) and you edited files inside this repo. Almost always correct, but not guaranteed. | | ? / (guess) | Set by claude-blame backfill. Matched by timestamp only — if multiple sessions overlap, this can mislink. Use sparingly. |

Best practice: launch Claude Code from the repo root (cd ~/my-project && claude) so every commit gets an exact match.


What gets stored

.git/ai-sessions.json:

{
  "version": 1,
  "commits": {
    "a1b2c3d4...": {
      "sessionId": "9e297d8a-ef72-483e-8599-d2d6c2874a6a",
      "sessionPath": "/Users/you/.claude/projects/-Users-you-proj/9e297d8a-....jsonl",
      "recordedAt": "2026-06-09T20:35:00.000Z"
    }
  }
}

The actual session transcript stays where Claude Code put it. claude-blame only stores the pointer.

You can .gitignore ai-sessions.json if you don't want to share session IDs across the team, or commit it if you do.


Requirements

  • Node.js ≥ 18
  • Git
  • Claude Code installed (claude on PATH) — only needed for the --resume jump, not for recording

Roadmap

  • [ ] MCP server version (so Claude Code can answer "why was this written?" without leaving the editor)
  • [ ] Cursor / Aider session detection
  • [ ] claude-blame --since=2.weeks (range lookups)
  • [ ] HTML transcript viewer fallback when Claude Code isn't installed
  • [ ] Team mode: optional shared session metadata via a separate sync repo

PRs welcome. See CONTRIBUTING.md.


FAQ

Does this send my conversations anywhere? No. Everything is local. The tool reads ~/.claude/projects/ (already on your disk) and writes .git/ai-sessions.json (in your repo).

What if I use multiple Claude Code sessions per commit? claude-blame records the most recently active one at the moment of commit. If you switch sessions a lot, the post-commit hook captures whichever was touched last.

Does it work for Cursor / Aider / Continue? Not yet — only Claude Code for now. PRs welcome.

Will it leak my session IDs if I git push ai-sessions.json? The session ID itself is harmless — but the path to the session file may reveal your home directory. If you push, consider .gitignore-ing the file.


License

MIT — see LICENSE.


Built by Cristian Tanase because I kept losing track of which Claude session wrote which line.