Analyze Claude Code token output speed from local JSONL logs.
cc-speed reads your local Claude Code conversation logs (~/.claude/projects/**/*.jsonl) and calculates token output speed (tokens/sec) by measuring the time between user and assistant messages.
It provides:
- Per-model statistics (median, avg, p10, p90)
- Daily trend sparklines in terminal
- Interactive HTML charts (scatter plot + histogram) with dark theme
npm install -g cc-speedOr run directly:
npx cc-speed# Default: terminal table for the last 7 days
cc-speed
# Custom time range
cc-speed --days 30
# Generate HTML chart and open in browser
cc-speed --chart
# JSON output (for piping)
cc-speed --json| Flag | Description | Default |
|---|---|---|
-d, --days <n> |
Number of days to analyze | 7 |
-c, --chart |
Generate HTML chart and open in browser | - |
-j, --json |
Output as JSON | - |
You can use cc-speed as a /speed command inside Claude Code:
# One-line install
bash <(curl -fsSL https://raw.githubusercontent.com/bryant24hao/cc-speed/main/install-skill.sh)Or manually create ~/.claude/skills/cc-speed/SKILL.md:
---
name: speed
description: Analyze Claude Code token output speed
---
Run `npx cc-speed --chart` to analyze token output speed and generate charts.Then type /speed in Claude Code to trigger it.
- Scans
~/.claude/projects/**/*.jsonlfor recent conversation logs - Pairs each
assistantmessage with its precedingusermessage - Calculates
output_tokens / (assistant_timestamp - user_timestamp) - Filters:
output_tokens > 10, duration between 0.5s and 300s - Groups by model, computes statistics and trends
Note: The speed is an estimate based on timestamp deltas. It includes network latency and any processing overhead, so actual generation speed may be higher.
MIT