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

ccanalyzer

v2.2.0

Published

Web-based analyzer for Claude Code sessions

Readme

ccanalyzer

A web-based dashboard for analyzing your Claude Code sessions — costs, token usage, agent activity, and conversation timelines.

Node.js >= 18 npm

ccanalyzer session detail with Gantt timeline

Usage

npx -y ccanalyzer@latest

Opens a local dashboard at http://localhost:3737 in your browser.

If port 3737 is already in use, specify a different port with -p:

npx -y ccanalyzer@latest -p 3738

By default the server binds to 127.0.0.1 (localhost only). To expose it — for example when running inside a Docker container where port-forwarding routes through eth0 rather than the container loopback — bind to all interfaces via the HOST env var or the --host flag:

HOST=0.0.0.0 npx -y ccanalyzer@latest
# or
npx -y ccanalyzer@latest --host 0.0.0.0

Features

  • Dashboard — all projects with token counts, costs, and last activity (sortable columns)
  • Tool usage — tool, skill, MCP-server and subagent activity, globally or filtered per project, as charts + sortable tables
  • Session browser — list sessions per project sorted by recency, with a per-project tool-usage breakdown
  • Session detail — full message thread with token/cost breakdown per exchange, plus a per-conversation tool-usage panel
  • Gantt timeline — visual timeline of user turns, AI responses, and spawned agents
    • Click a message bar → see the exchange inline
    • Click an agent bar → open the full agent conversation in a popup
  • Agent popup — complete agent conversation with stats (input/output tokens, cost)

Custom config directory

By default, ccanalyzer reads ~/.claude. To analyze a different Claude config directory (e.g. a work profile or a custom CLAUDE_CONFIG_DIR):

CLAUDE_CONFIG_DIR=/path/to/your/.claude npx -y ccanalyzer@latest

Example — analyze a secondary profile:

CLAUDE_CONFIG_DIR=~/.claude-work npx -y ccanalyzer@latest

Analyzing OpenCode sessions (experimental)

ccanalyzer can also analyze OpenCode sessions. OpenCode stores its data in a local SQLite database (opencode.db); ccanalyzer reads it read-only and maps it onto the same dashboard, session browser, Gantt timeline, and tool-usage views.

# via flag
npx -y ccanalyzer@latest --source opencode

# or via env
CCANALYZER_SOURCE=opencode npx -y ccanalyzer@latest
  • The default source stays Claude Code (--source claude); nothing changes for existing users.

  • Costs are taken from OpenCode's own per-message figures, so multi-provider models (Anthropic, Google, OpenAI, …) are reported accurately.

  • By default ccanalyzer looks for the database under $XDG_DATA_HOME/opencode (falling back to ~/.local/share/opencode). Override the location with OPENCODE_DATA_DIR:

    OPENCODE_DATA_DIR=/path/to/opencode npx -y ccanalyzer@latest --source opencode

Note: the OpenCode source uses Node's built-in node:sqlite, which requires Node 22+. The Claude Code source still runs on Node 18+.

Docker

A ready-to-use docker-compose.yaml is included:

services:
  node:
    image: node:22-slim
    restart: unless-stopped
    environment:
      - HOST=0.0.0.0                        # bind all interfaces (see note below)
      - CLAUDE_CONFIG_DIR=/data/.claude     # where ccanalyzer reads sessions from
    volumes:
      - ${HOME}/.claude:/data/.claude:ro    # host Claude data, mounted read-only
    command: [npx, -y, ccanalyzer@latest, -p, "${APP_PORT}"]
    ports:
      - "${APP_PORT}:${APP_PORT}"

With an .env next to it:

APP_PORT=3737

Then:

docker compose up

Two things are essential in a container:

  • HOST=0.0.0.0 — the server defaults to 127.0.0.1, which inside a container only covers the container loopback. Docker's port-forwarding routes through eth0, so without this you get connection reset by peer.
  • Mounting your Claude data — ccanalyzer reads sessions from ~/.claude/projects/**. Mount the host's ~/.claude into the container and point CLAUDE_CONFIG_DIR at it, otherwise the dashboard starts up empty.

Development

To run from a local clone (instead of npx):

git clone https://github.com/olivier-j/ccanalyzer.git
cd ccanalyzer
npm install
npm run dev

npm run dev uses Node's built-in --watch, so the server restarts on changes to src/parser.js / src/server.js. Frontend edits (src/public/**) are served statically — just refresh the browser (hard-refresh, as assets are cache-busted with ?v=). Use npm start for a plain run without the watcher.

The same flags and env vars apply as above, e.g.:

PORT=3738 CLAUDE_CONFIG_DIR=~/.claude-work npm run dev

Requirements

  • Node.js >= 18
  • Claude Code sessions in ~/.claude/projects/ (or your custom CLAUDE_CONFIG_DIR)

Contributing

Contributions are welcome! See CONTRIBUTING.md to get started, and please follow the Code of Conduct.

License

MIT