| name | claude-code-experience |
| description | Compute how many hours the user has worked with Claude Code on this machine, from local transcripts (~/.claude/projects) and prompt history (~/.claude/history.jsonl). Use when the user asks "how many hours have I worked with Claude Code", "what's my Claude Code experience", "my Claude Code usage/stats/hours", or wants a monthly breakdown of their Claude Code activity. |
Claude Code Experience
Estimate total hands-on hours with Claude Code from local data. No network access needed.
Workflow
Step 1 — Run the analysis
Run the bundled script (can take a minute on large transcript dirs):
python3 scripts/analyze_usage.py
It prints a complete report; present the results to the user as a short summary
plus the monthly table. Lead with the calibrated lifetime estimate — that is
the headline number.
Step 2 — Offer a shareable image via ChatGPT
After presenting the numbers, give the user a copy-paste-ready block for
ChatGPT that turns the analysis into an image. Emit a single fenced block
containing exactly this prompt with the script's raw output inlined in place
of <output>:
turn this analysis into an image. Only the key facts.
<output>
How the numbers are computed (for explaining to the user)
- Active time = sum of gaps between consecutive events, each gap capped at an
idle timeout (5/15/30 min) — the WakaTime method. All events are merged into one
global timeline first, so parallel sessions are not double-counted.
- Transcripts (
~/.claude/projects/**/*.jsonl) have event-level granularity
but are auto-cleaned after ~30 days, so they only measure the recent window.
- Prompt history (
~/.claude/history.jsonl) survives cleanup and covers the
long term, but only records user prompts, so it undercounts time Claude spends
working between prompts.
- Calibration: over the window where both sources exist, the transcript-based
hours divided by the history-based hours gives an undercount factor; the lifetime
history number scaled by that factor is the calibrated estimate.
Caveats to mention
- Machine-local only: other machines, claude.ai/code web sessions, and anything
before the start of
history.jsonl are not counted. The script flags when
firstStartTime in ~/.claude.json predates the history file.
- "Wall clock with sessions open" is much larger than active time when the user
leaves sessions running — don't present it as hours worked.
- Honors
CLAUDE_CONFIG_DIR if set; ~/.claude.json stats (launches, projects)
are read best-effort.