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

cc-session-audit

v1.0.1

Published

Compliance analyzer for Claude Code sessions. Forensic analysis of tool use, MCP servers, autonomous behavior, and policy violations.

Downloads

246

Readme

cc-session-audit

Compliance analyzer for Claude Code sessions. Forensic analysis of a session's tool use, MCP servers, autonomous behavior, and policy violations -- from the session's own JSONL transcript.

Install

npx cc-session-audit <session.jsonl>

Claude Code session transcripts live under ~/.claude/projects/<project>/<session-id>.jsonl.

What it does

Parses a Claude Code session JSONL file and reports, without sending anything off your machine:

  • Message counts -- human turns, assistant turns, tool uses, tool results, progress and system events
  • Interaction ratio -- human turns vs. autonomous assistant turns (a quick read on how hands-off the session ran)
  • Tool inventory -- every tool invoked, with counts and type (built-in vs. MCP)
  • MCP servers active -- which MCP servers the session actually called
  • File modifications -- writes/edits the session performed
  • Policy violations -- deviations from an optional policy file (denied tools/servers, restricted paths, autonomy budget)
  • Compaction events -- how many times the session's context was compacted

Usage

# Audit a session (terminal summary)
cc-session-audit ~/.claude/projects/my-project/abc123.jsonl

# Audit against a governance policy
cc-session-audit session.jsonl --policy policy.json

# JSON output, piped to jq
cc-session-audit session.jsonl --json | jq '.policy_violations'

Example output

Session Audit Report
====================
Session: test-session-2
File: /path/to/session.jsonl
Time range: 2026-04-15T10:00:00.000Z to 2026-04-15T10:00:30.000Z

Message Counts
--------------
  Human turns:     1
  Assistant turns:  4
  Tool uses:        3
  Tool results:     3
  Progress events:  0
  System events:    0

Interaction Ratio
-----------------
  1:4 (human:autonomous)

Tool Inventory
--------------
  Tool                                                Count  Type
  --------------------------------------------------  -----  ----
  mcp__claude_ai_Atlassian__searchJiraIssuesUsingJql      1  MCP
  mcp__claude_ai_Gmail__gmail_search_messages             1  MCP
  Write                                                   1  built-in

Policy file format

A policy is a JSON file. All fields are optional -- only the ones you set are enforced.

{
  "approved_tools": ["Read", "Grep", "Glob"],
  "denied_tools": ["Bash", "Write"],
  "approved_mcp_servers": ["claude_ai_Atlassian"],
  "denied_mcp_servers": ["claude_ai_Gmail"],
  "restricted_paths": ["/etc/", ".env"],
  "max_autonomous_turns": 20
}

| Field | Effect | |-------|--------| | approved_tools | Any tool used that is not in this list is flagged as unapproved_tool. | | denied_tools | Any tool used that is in this list is flagged as denied_tool. | | approved_mcp_servers | MCP servers not in this list are flagged. | | denied_mcp_servers | MCP servers in this list are flagged. | | restricted_paths | File modifications touching these paths are flagged. | | max_autonomous_turns | Flags runs whose consecutive autonomous turns exceed this budget. |

JSON output

--json emits the full AuditReport:

session_file, session_id, timestamp_range, message_counts,
tool_inventory, mcp_servers, interaction_ratio,
file_modifications, policy_violations, compaction_events

Each entry in policy_violations carries a rule, a human-readable detail, a timestamp, and the offending tool or path.

How it works

  1. Reads the session JSONL line by line (malformed lines are skipped, not fatal).
  2. Walks the message stream to tally turns, tool calls, tool results, and compaction events.
  3. Classifies each tool as built-in or MCP (MCP tools carry the mcp__<server>__<tool> prefix) and extracts the active server set.
  4. Derives the human:autonomous interaction ratio and the list of file modifications.
  5. If a policy file is supplied, evaluates each rule and emits structured violations.

All analysis is local; the session file never leaves your machine.

Sibling packages and plugins

License

MIT