/session-stats:session-statsfrom session-stats
Analyzes Claude Code session data from ~/.claude/projects/ to surface usage patterns, heavy sessions, and context-limit problems.
Ships in session-stats. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Run the script next to this file and interpret what comes back:
python3 scripts/session_stats.py
When installed as a plugin the path is ${CLAUDE_PLUGIN_ROOT}/skills/session-stats/scripts/session_stats.py. It reads every .jsonl under ~/.claude/projects/ and takes no arguments.
The one thing that trips people up: total tokens is dominated by cache reads, which are re-counted on every assistant turn. A session showing hundreds of millions of "tokens" was not billed at that scale and did not process that much unique text — it means a large context was re-read many times. Output tokens and message count are the honest measures of how much work a session actually did; the total is best used as a relative signal of context weight, comparing sessions against each other rather than against an absolute number.
With that in mind, give the user a real read of their data rather than a restatement of the table:
Then suggest fixes that follow from what you actually saw. Sessions that balloon in context usually want /clear at natural task boundaries or /compact before auto-compaction fires. Heavy cache-creation relative to peers points at a large always-loaded CLAUDE.md. Many tool calls per session points at verbose operations worth delegating to subagents. Very long single sessions are usually less effective than several focused ones — say so when the data shows it, and skip it when it doesn't.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub leandroz/claude-plugins --plugin session-statsOther plugins' skills for the same job