session-metrics

session-metrics is a skill for Claude Code from centminmod/my-claude-code-setup. It costs 182 tokens per session (7,827 once invoked), scanned B, original, MIT.

A tool for calculating token usage and estimated costs from Claude Code session logs, which are raw records of conversations with the coding agent. It can summarize one session, compare sessions, or aggregate projects.

In plain words
What is it for?
Use it to inspect a session’s spending, compare two model runs, create an all-projects usage dashboard, or prepare and run a comparison test suite.
Why use it?
It turns hard-to-read JSONL conversation records into totals and timelines for usage, cost, cache hits, and input and output tokens.

Skill for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Good fit Use it to inspect a session’s spending, compare two model runs, create an all-projects usage dashboard, or prepare and run a comparison test suite.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/centminmod/my-claude-code-setup/session-metrics
About the project

my-claude-code-setup is a starter configuration and memory-bank template for Claude Code, providing project guidance and reusable setup for Claude Code sessions. Developers use it to organize Claude Code behavior, memory, commands, skills, subagents, hooks, and settings. The catalogue entries are components of this Claude Code workflow.

centminmod/my-claude-code-setup · 2,673 stars · on GitHub · threads.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add centminmod/my-claude-code-setup --skill session-metrics
Clone the repo
git clone --depth 1 https://github.com/centminmod/my-claude-code-setup

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for session-metrics

README.md
[![agentmods](https://agentmods.dev/badge/skills/centminmod/my-claude-code-setup/session-metrics/github.svg)](https://agentmods.dev/skills/centminmod/my-claude-code-setup/session-metrics)
Your own site
<a href="https://agentmods.dev/skills/centminmod/my-claude-code-setup/session-metrics"><img src="https://agentmods.dev/badge/skills/centminmod/my-claude-code-setup/session-metrics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for session-metrics

Your own site · 80×15
<a href="https://agentmods.dev/skills/centminmod/my-claude-code-setup/session-metrics"><img src="https://agentmods.dev/badge/skills/centminmod/my-claude-code-setup/session-metrics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 182 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,827 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high System Prompt Leakage · line 194
    Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
    Fix: Remove any instructions that reveal, print, or output system prompts or internal rules. System instructions should never be exposed to end users.
  • medium Rogue Agent · line 401
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00182 $0.07827
Opus 5.5 $0.00073 $0.03131
Sonnet 5.5 $0.00036 $0.01565
Haiku 4.5 $0.00018 $0.00783

Measured 1mo ago against content hash 554b182dd0b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

session-metrics scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 26 executable files (scripts/_analytics.py, scripts/_charts.py, scripts/_cli.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks the agent to reveal its instructionsmediumSystem prompt leakage

Directions to print, repeat or translate the system prompt extract configuration the operator did not intend to expose.

assistant text are truncated to ~240 characters with a **Show full prompt** / **Show full response** toggle that reveals the full text (up
.claude/skills/session-metrics/SKILL.md · 474 lines

How it starts

The opening of the file, as written. The whole thing — 474 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Session Metrics

Runs scripts/session-metrics.py against the Claude Code JSONL log to produce a timeline-ordered cost summary with per-turn and cumulative totals.

Dispatch — how to route this invocation

First positional argument received: $ARGUMENTS[0] Full argument string: $ARGUMENTS

Read $ARGUMENTS[0] above and match it by literal equality against the table below. Claude Code already tokenized the arguments shell-style, so no parsing is required — just compare strings.

$ARGUMENTS[0] Route Then read
all-projects Instance-wide dashboard aggregating every project under ~/.claude/projects ## Instance dashboard (all projects) below
compare Two-session compare on JSONLs that already exist ## Model comparison below, then references/model-compare.md before running
compare-run Fully automated capture: spawns two claude -p sessions, feeds the suite, then runs --compare ## Model comparison below, then references/model-compare.md "Workflow A — automated"
compare-prep Print manual capture protocol + 10-prompt suite (fallback when headless is unavailable) ## Model comparison below
count-tokens API-key-only tokenizer check ## Model comparison below
export Natural-language export shortcut — scan full arg string to determine session vs project scope ## Export shortcuts below
project All sessions for the current project — timeline + per-session subtotals + grand total ## Quick usage below (--project-cost); also scan remaining args for --output format flags
project-cost Alias for project ## Quick usage below (--project-cost); also scan remaining args for --output format flags
(empty, or any other value) Default single-session report ## Quick usage below

Read the full file on GitHub · 474 lines

Files

What ships with it

54 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 474 lines · 182 tokens per session scan B 554b182dd0b8

Subscribe to this mod's changes

session-metrics is a skill published in the GitHub repository centminmod/my-claude-code-setup (2,673 stars, last pushed 13d ago), licensed MIT. It adds 182 tokens to every session and 7,827 once invoked, about $0.0007 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks the agent to reveal its instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

memory-bank

Token-efficient persistent memory system for Claude Code that saves 67% tokens on session warm-up (verified with tiktoken). Layered architecture with progressive loading, compact encoding, branch-aware context, smart compression, session diffing, conflict detection, session continuation protocol, and recovery mode.…

josiahcrackle9631/memory-bank · 199 tokens

chatkit-actions

Implements interactive widget actions and bidirectional communication patterns for ChatKit. This skill should be used when building AI-driven interactive UIs with buttons, forms, entity tagging (@mentions), composer tools, and server-handled widget actions. Covers the full widget lifecycle from creation to replacement.

mjunaidca/mjs-agent-skills · 60 tokens

chatkit-integration

Foundation skill for integrating OpenAI ChatKit framework with custom backends. This skill should be used for initial ChatKit setup including server implementation, React component integration, authentication, context injection, and database persistence. For streaming UI patterns use chatkit-streaming. For interactive…

mjunaidca/mjs-agent-skills · 66 tokens

better-auth-setup

Guide implementation of OAuth 2.1 / OIDC authentication using Better Auth with the OIDC Provider plugin. Use this skill when setting up centralized authentication for multiple apps, implementing SSO across a platform, creating an OAuth authorization server, or integrating Better Auth as an identity provider. Covers…

mjunaidca/mjs-agent-skills · 91 tokens

better-auth-sso

Integrate with Better Auth SSO for OAuth2/OIDC authentication. Use this skill when implementing SSO login flows, PKCE authentication, token management, JWKS verification, or global logout in Next.js applications connecting to a Better Auth server.

mjunaidca/mjs-agent-skills · 54 tokens

fastapi-backend

Build production-grade FastAPI backends with SQLModel, Pydantic, and JWT authentication. Use this skill when building REST APIs, integrating with Neon PostgreSQL, implementing Better Auth JWT verification, or creating CRUD endpoints. Includes patterns for audit logging, worker/agent parity, and OpenAPI documentation.

mjunaidca/mjs-agent-skills · 65 tokens