After using Claude Code for a while you start to wonder: how many tokens am I actually burning through? Which tools get called the most? Are my sessions getting bloated? Am I more productive in the morning or at night?

claude-stats answers all of that. It reads the session files that Claude Code writes locally to ~/.claude/projects/ and gives you a full analytics view in the terminal. Single Go binary, runs entirely offline, nothing sent anywhere.

Install

# Linux / macOS / WSL
curl -fsSL https://raw.githubusercontent.com/Andrevops/claude-stats/main/install.sh | sh

Or with Go: go install github.com/Andrevops/claude-stats/cmd/claude-stats@latest

Commands

Run claude-stats for an interactive menu, or use commands directly:

claude-stats tokens --week        # token usage and cost for the last 7 days
claude-stats tools --month        # which tools Claude called most
claude-stats heatmap --month      # when you work, by hour and day of week
claude-stats sessions --week      # session health — flags bloated contexts
claude-stats efficiency --week    # lines/turn, files/turn, error rate
claude-stats report --week        # everything in one compact view with a grade
claude-stats digest --ai          # AI-generated standup summary of your work
claude-stats trends               # this week vs last week, with trend arrows

All commands accept --yesterday, --week, --month, --all, or a specific date. The tokens, report, and trends commands also support --json for structured output.

[!note] The digest --ai command uses the claude CLI to generate a natural language summary of what you worked on — projects, branches, commits, files changed. Useful for standups.

What it catches

The sessions command flags sessions where context grew over 200% and recommends when to restart. Bloated sessions cost more and produce worse results. The prompts command simulates your settings.json allowlist and suggests new patterns to reduce the number of permission prompts you click through each day.

The report command combines everything into a scorecard with an overall grade so you can see at a glance if your usage patterns are healthy or drifting.

[!important] If you use claude-sandbox’s yolo command, those sessions are stored in the same ~/.claude/projects/ directory — claude-stats reads and analyzes them the same way.

Get it: github.com/Andrevops/claude-stats — single binary, Linux / macOS / WSL / Windows.