Agent skill

Audit Session Metrics

by centminmod in centminmod/my-claude-code-setup

Audit a session-metrics JSON export for token-usage waste and produce a plain-English findings report.

MITAuto-check passedAgent Workflows

Install Audit Session Metrics

skills CLI
$ npx skills add centminmod/my-claude-code-setup --skill audit-session-metrics -a claude-code

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

GitHub CLI
$ gh skill install centminmod/my-claude-code-setup audit-session-metrics --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/centminmod/my-claude-code-setup.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/audit-session-metrics .claude/skills/audit-session-metrics && 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
audit-session-metrics
GitHub stars
2.7k
Token cost
~2.1k tokens
SKILL.md length
834 words
Files
7 (incl. scripts, references)
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Audit a session-metrics JSON export for token-usage waste and produce a plain-English findings report.

  • Works in 5 steps: Run the extract helper once with the… → Scope routing — read the matching… → For detailed mode on session scope only,… → …
  • The user runs /audit-session-metrics
  • SKILL.md covers Dispatch — how to route this…, Steps, Tone and Why this is a separate skill, plus 1 more section
  • Runs Python scripts from its folder; calls python3

What it does

Audit Session Metrics is an agent skill from centminmod/my-claude-code-setup. Audit a session-metrics JSON export for token-usage waste and produce a plain-English findings report. Trigger when the user runs /audit-session-metrics, when session-metrics suggests an audit after an HTML export, or when the user asks to audit / review / find waste in a saved session-metrics JSON. Two modes: "quick" (ratios + cache health + top expensive turns/sessions) and "detailed" (adds CLAUDE.md / settings / re-read scan). Supports session, project, and instance JSON scopes. Args: $ARGUMENTS[0] =…

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts and reference files (for example `references/detailed-audit.md`, `references/instance-quick-audit.md` and `references/project-detailed-audit.md`).

It sits in Agent Workflows, covering Plain language and style rules and Agent instruction files. The repository describes itself as: Shared starter template configuration and CLAUDE.md memory bank system for Claude Code. The licence is MIT.

When your agent uses it

  • The user runs /audit-session-metrics
  • Session-metrics suggests an audit after an HTML export
  • The user asks to audit / review / find waste in a saved session-metrics JSON

Example prompts

  • “(ratios + cache health + top expensive turns/sessions) and”
  • “/audit-session-metrics”

Requirements

  • Python 3

Workflow steps

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

  1. Run the extract helper once with the input path
  2. Scope routing — read the matching reference file
  3. For detailed mode on session scope only, the playbook also asks
  4. Output contract — three artefacts. All playbooks specify the
  5. Write order. Populate the JSON object first using the digest

What it can do on your machine

Read from SKILL.md and the folder at commit 7d5c374. 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 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    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

Audit Session Metrics loads about 2.1k tokens when it runs, and up to ~15k if it reads all its reference files. Until then it costs about 150 tokens; SKILL.md has 834 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~150
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~15k

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); the scripts in this folder are not scanned.

SKILL.md

The full file from centminmod/my-claude-code-setup at commit 7d5c374, republished under its MIT licence (© centminmod). 834 words, ~2,081 tokens.

Download SKILL.mdSave it as .claude/skills/audit-session-metrics/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
audit-session-metrics
description
Audit a session-metrics JSON export for token-usage waste and produce a plain-English findings report. Trigger when the user runs /audit-session-metrics, when session-metrics suggests an audit after an HTML export, or when the user asks to audit / review / find waste in a saved session-metrics JSON. Two modes: "quick" (ratios + cache health + top expensive turns/sessions) and "detailed" (adds CLAUDE.md / settings / re-read scan). Supports session, project, and instance JSON scopes. Args: $ARGUMENTS[0] = quick|detailed, $ARGUMENTS[1] = path to a session-metrics JSON export.
effort
low

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 much cheaper run /model haiku before invoking. On the Anthropic API haiku is Haiku 5.5 (1M window, so long sessions fit; prompts over 100K tokens bill at its higher rate). On Bedrock, Google Cloud, Microsoft Foundry, and Claude Platform on AWS it is still Haiku 4.5 with a 200k window — short/early sessions only there.

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]RouteThen read (session scope)Then read (project/instance scope)
quickQuick auditreferences/quick-audit.mdsee Scope routing below
detailedDetailed auditreferences/detailed-audit.mdsee Scope routing below
(empty / other)Print usage and stopthis 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

…and stop without further work.

