Skip to content
Skills Library
AI & agents · Analysis

session-stats

/session-stats

Analyze Claude Code session data from ~/.claude/projects/ to surface usage patterns, heavy sessions, and context-limit problems. Use when the user asks about their Claude Code usage, token consumption, or why sessions keep hitting context limits or compacting.

Licence
MIT
Last repository change
02.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/session_stats.py

What it does and when to use it

Analyze Claude Code session data from ~/.claude/projects/ to surface usage patterns, heavy sessions, and context-limit problems. Use when the user asks about their Claude Code usage, token consumption, or why sessions keep hitting context limits or compacting.

Original author description

Analyze Claude Code session data from ~/.claude/projects/ to surface usage patterns, heavy sessions, and context-limit problems. Use when the user asks about their Claude Code usage, token consumption, or why sessions keep hitting context limits or compacting.

How it works

  1. Reading the output
Original SKILL.md headings · 23 lines, 317 words
SKILL.md preview
---
name: session-stats
description: Analyze Claude Code session data from ~/.claude/projects/ to surface usage patterns, heavy sessions, and context-limit problems. Use when the user asks about their Claude Code usage, token consumption, or why sessions keep hitting context limits or compacting.
---

# Session stats

Run the script next to this file and interpret what comes back:

```bash
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.

## Reading the output

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:

- Which sessions look like they ran into context trouble — outlier context weight, or long duration paired with a high message count. Compare against the rest of *their* distribution, since what counts as heavy varies a lot between users.
- Which projects consume disproportionate context relative to how much they're used. Those are the candidates for a leaner CLAUDE.md or for pulling detail into skills that load on demand.
- Whether sessions are trending heavier over time, and whether one project drives the trend.

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.
Files in this package (2)
  • SKILL.md 2 KB
  • scripts/session_stats.py 7 KB

Versions

The database has no other skills named session-stats.

Database snapshot: 13.11.2026 · package version 6dc7197ebaf3 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100context-report
    Analyze Claude Code context efficiency. Use when evaluating session token usage.
  • 84prism-analyze
    Analyze Claude Code session health using PRISM. Use when asked to check token usage, audit CLAUDE.md, understand why sessions are failing, or list projects.
  • 100stats
    Use when user invokes /stats or asks about Claude Code usage, token consumption, session history, model distribution, or activity patterns. Generates an interactive HTML dashboard with charts and tables, auto-opens in browser. Also triggers on "how much have I used Claude",…
  • 100surface-usage-patterns
    Surface recurring patterns from Claude Code sessions and propose skills, plugins, agents, and CLAUDE.md improvements. Use when the user says \"surface usage patterns\", \"analyze my usage\", \"audit my sessions\", \"find improvement opportunities\", or wants to know what's worth…
  • 100work-stats
    Show token usage statistics across sessions. Use when you want to understand resource consumption or usage patterns.
  • 100claude-token-audit
    Show where Claude Code tokens and usage limits go, from the local session logs in ~/.claude/projects. Breaks usage down by project, session, day, model and tool, finds the biggest tool outputs flooding the context, measures cache hit rate and peak context per session, sizes what…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.