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 🙏

© 2025 – Pkg Stats / Ryan Hefner

claude-session-gists

v0.1.4

Published

Effect-TS utilities for extracting and archiving Claude Code sessions

Readme

claude-session-gists

Archive your Claude Code conversations alongside your commits for complete decision provenance.

npm version License: MIT

Why?

Important design and implementation decisions happen in Claude Code conversations. Link these conversations to your commits so you can understand the "why" behind every code change.

Quick Start

1. Install Globally

Using npm:

npm install -g claude-session-gists

Using pnpm:

pnpm add -g claude-session-gists

2. Authenticate with GitHub

gh auth login

Or set a personal access token:

export GITHUB_TOKEN=ghp_your_token_here

3. Use with Git Hooks (Recommended)

Install Husky in your project:

pnpm add -D husky
pnpm exec husky init

Create .husky/prepare-commit-msg:

#!/usr/bin/env bash

COMMIT_MSG_FILE=$1
COMMIT_SOURCE=$2

# Skip for merge/squash/amend
if [ "$COMMIT_SOURCE" = "merge" ] || [ "$COMMIT_SOURCE" = "squash" ] || [ -n "$3" ]; then
  exit 0
fi

# Create gist and save URL
GIST_TRAILER=$(claude-session-gists create --commit --since last-commit 2>/dev/null | grep "^Claude-Session:" | tail -1)

if [ -n "$GIST_TRAILER" ]; then
  echo "" >> "$COMMIT_MSG_FILE"
  echo "$GIST_TRAILER" >> "$COMMIT_MSG_FILE"
  echo "$GIST_TRAILER" > /tmp/claude-session-gists-gist-url
fi

Create .husky/post-commit:

#!/usr/bin/env bash

# Link commit to gist
if [ -f /tmp/claude-session-gists-gist-url ]; then
  GIST_URL=$(cat /tmp/claude-session-gists-gist-url | sed 's/Claude-Session: //')
  rm -f /tmp/claude-session-gists-gist-url
  [ -n "$GIST_URL" ] && claude-session-gists link-commit --gist "$GIST_URL" 2>/dev/null
fi

Make them executable:

chmod +x .husky/prepare-commit-msg .husky/post-commit

That's it! Now every commit will automatically:

  • Create a gist with the Claude conversation since your last commit
  • Add the gist URL to your commit message
  • Update the gist with a link back to the commit

CLI Commands

# List sessions for current project directory
claude-session-gists list

# List sessions from all projects
claude-session-gists list --all

# List sessions matching a project name
claude-session-gists list --project myproject

# Export most recent session from current project
claude-session-gists export --format markdown

# Create a gist from current project's session
claude-session-gists create --since last-commit

# Create a gist from a specific project
claude-session-gists create --project myproject

# Link a commit to an existing gist
claude-session-gists link-commit --gist <gist-url>

Note: By default, all commands scope to sessions from your current working directory. Use --all to see all projects or --project to filter by name.

Claude Code Integration

Search Sessions Slash Command

The package includes a /search-sessions slash command for use within Claude Code conversations.

Usage in Claude Code:

/search-sessions <query>

Examples:

/search-sessions error handling
/search-sessions API design
/search-sessions authentication

What it does:

  1. Searches your archived session gists for the query term
  2. Presents numbered results with dates, projects, commit info, and previews
  3. Offers three ways to load a session:
    • Load gist + git diff - View session content plus code changes
    • Load full local session - Access complete JSONL (if still exists locally)
    • Resume via /resume - Get guided to resume the actual session

This makes it easy to find and reference past design decisions and conversations directly from Claude Code.

Example Workflow

  1. Work on a feature with Claude Code
  2. Commit your changes: git commit -m "feat: Add user authentication"
  3. The hooks automatically:
    • Create a gist with your Claude conversation
    • Add Claude-Session: https://gist.github.com/... to the commit message
    • Update the gist with commit SHA and link
  4. Push: git push
  5. View your commit on GitHub - click the gist link to see the conversation that led to the code

Programmatic Usage

For library usage with Effect-TS, see the API documentation.

License

MIT © Clay Roach


Built with Effect-TS 💜