Official agent skill

Session Usage Report

by anthropics in anthropics/claude-plugins-official

Builds an explorable HTML report of Claude Code usage over a chosen period: tokens, cache behavior, subagents, skills and costly prompts.

OfficialApache-2.0Auto-check passedAgent Workflows

Install Session Usage Report

skills CLI
$ npx skills add anthropics/claude-plugins-official --skill session-report -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install anthropics/claude-plugins-official session-report --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/anthropics/claude-plugins-official.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/session-report/skills/session-report .claude/skills/session-report && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
session-report
GitHub stars
37k
Token cost
~784 tokens
SKILL.md length
369 words
Files
3
Skills in repo
29
Repo updated
First seen
Licence
Apache-2.0

At a glance

Builds an explorable HTML report of Claude Code usage over a chosen period: tokens, cache behavior, subagents, skills and costly prompts.

  • Works in 5 steps: Get data. Run the bundled analyzer… → Read /tmp/session-report.json. Skim… → Copy the template (also bundled… → …
  • Finding out which projects or skills use the most tokens
  • SKILL.md covers Steps and Notes
  • Runs JavaScript scripts from its folder; calls node

What it does

The bundled `analyze-sessions.mjs` script reads your Claude Code transcripts, covers the last seven days by default, accepts ranges such as 24h, 30d or all, and outputs JSON. The agent then copies `template.html` into the current directory under a time-stamped name and embeds that JSON, so the page renders the total, tables, bars and drill-downs on its own.

The agent adds three to five one-line findings, expressed as a share of total tokens where possible and marked as problems, healthy signs or neutral facts, plus up to four suggestions tied to specific rows, such as scoping a command that spawns many subagents. It looks for a project or skill taking a disproportionate share, weak cache hits, single expensive prompts and heavy subagent types. The template's structure is left alone, and the agent only reports the saved file path.

When your agent uses it

  • Finding out which projects or skills use the most tokens
  • Checking cache hit rates and cache breaks over the past week
  • Spotting expensive prompts or subagent-heavy commands

Example prompts

  • “Generate a session report for the last 30 days.”
  • “Create a usage report for today and tell me which prompt cost the most.”
  • “Show me where my tokens went this week, in an HTML report I can explore.”

Requirements

  • Node.js to run `analyze-sessions.mjs`
  • Claude Code session transcripts under `~/.claude/projects`

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Get data. Run the bundled analyzer (default window: last 7 days; honor a different range if the user passed one, e.g. 24h, 30d, or all)…
  2. Read /tmp/session-report.json. Skim overall, by_project, by_subagent_type, by_skill, cache_breaks, top_prompts.
  3. Copy the template (also bundled alongside this SKILL.md) to the output path in the current working directory
  4. Edit the output file (use Edit, not Write — preserve the template's JS/CSS)
  5. Report the saved file path to the user. Do not open it or render it.

What it can do on your machine

Read from SKILL.md and the folder at commit d4226d0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (JavaScript), which the agent can run.

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Session Usage Report loads about 784 tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 369 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
When it runs · the whole SKILL.md, loaded when a task matches
~784

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from anthropics/claude-plugins-official at commit d4226d0, republished under its Apache-2.0 licence (© anthropics). 369 words, ~784 tokens.

Download SKILL.mdSave it as .claude/skills/session-report/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
session-report
description
Generate an explorable HTML report of Claude Code session usage (tokens, cache, subagents, skills, expensive prompts) from ~/.claude/projects transcripts.

Session Report

Produce a self-contained HTML report of Claude Code usage and save it to the current working directory.

Steps

  1. Get data. Run the bundled analyzer (default window: last 7 days; honor a different range if the user passed one, e.g. 24h, 30d, or all). The script analyze-sessions.mjs lives in the same directory as this SKILL.md — use its absolute path:

    sh
    node <skill-dir>/analyze-sessions.mjs --json --since 7d > /tmp/session-report.json

    For all-time, omit --since.

  2. Read /tmp/session-report.json. Skim overall, by_project, by_subagent_type, by_skill, cache_breaks, top_prompts.

  3. Copy the template (also bundled alongside this SKILL.md) to the output path in the current working directory:

    sh
    cp <skill-dir>/template.html ./session-report-$(date +%Y%m%d-%H%M).html
  4. Edit the output file (use Edit, not Write — preserve the template's JS/CSS):

    • Replace the contents of <script id="report-data" type="application/json"> with the full JSON from step 1. The page's JS renders the hero total, all tables, bars, and drill-downs from this blob automatically.
    • Fill the <!-- AGENT: anomalies --> block with 3–5 one-line findings. Express figures as a % of total tokens wherever possible (total = overall.input_tokens.total + overall.output_tokens). One line per finding, exact markup:
      html
      <div class="take bad"><div class="fig">41.2%</div><div class="txt"><b>cc-monitor</b> consumed 41% of the week across just 3 sessions</div></div>
      Classes: .take bad for waste/anomalies (red), .take good for healthy signals (green), .take info for neutral facts (blue). The .fig is one short number (a %, a count, or a multiplier like 12×). The .txt is one plain-English sentence naming the project/skill/prompt; wrap the subject in <b>. Look for: a project or skill eating a disproportionate share, cache-hit <85%, a single prompt >2% of total, subagent types averaging >1M tokens/call, cache breaks clustering.
    • Fill the <!-- AGENT: optimizations --> block (at the bottom of the page) with 1–4 <div class="callout"> suggestions tied to specific rows (e.g. "/weekly-status spawned 7 subagents for 8.1% of total — scope it to fewer parallel agents").
    • Do not restructure existing sections.
  5. Report the saved file path to the user. Do not open it or render it.

Show full SKILL.md (67 more words)Show less

Notes

  • The template is the source of interactivity (sorting, expand/collapse, block-char bars). Your job is data + narrative, not markup.
  • Keep commentary terse and specific — reference actual project names, numbers, timestamps from the JSON.
  • top_prompts already includes subagent tokens and rolls task-notification continuations into the originating prompt.
  • If the JSON is >2MB, trim top_prompts to 100 entries and cache_breaks to 100 before embedding (they should already be capped).

© anthropics, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files in plugins/session-report/skills/session-report of anthropics/claude-plugins-official.

  • SKILL.md
  • analyze-sessions.mjs
  • template.html

Open the folder on GitHubat commit d4226d0

Compare with similar skills

Session Usage Report next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Session Usage Report compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Session Usage Report this skillanthropics/claude-plugins-official37k—~784Automated safety check: PassApache-2.0
Analyzing Claude Code Sessionsamd/gaia1.6k—~2.3kAutomated safety check: PassMIT
Caveman Workflow LabelerJuliusBrussee/caveman110k1 repos~1.3kAutomated safety check: PassApache-2.0
Caveman Evidence ReviewJuliusBrussee/caveman110k1 repos~927Automated safety check: PassApache-2.0
CodexBar Usage Readersteipete/CodexBar22k—~320Automated safety check: PassMIT
Caveman Gateway SetupJuliusBrussee/caveman110k1 repos~2.6kAutomated safety check: WarnApache-2.0

Similar skills

  • Mines local Claude Code session transcripts with a deterministic Python pipeline to show what the agent is actually used for, how often it fails and what it costs.

    1.6k GitHub stars~2.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Caveman Workflow Labeler

    JuliusBrussee/caveman

    Finds every LLM workflow in a repository, proposes a labeling table and, once you agree, wires labels so Caveman Cloud groups spend per workflow.

    110k GitHub starsUsed in 1 repo~1.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Caveman Evidence Review

    JuliusBrussee/caveman

    Read-only review of Caveman Cloud data to explain where LLM spend goes: cost, score, workflows, traces, latency, errors, routing and verified savings.

    110k GitHub starsUsed in 1 repo~927 tokens
    AI & LLM EngineeringAuto-check passed
  • CodexBar Usage Reader

    steipete/CodexBar

    CodexBar read. Provider usage, limits, credits, config health. JSON. No writes.

    22k GitHub stars~320 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Caveman Gateway Setup

    JuliusBrussee/caveman

    Routes every LLM call in a repository through the Caveman Cloud gateway in record mode, so requests and costs are measured without changing behavior.

    110k GitHub starsUsed in 1 repo~2.6k tokens
    DevOps & CloudAuto-check: warnings
  • Queries Langfuse traces, prompts, datasets and sessions, and analyzes local LLM gateway logs for requests, context growth, token use and cache hits.

    223 GitHub stars~4.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes

More from anthropics/claude-plugins-official

All 29 skills in this repo
  • Hook Development for Claude Code Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code plugin hooks, both prompt-based checks and bash commands, for events such as PreToolUse, Stop and SessionStart.

    37k GitHub starsUsed in 11 repos~4.1k tokens
    Auto-check: notes
  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    37k GitHub starsUsed in 8 repos~2.8k tokens
    Auto-check passed
  • Plugin Settings Pattern

    anthropics/claude-plugins-official

    Official

    Shows how Claude Code plugins keep per-project settings and state in .claude/plugin-name.local.md files with YAML frontmatter and a markdown body.

    37k GitHub starsUsed in 7 repos~3k tokens
    Auto-check passed
  • MCP Integration for Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.

    37k GitHub starsUsed in 11 repos~3.1k tokens
    Auto-check passed
  • Claude Code Command Development

    anthropics/claude-plugins-official

    Official

    Explains how to write Claude Code slash commands: Markdown files with YAML frontmatter, arguments, file references, bash context and interactive prompts.

    37k GitHub starsUsed in 10 repos~4.8k tokens
    Auto-check passed
  • Claude Code Plugin Structure

    anthropics/claude-plugins-official

    Official

    Explains the directory layout, plugin.json manifest and component organization of a Claude Code plugin, including auto-discovery and portable paths.

    37k GitHub starsUsed in 10 repos~3.4k tokens
    Auto-check passed

Questions about Session Usage Report

What does Session Usage Report do?

Builds an explorable HTML report of Claude Code usage over a chosen period: tokens, cache behavior, subagents, skills and costly prompts. mjs` script reads your Claude Code transcripts, covers the last seven days by default, accepts ranges such as 24h, 30d or all, and outputs JSON.html` into the current directory under a time-stamped name and embeds that JSON, so the page renders the total, tables, bars and drill-downs on its own.

When should I use Session Usage Report?

Session Usage Report fits situations like: finding out which projects or skills use the most tokens; checking cache hit rates and cache breaks over the past week; spotting expensive prompts or subagent-heavy commands.

How do I install Session Usage Report in Claude Code?

Run `npx skills add anthropics/claude-plugins-official --skill session-report -a claude-code`. Or copy the skill folder (plugins/session-report/skills/session-report in anthropics/claude-plugins-official) into .claude/skills/session-report in your project. Claude Code loads it when a task matches its description.

How do I install Session Usage Report in Codex?

Run `npx skills add anthropics/claude-plugins-official --skill session-report -a codex`. Or copy the skill folder (plugins/session-report/skills/session-report in anthropics/claude-plugins-official) into .agents/skills/session-report in your project. Codex loads it when a task matches its description.

Can I use Session Usage Report in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add anthropics/claude-plugins-official --skill session-report -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/session-report, .gemini/skills/session-report, .github/skills/session-report and .opencode/skills/session-report in your project.

What does Session Usage Report need to run?

Going by SKILL.md and its folder, Session Usage Report needs JavaScript for the scripts in its folder and the command-line tools its instructions call (node). Our summary lists: Node.js to run `analyze-sessions.mjs`; Claude Code session transcripts under `~/.claude/projects`.

Does Session Usage Report access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Session Usage Report safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Session Usage Report use?

Session Usage Report is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Session Usage Report use?

About 784 tokens (SKILL.md is roughly 3.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Session Usage Report?

Skills that share tags, products or a category with Session Usage Report: Analyzing Claude Code Sessions (amd/gaia, 1.6k stars), Caveman Workflow Labeler (JuliusBrussee/caveman, 110k stars), Caveman Evidence Review (JuliusBrussee/caveman, 110k stars) and CodexBar Usage Reader (steipete/CodexBar, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Session Usage Report?

anthropics (a GitHub organization, an official publisher) maintains it in anthropics/claude-plugins-official, which has 37,477 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on October 7, 2026.

Source: anthropics/claude-plugins-official on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.