Steps

  1. Run the extract helper once with the input path:

    python3 scripts/audit-extract.py $ARGUMENTS[1] --mode $ARGUMENTS[0]

    The helper emits a single JSON digest to stdout. Read digest.scope from the output — it will be "session", "project", or "instance". Do not read the raw .jsonl, and do not re-derive numbers the digest already carries.

  2. Scope routing — read the matching reference file:

    digest.scope$ARGUMENTS[0]Reference file
    sessionquickreferences/quick-audit.md
    sessiondetailedreferences/detailed-audit.md
    projectquickreferences/project-quick-audit.md
    projectdetailedreferences/project-detailed-audit.md
    instancequick or detailedreferences/instance-quick-audit.md

    Follow the playbook step-by-step. Do not improvise additional phases.

  3. For detailed mode on session scope only, the playbook also asks you to read the user's config files (~/.claude/CLAUDE.md, ./CLAUDE.md, ~/.claude/settings.json, ./.claude/settings.json, ./.claudeignore). Each is capped at ≤500 lines — if a file is bigger, that itself is a finding.

  4. Output contract — three artefacts. All playbooks specify the same three-artefact contract:

    • JSON sidecar at <project>/exports/session-metrics/audit_<id8>_<ts>_<mode>.json — structured findings (versioned schema, enum'd metrics).
    • Markdown copy at <project>/exports/session-metrics/audit_<id8>_<ts>_<mode>.md — same content rendered for humans.
    • Inline chat output — the markdown content printed in your reply.

    <id8> and <ts> come from digest.session_id_short and digest.ts_str (the helper parses the input filename and normalises all three filename patterns).

  5. Write order. Populate the JSON object first using the digest values, write the JSON sidecar, render the markdown using the template in the playbook, write the markdown copy, then print the markdown inline (without the H1 heading — the chat client already shows context above the audit). Finish with two stderr-style lines on their own: [audit] saved → <json-path> [audit] saved → <md-path>

    IMPORTANT: Use the Write tool directly for steps 3 and 5. Do NOT generate a Python script (e.g. writing to /tmp/audit_synthesis.py and executing it) — this adds unnecessary failure modes (syntax errors, f-string escaping) and is never required. Build the JSON in the AI's own context; call Write. Render the markdown in context; call Write again.

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

Tone

  • Direct and specific. Cite the exact ratio, dollar figure, or turn index. No motivational language, no LLM-theory padding.
  • Prioritise by impact. Sort findings so the costliest fix is first.
  • Quote sparingly. Snippets capped at 5 lines each.
  • Honour the playbook. If quick-audit.md asks for 5 rows, produce 5 rows — don't invent a 6th to look thorough.

Why this is a separate skill

The audit is a distinct, user-initiated analysis step over a finished export, not part of generating one. It reads only the on-disk JSON — never the conversation — so it stands alone as its own turn, which is why session-metrics suggests /audit-session-metrics rather than invoking it programmatically. Running it as a fresh slash command keeps the turn focused and lets the user decide when to spend on it. The work is summarisation-heavy and the input is tiny, so the cost path is /model haiku before invoking (Haiku 5.5 with a 1M window on the Anthropic API; on other providers haiku is Haiku 4.5 with a 200k window, so short/early sessions only) — far cheaper than a frontier model, with identical output (every dollar figure is pre-computed by audit-extract.py, not guessed by the model).

Reference files

Session scope
Project scope
Instance scope
  • references/instance-quick-audit.md — Per-project cost breakdown, cache health, weekly cost trend. Used for both quick and detailed modes (no per-turn data available at instance scope).

© centminmod, MIT. 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 6 other files (scripts, references) in .claude/skills/audit-session-metrics of centminmod/my-claude-code-setup.

  • SKILL.md
  • references/detailed-audit.md
  • references/instance-quick-audit.md
  • references/project-detailed-audit.md
  • references/project-quick-audit.md
  • references/quick-audit.md
  • scripts/audit-extract.py

Open the folder on GitHubat commit 7d5c374

Compare with similar skills

Audit Session Metrics 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.

Audit Session Metrics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Audit Session Metrics this skillcentminmod/my-claude-code-setup2.7k—~2.1kAutomated safety check: PassMIT
Ponylang Prose Reviewponylang/ponylang-website160—~2.9kAutomated safety check: PassBSD-2-Clause
Inherit Legacy Styleaffaan-m/ECC275k1 repos~2.1kAutomated safety check: NotesMIT
Talk Normalhexiecs/talk-normal1.9k—~784Automated safety check: PassMIT
Asd Ste100danyuchn/asd-ste100-skill4k—~4.1kAutomated safety check: PassMIT
Firstmate Coding Guidelineskunchenguid/firstmate7.7k—~3.1kAutomated safety check: PassMIT

Similar skills

  • Ponylang Prose Review

    ponylang/ponylang-website

    Ensemble review of ponylang blog and Last Week in Pony prose.

    160 GitHub stars~2.9k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check passed
  • Prevent AI style drift on legacy projects by scanning the codebase for implicit conventions, resolving conflicts with the operator one at a time, and writing an enforceable .ai-style-rules.md…

    275k GitHub starsUsed in 1 repo~2.1k tokens
    Agent WorkflowsAuto-check: notes
  • Talk Normal

    hexiecs/talk-normal

    Installs an always-on set of rules into your agent's workspace config that cuts filler, hedging and padded closings from its replies.

    1.9k GitHub stars~784 tokensUpdated 5 mo ago
    Agent WorkflowsAuto-check passed
  • Asd Ste100

    danyuchn/asd-ste100-skill

    A skill your agent uses when English text must be parsed without a human to resolve ambiguity — tool descriptions, error messages, inter-agent instructions, system prompts, status reports — and…

    4k GitHub stars~4.1k tokensUpdated 4 days ago
    Writing & ContentAuto-check passed
  • Firstmate Coding Guidelines

    kunchenguid/firstmate

    Agent-only reference for changing firstmate's shared, tracked material per AGENTS.md section 1.

    7.7k GitHub stars~3.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Make A Plan

    penpot/penpot

    Planning flow — research the subject of this session, produce an implementation plan with the planner skill, resolve open questions with the user in plain language, and save the final plan to…

    61k GitHub stars~1.6k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from centminmod/my-claude-code-setup

  • AI Image Creator

    centminmod/my-claude-code-setup

    Generate, edit-from-reference, or analyze images with AI via OpenRouter (Gemini, GPT Image, Seedream, Qwen, MAI, Grok, FLUX.2, Recraft, Muse, Riverflow; Cloudflare AI Gateway BYOK).

    2.7k GitHub stars~8.1k tokensUpdated today
    Auto-check: notes
  • Session Metrics

    centminmod/my-claude-code-setup

    Tally Claude Code session token usage and cost estimates from the raw JSONL conversation log.

    2.7k GitHub stars~8k tokensUpdated today
    Auto-check passed
  • Claude Docs Consultant

    centminmod/my-claude-code-setup

    Consult official Claude Code documentation from code.claude.com using selective fetching.

    2.7k GitHub stars~959 tokensUpdated today
    Auto-check passed
  • Consult Codex

    centminmod/my-claude-code-setup

    Dual-AI code analysis pairing OpenAI Codex with Claude code-searcher — the lightest consult variant, two citation-verified perspectives.

    2.7k GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Consult Zai

    centminmod/my-claude-code-setup

    Dual-AI code analysis pairing z.ai GLM 5.2 with Claude code-searcher — a lightweight two-model second opinion.

    2.7k GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Task Breakdown

    centminmod/my-claude-code-setup

    Group a session-metrics session's turns into higher-level SEMANTIC TASKS ("what was I actually trying to do") and render a Tasks companion page (tasks.html + tasks.md) with a worth-it / mixed /…

    2.7k GitHub stars~2.4k tokensUpdated today
    Auto-check passed

Questions about Audit Session Metrics

What does Audit Session Metrics do?

Audit a session-metrics JSON export for token-usage waste and produce a plain-English findings report. Audit Session Metrics is an agent skill from centminmod/my-claude-code-setup. Audit a session-metrics JSON export for token-usage waste and produce a plain-English findings report.

When should I use Audit Session Metrics?

Audit Session Metrics fits situations like: the user runs /audit-session-metrics; session-metrics suggests an audit after an HTML export; the user asks to audit / review / find waste in a saved session-metrics JSON.

How do I install Audit Session Metrics in Claude Code?

Run `npx skills add centminmod/my-claude-code-setup --skill audit-session-metrics -a claude-code`. Or copy the skill folder (.claude/skills/audit-session-metrics in centminmod/my-claude-code-setup) into .claude/skills/audit-session-metrics in your project. Claude Code loads it when a task matches its description.

How do I install Audit Session Metrics in Codex?

Run `npx skills add centminmod/my-claude-code-setup --skill audit-session-metrics -a codex`. Or copy the skill folder (.claude/skills/audit-session-metrics in centminmod/my-claude-code-setup) into .agents/skills/audit-session-metrics in your project. Codex loads it when a task matches its description.

Can I use Audit Session Metrics 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 centminmod/my-claude-code-setup --skill audit-session-metrics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/audit-session-metrics, .gemini/skills/audit-session-metrics, .github/skills/audit-session-metrics and .opencode/skills/audit-session-metrics in your project.

What does Audit Session Metrics need to run?

Going by SKILL.md and its folder, Audit Session Metrics needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Audit Session Metrics 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 Audit Session Metrics 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. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Audit Session Metrics use?

Audit Session Metrics is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Audit Session Metrics use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 13k tokens, read only when the agent opens those files.

What are the alternatives to Audit Session Metrics?

Skills that share tags, products or a category with Audit Session Metrics: Ponylang Prose Review (ponylang/ponylang-website, 160 stars), Inherit Legacy Style (affaan-m/ECC, 275k stars), Talk Normal (hexiecs/talk-normal, 1.9k stars) and Asd Ste100 (danyuchn/asd-ste100-skill, 4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Audit Session Metrics?

centminmod (a GitHub user) maintains it in centminmod/my-claude-code-setup, which has 2,656 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 8, 2026.

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