Skip to content
gentic.news — AI News Intelligence Platform
Connecting to the Living Graph…

Listen to today's AI briefing

Daily podcast — 5 min, AI-narrated summary of top stories

Real-time dashboard showing live Claude Code spend metrics with cost graphs and session data updating continuously
Open SourceScore: 62

Monitor Claude Code Spend in Real-Time with Claudestat's Live Dashboard

Claudestat is an open-source Node.js tool that provides a live terminal dashboard, quota guard, and MCP server for monitoring Claude Code and OpenCode sessions in real-time.

·21h ago·4 min read··6 views·AI-Generated·Report error
Share:
Source: github.comvia hn_claude_codeMulti-Source
How do I monitor Claude Code's token spend and detect loops in real-time?

Install Claudestat via npm, then run `claudestat` to see a live dashboard of tool calls, token costs, and quota alerts. Add the MCP server to ask Claude about its own usage.

TL;DR

Claudestat hooks into Claude Code events in real-time to show live spend, loop detection, and quota alerts from your terminal.

What Changed — Live Monitoring for Claude Code Sessions

Most Claude Code usage trackers—like ccusage—show you a report after your session ends. That's useful for post-mortems, but useless when you're mid-session and need to know right now whether you're burning through your quota on a loop.

Claudestat (open-source, MIT) changes that. It hooks into Claude Code's event system to capture every tool call, token spend, and context window event as it fires. It stores everything locally in SQLite, and surfaces a live dashboard, quota alerts, a loop detector, and even an MCP server so Claude can answer questions about its own usage.

What It Means For You — Concrete Impact on Daily Claude Code Usage

If you've ever:

  • Wondered "Why did my quota just drop $5 in 10 minutes?"
  • Discovered after a session that Claude was thrashing the context window on a loop
  • Wanted to ask "How much did I spend this week on this project?" without leaving the terminal

...Claudestat solves all three in real-time.

Key features that matter:

  • Live tool trace: Every tool call with duration and token cost, displayed as it happens
  • Quota guard: Alerts at 70%, 85%, and 95% of your budget; optional kill switch blocks new sessions
  • Loop detector: Flags context thrashing with estimated waste cost (huge for long-running tasks)
  • Cost projection: Linear regression with trend, confidence intervals, and R²
  • Billing blocks: Tracks 5-hour billing windows and cumulative spend per block
  • 52-week activity heatmap: Visualize your coding activity across the full year
  • Session sharing: Export any session summary as formatted ASCII or JSON

Try It Now — Installation and Setup

Monitor your Claude Code usage: Local Analytics Dashboard | by D…

Claudestat is a Node.js CLI tool. Zero cloud dependencies, runs on macOS, Linux, and Windows.

Quick Start

npm install -g claudestat

# Start the live dashboard
claudestat

That's it. It hooks into Claude Code's event system automatically. You'll see a terminal UI with live tool calls, token costs, and quota status.

Add the MCP Server

This is the killer feature: once you register the MCP server, you can ask Claude about its own usage from inside the terminal.

claude mcp add claudestat -s user -- claudestat-mcp

Then in any Claude Code session, just ask:

  • "How much did I spend this week?"
  • "What are my top 5 tools by cost?"
  • "Break down my usage by model"
  • "What's my cost projection for next month?"

Configuration

You can set quota thresholds, enable/disable the kill switch, and configure alert levels via a config file or environment variables. See the GitHub README for full docs.

Loop Detection in Action

If you've ever seen Claude Code get stuck in a loop—repeating the same tool call with slightly different parameters, each eating tokens—the loop detector flags it with an estimated waste cost. This alone can save you significant budget on long-running tasks.

Community and Next Steps

Claudestat is brand new (2 points on HN, 0 comments as of writing), but the concept is solid. It fills a gap that every heavy Claude Code user has felt: "I wish I could see what's happening right now."

For comparison, tools like ccusage are great for post-session analysis. Claudestat is for during the session. Both have their place.

If you use OpenCode, Claudestat supports it too—same live dashboard, tool calls, prompts, model, and intent tracking. You can even filter KPIs and charts by source (Claude Code vs. OpenCode) across all tabs.

Give it a star on GitHub if you find it useful—it helps other developers discover it.


Source: github.com

Source: gentic.news · · author= · citation.json

AI-assisted reporting. Generated by gentic.news from multiple verified sources, fact-checked against the Living Graph of 4,300+ entities. Edited by Ala SMITH.

Following this story?

Get a weekly digest with AI predictions, trends, and analysis — free.

AI Analysis

**What to do differently:** 1. **Install Claudestat before your next long session.** If you're running complex agentic tasks with `/loop` or multi-step workflows, loop detection and quota alerts are essential. Run `claudestat` in a separate terminal pane while Claude Code runs in another. 2. **Register the MCP server immediately.** This turns a passive monitor into an active assistant. Instead of tabbing out to check your Anthropic dashboard, just ask Claude "What's my spend so far today?" or "Which tools are costing me the most?"—and Claude answers from the live SQLite database. 3. **Set up the kill switch.** If you're on a limited budget (or billing by the hour), configure the quota guard with a kill switch at 95%. This prevents runaway sessions from burning through your credits while you're away from the keyboard.
This story is part of
Claude Code's Campus Conquest Flips Anthropic's Talent Pipeline, Leaving Google's Academic Edge in Doubt
Viral adoption at MIT and Stanford transforms Claude Code from product into recruiting funnel, threatening Google's long-held research talent dominance
Compare side-by-side
Claude Code vs Claudestat
Enjoyed this article?
Share:

AI Toolslive

Five one-click lenses on this article. Cached for 24h.

Pick a tool above to generate an instant lens on this article.

Related Articles

From the lab

The framework underneath this story

Every article on this site sits on top of one engine and one framework — both built by the lab.

More in Open Source

View all