session-token-analysis

Analyze Claude Code session logs for token usage and cache metrics.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/SaintPepsi/brainstorm-pipeline --skill session-token-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-token-analysis
Source: https://github.com/SaintPepsi/brainstorm-pipeline/tree/main/skills/session-token-analysis
Command: npx skills add https://github.com/SaintPepsi/brainstorm-pipeline --skill session-token-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you understand and reduce your token consumption in Claude Code sessions, leading to more efficient and cost-effective usage.

Core Features & Use Cases

  • Token Usage Analysis: Breaks down input, output, and cache token usage per session.
  • Cache Performance: Reports cache hit rates to identify opportunities for better context reuse.
  • Context Growth Tracking: Visualizes how context grows over a session to prevent unexpected costs.
  • Cost Estimation: Provides estimated costs based on model pricing.
  • Use Case: After a long coding session, run this Skill to see exactly where your tokens went, identify if your cache is being used effectively, and get recommendations on how to reduce costs for future sessions.

Quick Start

Use the session token analysis skill to review the most recent session logs.

Frequently Asked Questions about session-token-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze Claude Code session logs for token usage and cost optimization?

To analyze Claude Code session logs for token usage and cost optimization, you can use Python scripts to extract detailed metrics on input, output, and cache performance. The Skill identifies inefficiencies and provides actionable recommendations to reduce costs.

What is cache hit rate and how does it affect Claude Code token consumption?

Cache hit rate in Claude Code measures how effectively context is reused across sessions, directly impacting token consumption. A higher cache hit rate means fewer new tokens are processed, leading to lower costs and more efficient context growth patterns.

Can I review token usage metrics for multiple recent Claude Code sessions?

Yes, you can review token usage metrics for multiple recent Claude Code sessions. The Skill supports analyzing several recent sessions or specific log files to track context growth, estimate costs based on model pricing, and identify optimization opportunities.

How do I track context growth patterns to prevent unexpected Claude API costs?

You can track context growth patterns to prevent unexpected Claude API costs by visualizing how context expands over a session. This analysis identifies inefficiencies in your token consumption and offers actionable recommendations for better cache performance.

Do I need Python scripts to estimate costs from Claude Code session logs?

Yes, you need Python scripts to estimate costs from Claude Code session logs. The Skill utilizes these scripts to process log files, calculate estimated costs based on model pricing, and generate detailed reports on cache performance and token usage.