High-performance Claude Code status line, support tokens usage statistics.
- Session Info Display: Duration, model name, context usage percentage, project name, Git branch, current directory
- Token Statistics:
- Multi-dimensional: Day/week/month/total token usage
- High Performance: Smart caching and concurrent processing, millisecond-level response
- Beautiful Output: ANSI colors, progress bar, separator formatting
npm install -g @asathinkeroops/ccstatusline⏱ 2h15m30s | ◆ CLAUDE-SONNET-4-6 | ○ ████████░░ 85% | ◈ gateway | ⎇ main | • ~/projects/gateway
────────────────────────────────────────────────────────────────────────────────────────────────────
◇ Day 125.3K | ▸ Week 1.2M | ▪ Month 8.5M | ◉ Total 52.1M
Reads Claude Code session logs from ~/.claude/projects/ and outputs JSON statistics:
ccstatusline tokens-usage --period allOutput format:
{
"day": { "total_tokens": 125300, ... },
"week": { "total_tokens": 1200000, ... },
"month": { "total_tokens": 8500000, ... },
"total": { "total_tokens": 52100000, ... }
}Receives Claude Code stdin JSON, calls Go CLI for statistics, formats and outputs two-line status line.
# Today's usage (default)
ccstatusline tokens-usage
# This week's usage
ccstatusline tokens-usage --period week
# This month's usage
ccstatusline tokens-usage --period month
# This year's usage
ccstatusline tokens-usage --period year
# Total usage
ccstatusline tokens-usage --period total
# All periods at once
ccstatusline tokens-usage --period all
# Specific date range
ccstatusline tokens-usage --start 2026-01-01 --end 2026-03-31
# Filter by model
ccstatusline tokens-usage --model claude-sonnet-4-6
# Filter by project
ccstatusline tokens-usage --project gateway
# Disable cache
ccstatusline tokens-usage --no-cache
# Clear cache
ccstatusline tokens-usage --clear-cache- Concurrent Processing: Goroutine worker pool (max 8 concurrent)
- Large File Support: 10MB buffer for handling large JSON lines
- Smart Cache: Incremental cache, historical data persisted, only parse today's data each run
- Multi-timestamp Compatibility: Supports multiple timestamp format parsing
- Location:
~/.ccstatusline/cache/tokens-usage/ - Structure:
summary.json- Global aggregated statisticsmetadata.json- Last updated date and cache versiondaily/<month>.json- Daily stats per month
- Incremental Update: Each run detects missing dates, only parses new data
go build -o ccstatusline .cd packages/npm
npm run buildcd packages/npm
npm linkMIT
