Agent skill · Audited from source
Session Metrics
skill · centminmod/my-claude-code-setupMIT licenceAudited 8 Oct 2026 · source 279fe3d84db5
Is it safe? No — BLOCK, grade D (68/100). We read this skill's source at commit 279fe3d84db5 and observed filesystem, network and shell access and no hard-coded secrets. The audit raised 14 findings, 2 critical or high. What it does: Tally Claude Code session token usage and cost estimates from the raw JSONL conversation log. Trigger when the user asks about session cost, token usage, API spend, cache hit rate, input/output tokens, or wants a…
Cite
Cite this page
ModelsAtlas. “Session Metrics (centminmod/my-claude-code-setup)”. Retrieved 8 Oct 2026. https://modelsatlas.com/skills/centminmod/session-metrics
Blocked. The page stays public so you can check this skill if someone recommended it to you. The audit found 2 critical or high findings, starting with “Code injection” in scripts/_data.py:392. Do not install it without reading them.
Trust audit
Audit 0.4.1 · source read 8 Oct 2026
BLOCK means the audit found something that could harm you or your machine. Grade D is shared by 749 of 18,389 audited skills.
What the source does
- FilesystemDeclared1 observation
- NetworkDeclared8 observations
- ShellDeclared2 observations
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 0 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | FAIL | 13 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 1 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (14)
HIGHCode injectioncode.deserialize · scripts/_data.py:392
return pickle.load(fh)
- Why
- deserialises untrusted bytes into live objects
- Fix
- use json or yaml.safe_load
HIGHCode injectioncode.eval_exec · scripts/session_metrics_compare.py:1543
exec(src, ns) # trusted skill-shipped code — no sandbox
- Why
- evaluates text as code
- Fix
- remove; use a parser or a dispatch table
MEDIUMNetwork egressnet.beacon_words · scripts/_html_sections.py:4227
'<button data-theme="theme-beacon">Beacon</button>'
- Why
- No further detail recorded for this rule.
- Fix
- —
MEDIUMNetwork egressnet.beacon_words · scripts/_html_sections.py:4246
'if(!/^(beacon|console|lattice|pulse)$/.test(t))t="console";'
- Why
- No further detail recorded for this rule.
- Fix
- —
MEDIUMObfuscation / stealthobf.homoglyph · scripts/session_metrics_compare.py:1884
hdr = (f" {'#':>3} {'A input':>8} {'B input':>8} {'Δin':>6} "- Why
- No further detail recorded for this rule.
- Fix
- —
MEDIUMObfuscation / stealthobf.homoglyph · scripts/session_metrics_compare.py:1885
f"{'A out':>7} {'B out':>7} {'Δout':>6} "- Why
- No further detail recorded for this rule.
- Fix
- —
MEDIUMObfuscation / stealthobf.homoglyph · scripts/session_metrics_compare.py:1886
f"{'A cost':>9} {'B cost':>9} {'Δcost':>6}{extras}")- Why
- No further detail recorded for this rule.
- Fix
- —
LOWInsecure cryptocrypto.weak_hash · scripts/_data.py:358
path_hash = hashlib.sha1(abs_path.encode("utf-8")).hexdigest()[:8]- Why
- No further detail recorded for this rule.
- Fix
- —
LOWInsecure cryptocrypto.weak_hash · scripts/_data.py:425
_ph = hashlib.sha1(_abs.encode("utf-8")).hexdigest()[:8]- Why
- No further detail recorded for this rule.
- Fix
- —
LOWInsecure cryptocrypto.weak_hash · scripts/_turn_parser.py:517
return hashlib.sha1(canon.encode("utf-8")).hexdigest()[:16]- Why
- No further detail recorded for this rule.
- Fix
- —
LOWInsecure cryptocrypto.weak_hash · scripts/session_metrics_compare.py:157
return hashlib.sha1(head.encode("utf-8")).hexdigest()- Why
- No further detail recorded for this rule.
- Fix
- —
LOWObfuscation / stealthobf.decode_call · scripts/vendor/charts/highcharts/v12/export-data.js:14
*/function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.AST,t._Highcharts.Chart):"function"==typeof define&&define.amd?define("highcharts/modules- Why
- No further detail recorded for this rule.
- Fix
- —
LOWObfuscation / stealthobf.decode_call · scripts/vendor/charts/highcharts/v12/exporting.js:13
*/function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(e._Highcharts,e._Highcharts.AST,e._Highcharts.Chart):"function"==typeof define&&define.amd?define("highcharts/modules- Why
- No further detail recorded for this rule.
- Fix
- —
INFOPrompt injectionprompt.conditional_escalation · SKILL.md:168
> **Invocation note for the AI.** Don't pass `--tz` or `--utc-offset` unless the user explicitly asks for a specific timezone. The script auto-detects the user's system tz and renders all human-facing
- Why
- No further detail recorded for this rule.
- Fix
- —
Audit 0.4.1 · source sha 279fe3d84db5 · 8 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publishercentminmod GitHub userOwner of the repository this skill is read from
- Source foldercentminmod/my-claude-code-setup/.claude/skills/session-metricsThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdict279fe3d84db5A new audit runs when the source changes
- Repository statusNot archivedPushed today
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Tally Claude Code session token usage and cost estimates from the raw JSONL conversation log. Trigger when the user asks about session cost, token usage, API spend, cache hit rate, input/output tokens, or wants a…
---
name: session-metrics
effort: medium
description: >
Tally Claude Code session token usage and cost estimates from the raw JSONL
conversation log. Trigger when the user asks about session cost, token usage,
API spend, cache hit rate, input/output tokens, or wants a breakdown of how
much a Claude Code session has cost. Also trigger for "how much have we spent",
"show me token usage", "session summary", "cost so far", or any request to
analyse or display per-turn metrics from the current or a past session.
Do NOT auto-dispatch compare mode (--compare / --compare-prep / --compare-run
/ --count-tokens-only) from natural-language phrases. The skill body uses
$ARGUMENTS[0] as the dispatch key — if the first positional argument is not
literally "compare", "compare-prep", "compare-run", or "count-tokens", route
to the default single-session report.
---
# 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`](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`](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 |
This is the single gate that keeps compare mode off the natural-language
path. **Do not infer the route from the user's chat history; only use the
literal value of `$ARGUMENTS[0]` above.**
When the skill auto-triggers from a natural-language question ("how much did
this session cost?", "show me token usage"), there are no positional
arguments — `$ARGUMENTS[0]` is empty — and you always route to the default.
Phrases like "compare 4.6 vs 4.7 cost" arriving as natural language do NOT
produce `$ARGUMENTS[0] = compare` and must not route into compare mode;
answer them by running the default report on the current session and
suggesting `/session-metrics compare-prep` if the user wants a real
benchmark.
## Pre-flight context
- skill-dir: ${CLAUDE_SKILL_DIR}
- session-id: ${CLAUDE_SESSION_ID}
## Export shortcuts
Reached when `$ARGUMENTS[0]` is `export`. Scan the **full argument string** (not just `$ARGUMENTS[0]`) to determine scope and formats. Apply these checks **in order** (first match wins):
1. Full arg string contains `all-projects` → `--all-projects --output <formats>`
2. Full arg string contains `project` (and not already caught above) → `--project-cost --output <formats>`
3. Otherwise → current session `--session ${CLAUDE_SESSION_ID} --output <formats>`
Infer format flags from the argument string: `html` → `html`, `csv` → `csv`, `md` or `markdown` → `md`. Always add `json` alongside any requested format per the post-export audit convention (see `## Optional post-export audit` below).
**Always add `--quiet` to session and project export commands.** When exporting, the per-turn detail lives in the written HTML/JSON, so the full stdout timeline is redundant — and at project scope (or for a long session) it can run to thousands of lines, spilling the run into a harness overflow file that buries the `[export]` path lines you need. `--quiet` collapses stdout to the legend + grand total + footer (plus the `[export]` lines), keeping the run inline. Do **not** add `--quiet` for `--all-projects` — its instance dashboard text is already compact and the flag has no effect there.
**Examples:**
| Full argument string | Command |
|---|---|
| `export session` | `--session ${CLAUDE_SESSION_ID} --quiet --output json` |
| `export session to html` | `--session ${CLAUDE_SESSION_ID} --quiet --output html json` |
| `export session metrics to html` | `--session ${CLAUDE_SESSION_ID} --quiet --output html json` |
| `export to html` | `--session ${CLAUDE_SESSION_ID} --quiet --output html json` |
| `export project` | `--project-cost --quiet --output json` |
| `export project to html` | `--project-cost --quiet --output html json` |
| `export project sessions` | `--project-cost --quiet --output json` |
| `export project sessions to html` | `--project-cost --quiet --output html json` |
| `export entire project's session metrics to html` | `--project-cost --quiet --output html json` |
| `export project metrics to html csv` | `--project-cost --quiet --output html csv json` |
Excerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit 279fe3d
uv run python ${CLAUDE_SKILL_DIR}/scripts/session-metrics.py --session ${CLAUDE_SESSION_ID}
uv run python ${CLAUDE_SKILL_DIR}/scripts/session-metrics.py --session <uuid>
uv run python ${CLAUDE_SKILL_DIR}/scripts/session-metrics.py --slug=-home-user-projects-myapp
uv run python ${CLAUDE_SKILL_DIR}/scripts/session-metrics.py --list
uv run python ${CLAUDE_SKILL_DIR}/scripts/session-metrics.py --project-cost
uv run python ${CLAUDE_SKILL_DIR}/scripts/session-metrics.py --quiet --output jsongit clone https://github.com/centminmod/my-claude-code-setup git -C my-claude-code-setup checkout 279fe3d84db5
Commands as the repository documents them: shown, never run by us. Our verdict covers commit 279fe3d84db5 only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| Claude Code | Mentioned in its text, not tested | Skills for Claude Code · About Claude Code |
| Codex | Mentioned in its text, not tested | Skills for Codex · About Codex |
| Cursor | Mentioned in its text, not tested | Skills for Cursor · About Cursor |
Audit history
Every audit, every source change
- ✕BLOCK D 68 / 100
first audit · source
279fe3d84db5
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/centminmod/session-metrics/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
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). Also analyze a video…
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…
centminmod/my-claude-code-setup
Consult official Claude Code documentation from code.claude.com using selective fetching. Use when working on hooks, skills, subagents, plugins, agent teams, MCP servers, permissions, settings, CI/CD (GitHub Actions,…
centminmod/my-claude-code-setup
Dual-AI code analysis pairing OpenAI Codex with Claude code-searcher — the lightest consult variant, two citation-verified perspectives. Use for a quick second opinion on a code question.
fcakyon/claude-codex-settings
Battle-tested Claude Code, OpenAI Codex, Cursor configs, plugins, hooks and agents with Kimi, MiniMax and GLM API support.
fcakyon/claude-codex-settings
Battle-tested Claude Code, OpenAI Codex, Cursor configs, plugins, hooks and agents with Kimi, MiniMax and GLM API support.
Add this badge to your README
[](https://modelsatlas.com/skills/centminmod/session-metrics/)
<a href="https://modelsatlas.com/skills/centminmod/session-metrics/"><img src="https://modelsatlas.com/skills/centminmod/session-metrics/badge.svg" alt="ModelsAtlas: BLOCK D"></a>
Questions about Session Metrics
What does the Session Metrics skill do?
Is Session Metrics safe to install?
What can Session Metrics access on my machine?
Which assistants does Session Metrics work with?
How current is this page?
Sources
- github.com/centminmod/my-claude-code-setup/tree/master/.claude/s — the audited source at commit 279fe3d84db5 and every finding aboveObserved · 8 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Session Metrics skill do?
- Is Session Metrics safe to install?
- What can Session Metrics access on my machine?