◆ Terminal · Open Source · MIT

claudetop

Interactive terminal dashboard for Claude Code token usage and cost tracking — like htop, but for Claude AI.

npm version npm downloads CI status MIT License Node.js >=18
📦 Install on npm ★ View on GitHub
claudetop — zsh
  ◆ claudetop  —  Token usage dashboard for Claude Code

  [1] Dashboard  [2] Daily  [3] Sessions  [4] Projects  [5] Prompts  [6] Insights  [7] Analytics

  ┌─ OVERVIEW ─────────────────────────────────────────────────────────┐
  │ Total Tokens          Total Cost             Sessions          Daily Avg
  │ 345.6M                $28.40                 33                28.8M
  │ Feb 1 → Feb 23        avg $1.23/day           avg 2.1M/session  streak: 7d 🔥
  └────────────────────────────────────────────────────────────────────┘

  TODAY ──────────────────────────────────────────────────────────────
  Tokens: 52.2M   Cost: $4.12   Sessions: 3   Model: Opus 4
  vs yesterday: +35%
  Burn rate: ~62.6M tokens/day pace  ~$4.95/day pace

  THIS WEEK ──────────────────────────────────────────────────────────
  Mon  █████████░░░░░░░░░░░░  38.1M  $3.10
  Tue  ███████████████░░░░░░  61.2M  $5.20
  Sun  ████████░░░░░░░░░░░░░  52.2M  $4.12  ← today

Install

# Homebrew (macOS / Linux)
$ brew tap GauravRatnawat/claudetop https://github.com/GauravRatnawat/claudetop
$ brew install claudetop
# npm — run instantly without installing
$ npx claudetop
# npm — install globally
$ npm install -g claudetop
$ claudetop

Requires Node.js 18+ · macOS / Linux / WSL · Terminal ≥ 80×24 · Claude Code must have been run at least once.

Features

Instant startup

Reads ~/.claude/ directly. Renders in under a second with no server needed.

🔒

Fully offline

Zero network calls, ever. Your prompts and session data never leave your machine.

💰

Accurate cost tracking

Bills raw input, cache writes, cache reads, and output tokens at their correct Anthropic rates.

🖥️

SSH-friendly

Works over SSH. No browser, no port forwarding — pure terminal rendering.

🔧

Scriptable

Use --json, --summary, --today for cron jobs, shell pipes, and tmux status bars.

💡

13 auto insights

Detects vague prompts, model mismatch, marathon sessions, budget overruns, and more.

7 Views

KeyViewWhat it shows
[1]DashboardStat cards, burn rate, 7-day chart, model + token breakdown, top insights
[2]DailyPer-day tokens, cost, sessions with day-over-day delta, expandable detail panel
[3]SessionsAll sessions — searchable, sortable, filterable. Drill into every query turn
[4]ProjectsPer-project cost with expandable top-10 most expensive prompts
[5]PromptsTop 50 most expensive prompts. Vague prompts flagged with ⚠
[6]InsightsUp to 13 actionable behavioral insights with cost reduction tips
[7]AnalyticsTool usage, session histogram, weekly model trend, CLAUDE.md tracker, vague clusters

CLI — Non-interactive mode

# Today's token summary + projected daily cost $ claudetop --today Today (Feb 23): 52.2M tokens · $4.12 · 3 sessions · Top model: Opus 4 Burn rate: ~62.6M tokens/day pace · ~$4.95/day pace # All-time one-liner $ claudetop --summary All time: 345.6M tokens · $28.40 · 33 sessions · streak: 7d # Full JSON dump — pipe to jq $ claudetop --json | jq .totals