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

@kosinal/claude-code-audit-trail

v0.1.3

Published

Audit trail for Claude Code: persist every user prompt with session, directory, and git context to a JSON file.

Readme

claude-code-audit-trail

Persist every prompt you send to Claude Code as a JSON audit-trail entry, with session, working directory, and git context. Cross-platform (macOS, Linux, Windows) — runs through npx.

Install

npx @kosinal/claude-code-audit-trail install

The installer:

  • Prompts for a destination folder (default: ~/.claude/audit-trail/).
  • Creates the folder and an archives/ subfolder.
  • Adds a UserPromptSubmit hook and a PostToolUse hook (matching AskUserQuestion|ExitPlanMode) to ~/.claude/settings.json.
  • Drops an audit-log-compact skill into ~/.claude/skills/.

You can pass a destination non-interactively:

npx @kosinal/claude-code-audit-trail install --dest /path/to/audit

What gets recorded

Each captured interaction produces one file in the destination folder:

{destDir}/2026-04-27T12-34-56-789Z__<session-id>.json

Two kinds of entries are written, distinguished by event_type:

user_prompt — every prompt the user types

{
  "timestamp": "2026-04-27T12:34:56.789Z",
  "session_name": "abc123…",
  "directory": "/Users/me/projects/foo",
  "git": {
    "branch": "main",
    "last_commit": {
      "hash": "…",
      "subject": "…",
      "author": "…",
      "date": "…"
    },
    "worktree_name": "feature-x"
  },
  "event_type": "user_prompt",
  "message": "the user prompt"
}

tool_answer — answers the user gives Claude through the UI

Captured for two tools:

  • AskUserQuestion — whenever Claude asks a structured question and the user picks an answer.
  • ExitPlanMode — only when the user rejects a plan and types feedback. Plain approvals are not logged.
{
  "timestamp": "2026-04-27T12:34:56.789Z",
  "session_name": "abc123…",
  "directory": "/Users/me/projects/foo",
  "git": { "...": "..." },
  "event_type": "tool_answer",
  "tool_name": "AskUserQuestion",
  "tool_input": { "...": "..." },
  "tool_response": { "...": "..." },
  "message": "{\"Which framework?\":\"React\"}"
}

If the working directory contains .claude/worktree (or .claude/worktrees), the path before that segment is recorded so worktree sessions trace back to the parent project. If git isn't available, git is null.

One file per event lets parallel Claude Code sessions write without locking.

Compacting

Old entries can be rolled into a zip archive:

npx @kosinal/claude-code-audit-trail compact

Produces {destDir}/archives/{firstISO}_{lastISO}.zip and removes the originals on success. The bundled audit-log-compact skill runs the same command from inside Claude Code.

Uninstall

npx @kosinal/claude-code-audit-trail uninstall

Removes the hook and the skill. Audit data and archives are preserved.

Requirements

  • Node.js 20 or newer.
  • git on PATH for git context (optional — entries still record without it).

License

GPL-3.0-only.