agentleFS
tiago-oliveira-catiago-oliveira-ca/zenodotus-harness/skills/zeno-stack/zeno-cost-report/SKILL.md

zeno-cost-report

Skill1 starsChanged 8 days agoMITView on GitHub

Summarize local agent-harness spend by day, model, and session from the Stop-hook cost-tracking metrics log — a report over what the tracker already wrote, never a metering system itself. Trigger on: "cost report", "how much have I spent", "spend by model", "token cost this week", "export cost data".

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the metrics log exists.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Cost Report

Summarize local spend by day, model, and session from the metrics log the harness's own Stop hook writes. This is a report, not a metering system: it reads what the tracker wrote, it doesn't write that file itself.

Where the data lives

The cost-tracking Stop hook appends one JSON object per session-stop to a local metrics log. Each row is a cumulative snapshot for that session, so the report takes the latest row per session id and sums across sessions — summing every row would multiply-count.

Row schema: { timestamp, session_id, transcript_path, model, input_tokens, output_tokens, cache_write_tokens, cache_read_tokens, estimated_cost_usd }

What this does

  1. Check the metrics log exists. If not, the tracker hasn't run yet — it only writes on a session's first Stop event, so a brand-new install has no data until then.
  2. Reduce rows to the latest snapshot per session and aggregate.
  3. Present a compact report (today / yesterday / total / by-model / last-7-days), or export recent rows as CSV on request.

Rely on the tracker's precomputed estimated_cost_usd values; don't re-estimate pricing from raw tokens in the report itself — that's the tracker's job, not the report's.

Report shape

  1. Summary: today, yesterday, total, session count.
  2. By model: models ranked by total cost.
  3. Last seven days: date and cost.

Anti-pattern quick reference

Anti-patternInstead
Summing every row in the logTake the latest row per session id first — rows are cumulative snapshots
Re-deriving cost from raw token countsUse the tracker's own estimated_cost_usd — it's the source of truth
Erroring when the log doesn't exist yetReport plainly that the tracker hasn't fired a Stop event yet
Treating this as the metering systemIt's read-only over what the tracker already wrote

Pre-flight checklist — run before delivering any cost report

  • Rows reduced to latest-per-session before aggregating, not summed raw.
  • Missing/empty log handled with a plain explanation, not an error.
  • Cost figures come from the tracker's own estimated_cost_usd, not re-derived here.
  • Report includes today/yesterday/total, by-model, and last-7-days sections.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.