audit-session-metrics

audit-session-metrics is a skill for Claude Code, Codex from centminmod/my-claude-code-setup. It costs 147 tokens per session (2,024 once invoked), scanned A, original, MIT.

A report generator that reviews session-metrics JSON exports, which record an agent session’s token use, for avoidable usage.

In plain words
What is it for?
Use it to audit one session, all sessions in a project, or all projects in an instance, with quick or more detailed review modes.
Why use it?
It turns raw usage data into a prioritized explanation of where context or tokens were spent unnecessarily.

Skill for Claude CodeCodex

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,620 stars · on GitHub

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.

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

Made for: Claude Code, Codex.

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 audit-session-metrics

README.md
[![agentmods](https://agentmods.dev/badge/skills/centminmod/my-claude-code-setup/audit-session-metrics.svg)](https://agentmods.dev/skills/centminmod/my-claude-code-setup/audit-session-metrics)
Your own site
<a href="https://agentmods.dev/skills/centminmod/my-claude-code-setup/audit-session-metrics"><img src="https://agentmods.dev/badge/skills/centminmod/my-claude-code-setup/audit-session-metrics.svg" alt="Measured on agentmods" height="20"></a>
Per session 147 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,024 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00147 $0.02024
Opus 5 $0.00073 $0.01012
Sonnet 5 $0.00029 $0.00405
Haiku 4.5 $0.00015 $0.00202

Measured 5d ago against content hash 312c2f3ffdcd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

audit-session-metrics scanned grade A 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/audit-extract.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.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

`./CLAUDE.md`, `~/.claude/settings.json`, `./.claude/settings.json`,

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.claude/skills/audit-session-metrics/SKILL.md · 162 lines

How it starts

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

Audit Session-Metrics

Reads a session-metrics JSON export and produces a prioritised, plain-English audit of token-usage waste. It runs on the session's current model (it no longer pins one — a hard model pin capped the usable context at that model's window and broke invocation on long sessions). The work is mostly summarisation over a small disk-read export, so for a ~10× cheaper run /model haiku before invoking (short/early sessions only — Haiku's 200k window can't hold a long conversation).

Supports three JSON scopes auto-detected from digest.scope:

  • session — single session (session_*.json) — per-turn analysis
  • project — all sessions for one project (project_*.json) — per-session analysis
  • instance — all projects (instance/*/index.json) — per-project analysis

Dispatch — how to route this invocation

First positional argument received: $ARGUMENTS[0] Second positional argument received: $ARGUMENTS[1]

Read $ARGUMENTS[0] and match by literal equality:

$ARGUMENTS[0] Route Then read (session scope) Then read (project/instance scope)
quick Quick audit references/quick-audit.md see Scope routing below
detailed Detailed audit references/detailed-audit.md see Scope routing below
(empty / other) Print usage and stop this file's "Usage" block below

$ARGUMENTS[1] must be the path to a JSON export written by session-metrics. Accepted patterns:

  • exports/session-metrics/session_<id8>_<ts>.json — session scope
  • exports/session-metrics/project_<ts>.json — project scope
  • exports/session-metrics/instance/<datedir>/index.json — instance scope

If $ARGUMENTS[1] is missing, empty, or the file does not exist, print:

Usage: /audit-session-metrics {quick|detailed} <path-to-session-metrics.json>

Accepted JSON types: session: exports/session-metrics/session_.json project: exports/session-metrics/project_.json instance: exports/session-metrics/instance/*/index.json

Read the full file on GitHub · 162 lines

Files

What ships with it

6 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. 5d ago First seen · 162 lines · 147 tokens per session scan A 312c2f3ffdcd

Subscribe to this mod's changes

audit-session-metrics is a skill published in the GitHub repository centminmod/my-claude-code-setup (2,620 stars, last pushed 3d ago), licensed MIT. It adds 147 tokens to every session and 2,024 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 1 finding (reads agent configuration directories). 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-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

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

shadcn-ui

Build beautiful, accessible UIs with shadcn/ui components. Use this skill when creating forms, dialogs, tables, sidebars, or any UI components in Next.js. Covers installation, component patterns, react-hook-form integration with Zod validation, and dark mode setup.

mjunaidca/mjs-agent-skills · 60 tokens

sqlmodel-database

Design and implement database schemas using SQLModel with sync and async patterns. Use this skill when creating database models, setting up Neon PostgreSQL connections, defining relationships (one-to-many, many-to-many), implementing FastAPI dependency injection, or migrating schemas. Covers both sync Session and…

mjunaidca/mjs-agent-skills · 65 tokens

multi-agent-patterns

Design multi-agent architectures for complex tasks. Use when single-agent context limits are exceeded, when tasks decompose naturally into subtasks, or when specializing agents improves quality.

mjunaidca/mjs-agent-skills · 38 tokens