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

v2.2.0

Published

Monitor and visualize your Claude Code token usage, costs, and ROI across projects

Readme

Claude Radar

npm tests license audit

Know exactly where your tokens go.

Local-first dashboard for Claude Code — track token usage, costs, ROI, and git cost-per-commit across all your projects. Your data never leaves your machine.

npx claude-radar

⚡ Quick Start

npx claude-radar

# Or install globally
npm install -g claude-radar
claude-radar serve

Opens the dashboard at http://localhost:3400. First run indexes your ~/.claude/ data (~5s).

✨ Features

Real-time canvas visualization. Each building = a project, height = cost. Stars twinkle on cache hits, sky shifts with spend intensity. Billing gauges, token rate sparkline, and stats bar overlay.

Three hero KPIs (paid vs API value vs ROI), 20+ interactive charts, project/model breakdown tables, activity heatmap. Everything you need at a glance.

Every git commit mapped to its Claude session cost. Cost per commit, per branch, per line of code. Most expensive commits ranked. Nobody else has this.

Gantt timeline, efficiency grades (A-F), duration tracking, cost-per-hour. Click any session for full message replay with token burn timeline.

12 automated detection rules: cost spikes, cache efficiency, 5-hour billing window, model recommendations, usage concentration, inactive projects, and more.

Interactive sliders: what if you shifted model usage? What if cache improved? See projected savings instantly.

GitHub-style 7×24 grid showing when you code with Claude most, by hour and day of week.

Auto-classifies sessions by work type: bug fixing, exploration, greenfield, refactoring, testing, review. Cost breakdown per type.

Tool usage distribution, call patterns, subagent cost tree. See which tools Claude uses most and how subagents contribute to cost.

5 tools for querying usage directly from Claude. "How much have I spent?" "Which project costs most?" Add to settings.json and ask.

claude-radar stats prints usage summary to terminal. Supports --json for scripting. No browser needed.

Tag and annotate important sessions for quick access later.

1-7 to switch tabs, ? for help, R to refresh. Full keyboard navigation.

One-click HTML report with KPIs, project table, model breakdown, git costs, and week-over-week comparison.

Auto-redacts API keys, tokens, JWTs, emails, IPs in message previews. 10 pattern types.

Dark (default), Light, and High Contrast.

**WebSocket watches ~/.**claude/ for changes. Dashboard updates as you code. Optional browser notifications.

JSON, CSV, and HTML report exports. All respect current date filters.

📦 Release Notes

  • 🎛️ "What If" Cost Simulator — model switching & cache improvement calculator
  • 📅 Activity Heatmap — GitHub-style hour × day grid
  • 📈 Prompt Efficiency Scoring — A-F grades per session
  • 🏷️ Session Clustering — auto-classify: bug fixing, exploration, greenfield, refactoring
  • 💰 Budget Alerts — monthly budget tracking with burn-down gauge
  • CLI Quick Statsclaude-radar stats terminal command
  • 🔖 Session Bookmarks — tag & annotate sessions
  • ⌨️ Keyboard Shortcuts — 1-7 tabs, ? help, R refresh
  • 🧠 Model Recommendations — "switch to Haiku and save $X"
  • 🔧 Subagent Cost Tree — parent → child cost hierarchy
  • 📄 Week-over-week Comparison — report generator with delta arrows
  • 💡 Tooltip Help — ? icons on every chart explaining what it shows
  • 📟 5h Window Gauge — real % from Claude statusline hook
  • 🗂️ New JSONL fields — speed, web_search, web_fetch, sidechain indexing
  • 📊 Cost per Line — LoC/$ charts on Git Costs tab
  • 🌃 Live City Skyline — real-time canvas visualization with buildings per project
  • 📟 Billing gauges — billing period + 5-hour window
  • 📈 Token rate sparkline — top-left rate history
  • 📊 Stats bar overlay — tok/sec, tokens, cost, cache, model, msgs
  • 🔄 WebSocket + polling — live data refresh every 5s
  • /api/live endpoint for 5h window stats
  • /api/project/:id and /api/projects endpoints
  • 📊 Executive dashboard with 15+ charts
  • 🔗 Git-to-cost tracking (cost per commit, branch, line)
  • 💬 Session browser with Gantt timeline
  • 🧠 AI Insights Engine (10 detection rules)
  • 🔧 Tool & subagent analytics
  • 🤖 MCP server with 5 tools
  • 📄 Report generator
  • 🔒 PII redaction (10 patterns)
  • 🎨 3 themes (dark, light, contrast)
  • 📡 Real-time WebSocket updates
  • 🧪 86 tests, 72% coverage
  • 🔐 Security: localhost-only, origin checking, parameterized SQL, SRI

💻 Commands

| Command | Description | |---------|-------------| | npx claude-radar | Start dashboard (default) | | claude-radar stats | Print usage summary to terminal | | claude-radar stats --json | JSON output for scripting | | claude-radar serve -p 8080 | Custom port | | claude-radar serve --no-open | Don't auto-open browser | | claude-radar setup | Configure subscription plan | | claude-radar mcp | Start MCP server (stdio) |

🤖 MCP Server

Let Claude answer questions about your usage in conversation.

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "claude-radar": {
      "command": "npx",
      "args": ["claude-radar", "mcp"]
    }
  }
}

Then ask: "How much have I spent?" · "Which project costs most?" · "Am I getting good ROI?"

📟 5-Hour Window Tracking

Claude Radar can show your real-time 5-hour billing window usage on the Live page.

Update your statusline in ~/.claude/settings.json to use the Claude Radar hook:

{
  "statusLine": {
    "type": "command",
    "command": "bash /path/to/claude-radar/bin/statusline-hook.sh"
  }
}

This captures rate_limits.five_hour.used_percentage and resets_at from Claude Code and feeds it to the dashboard gauge.

⚙️ How It Works

Claude Code stores detailed usage data in ~/.claude/. Claude Radar:

  1. Indexes JSONL files into SQLite (incremental — first run ~5s, subsequent instant)
  2. Deduplicates by UUID (other tools overcount by ~12%)
  3. Correlates git commits with session time ranges for cost-per-commit
  4. Serves via Express with 25+ REST endpoints + WebSocket
  5. Watches for changes and updates in real-time

🏗️ Architecture

~/.claude/ (read-only)          Claude Radar
┌─────────────────────┐        ┌──────────────────────────────┐
│ projects/*.jsonl     │──────▶│ SQLite Indexer (incremental)  │
│ stats-cache.json     │       │ Git Scanner (commit mapping)  │
│ history.jsonl        │       │ Express Server (25+ APIs)     │
└─────────────────────┘       │ WebSocket (live updates)      │
                               │ MCP Server (5 tools, stdio)   │
Your git repos                 └──────────┬───────────────────┘
┌─────────────────────┐                   │
│ .git/ (commit logs)  │──────▶ Dashboard (localhost:3400)
└─────────────────────┘        8 tabs · 20+ charts · 3 themes

🔐 Security

  • Binds to 127.0.0.1 only — not accessible from LAN
  • Origin checking on all HTTP and WebSocket connections
  • Parameterized SQL · Escaped HTML · execFileSync (no shell injection)
  • Chart.js with SRI hash · PII auto-redacted · npm audit: 0 vulnerabilities

📋 Requirements

  • Node.js 18+
  • Claude Code installed (with data in ~/.claude/)
  • Git (for commit cost tracking)

License

MIT