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

@ravilabs/prompt-analyzer

v1.0.0

Published

Analyze Claude Code session data — token usage, cache efficiency, cost estimates, and prompt improvement recommendations

Downloads

68

Readme

@ravilabs/prompt-analyzer

Analyze your Claude Code session data and generate a rich HTML report covering token usage, cache efficiency, API cost estimates, repeated prompt patterns, and actionable improvement recommendations.

Quick Start

# Run analysis and open HTML report in browser
npx @ravilabs/prompt-analyzer

# Install the /prompt-analysis skill into Claude Code
npx @ravilabs/prompt-analyzer install

What You Get

The HTML report includes:

| Section | What it shows | |---|---| | Executive Summary | Sessions, prompts, estimated cost, cache hit rate, date range | | Token Usage Over Time | Daily stacked chart — input / cache read / cache write / output | | Cache Efficiency | Hit/miss doughnut chart, per-model rates, $ saved vs uncached | | Cost Breakdown | Daily cost bar chart, per-model cost table | | Prompt Verbosity | Prompt length histogram, input:output ratio stats | | Repeated Patterns | Similar prompt clusters — CLAUDE.md and hook candidates | | Recommendations | Rule-based, actionable suggestions |

Commands

npx @ravilabs/prompt-analyzer              # Analyze + open report in browser
npx @ravilabs/prompt-analyzer analyze      # Analyze only (CI-friendly, no browser)
npx @ravilabs/prompt-analyzer install      # Install skill globally to Claude Code
npx @ravilabs/prompt-analyzer install --local  # Install skill to current project
npx @ravilabs/prompt-analyzer help         # Show help

Claude Code Skill

After running install, restart Claude Code and use /prompt-analysis in any session to trigger an interactive analysis with recommendations.

Data Sources

  • ~/.claude/projects/*/[session-id].jsonl — full conversation transcripts with token usage
  • ~/.claude/history.jsonl — global prompt history

No data leaves your machine. Everything runs locally.

Pricing Model Used

| Model | Input | Cache Write | Cache Read | Output | |---|---|---|---|---| | claude-sonnet-4-6 | $3.00/MTok | $3.75/MTok | $0.30/MTok | $15.00/MTok | | claude-opus-4-7 | $15.00/MTok | $18.75/MTok | $1.50/MTok | $75.00/MTok | | claude-haiku-4-5 | $0.80/MTok | $1.00/MTok | $0.08/MTok | $4.00/MTok |

Requirements

  • Node.js ≥ 18.0.0
  • Claude Code with at least one session recorded

Platform Support

Works on macOS, Linux, and Windows.

| Platform | Claude data path | |---|---| | macOS / Linux | ~/.claude/ | | Windows | %APPDATA%\Claude\ |

License

MIT