session-stats
Analyze Claude Code session data from ~/.claude/projects/ to surface usage patterns, heavy sessions, and context-limit problems.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Analyze Claude Code session data from ~/.claude/projects/ to surface usage patterns, heavy sessions, and context-limit problems.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Draft a cold email that gets a reply from someone influential — an investor, founder, hiring manager, podcast host, or potential collaborator. Use whenever the user wants to reach out to someone they don't know personally.
Generate a large idea set with four parallel agents, then filter it down through two debate rounds. Use when the user wants to brainstorm or explore possibilities for a project, product, feature, or strategy.
Refine a rough SPEC.md into an implementation-ready specification through a multi-round interview, then break it into ordered tasks. Use when starting a new feature or turning a rough idea into something a developer can build without asking questions.
基于 SOC 职业分类
| name | session-stats |
| description | Analyze Claude Code session data from ~/.claude/projects/ to surface usage patterns, heavy sessions, and context-limit problems. |
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/, needs no arguments, and works on any machine — it resolves the home directory itself.
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.