Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By marmelab Verified Orgv0.5.1MITIn 1 marketplace
Where a Claude Code session's minutes, tokens and dollars went, agent by agent, as one self-contained page. Reads the transcripts Claude Code already writes, so it works on any session in any project, with or without the aiharness plugin. Ships commands only: no hook, nothing running in the background.
You run one by typing its /name in Claude Code.
1 caution to review before installing
A command runs shell commands (! syntax) when you invoke it
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Where a Claude Code session's minutes, tokens and dollars went, agent by agent, as one self-contained HTML page.
It reads the transcripts Claude Code already writes under ~/.claude/projects for every
session, so it works in any project, with or without the aiharness plugin. It ships
commands only: no hook, nothing running in the background.
/plugin marketplace add marmelab/AIHarness
/plugin install sessions-stats@aiharness
Install it at user scope to have it in every project. It is independent of aiharness:
installing one does not enable the other.
/sessions-stats:latest opens one page holding your 25 latest sessions across every
project, the last written first, with a selector to move between them:
/sessions-stats:latest # the 25 latest
/sessions-stats:latest --last 50
/sessions-stats:latest --since 3d # every session written in the last three days
/sessions-stats:latest --project atomic # projects whose transcript directory matches
A session with no model turn yet does not take a place. Projects under the tmp dir (test
fixtures, throwaway probes) are left out unless --project names them.
It reads what Claude Code still holds, so it reaches back as far as cleanupPeriodDays
(30 days by default) and no further. 25 sessions take about five seconds.
/sessions-stats:stat opens the page of the session you are in. --whole also counts, in a
harness run, your own work before the first harness agent started.
The script behind it takes several ids too: run-stats.mjs --session <id>,<id> puts those
sessions on one page, whichever projects they ran in.
Both commands run their script before the model sees anything; the model's one short turn only relays the link.
One HTML page per report, under the system tmp dir ($SESSIONS_STATS_TMP_ROOT overrides it):
around 10 MB for 25 sessions. The SQLite store the page is built from is deleted once
the page is written, and pages older than a day are swept by the next report. Nothing is
written in the project.
A shortcut does the same with no model turn. For stat it cannot know which session is
yours, so it takes the project's session that wrote last; add --recent to the command
for the latest sessions instead. In VS Code, add a user task (Tasks: Open User Tasks):
{
"label": "Session stats",
"type": "shell",
"command": "node ~/.claude/plugins/marketplaces/aiharness/plugins/sessions-stats/scripts/run-stats.mjs",
"options": { "cwd": "${workspaceFolder}" },
"presentation": { "reveal": "silent" }
}
and bind it in keybindings.json:
{
"key": "ctrl+alt+s",
"command": "workbench.action.tasks.runTask",
"args": "Session stats"
}
Claude Code deletes transcripts after cleanupPeriodDays. To keep a run past that, or to
compare two arms of the same task, /sessions-stats:report walks through the three steps:
run-archive.mjs copies the raw transcripts to <project>/.runs/archive, run-ingest.mjs
derives a SQLite store from them, run-report.mjs renders it. run-compare.mjs then puts
two tagged arms side by side.
The cost of a session that used a model the rate table does not know is priced at the
sonnet-5 rate, and says so: a no rate for tag on the page, and an unpriced: line under
the link. The figure is then a guess until the plugin is updated. The Models panel tags
that model and shows how much of the run's cost, tokens and time it accounts for.
A store derived before a model had a rate keeps that session's fallback figures until it is
ingested again. run-report.mjs says so: a tag on the page, and a stale: line naming the
sessions to re-run through run-ingest.mjs.
The page embeds the session's real data: every shell command in full, absolute file paths,
agent descriptions, the names of the instruction files that were injected. Fine for an
internal channel or a private Artifact; for anything public, render it with
run-report.mjs --redact, which keeps every figure and drops the text behind them.
It lives in the AIHarness repository and its tests run with that repo's npm test.
Claude Code installs a plugin by copying its directory, so nothing here may import from
outside plugins/sessions-stats/; a test enforces it. scripts/lib/bash-classify.mjs and
scripts/lib/pricing.mjs are verbatim copies of the harness's own, which another test
keeps identical: change both or neither.
A new Claude model needs its row in pricing.mjs as soon as it is used, then a version bump
of both plugins: an installed plugin is only replaced when its version changes. Until then
its sessions are priced at the sonnet-5 rate, and the page and both commands say
unpriced: with the model's name.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub marmelab/aiharness --plugin sessions-statsPlugins from other owners that cover similar ground