Skip to content
Back to skills

Cost Reflect

ASecurity

The 'why is my bill high' skill: audits where spend goes across token categories (cache_read, cache_write, output, input) and per-session attribution. Invoke for questions like 'cost breakdown', 'which sessions are expensive', 'what's driving spend', or 'cold start costs'. Not for week-over-week trend lines (use hermit-evolution) or simple total-spend summaries.

  • 74 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 2, 2026
ai-agentsgo

Works with

  • terminal
  • cli

Security analysis

A100/100

Scanned October 2, 2026

npx -y skills add gtapps/claude-code-hermit --skill cost-reflect --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cost Reflect?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cost Reflect
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gtapps-cost-reflect/badge)](https://www.skillsdirectory.com/skills/gtapps-cost-reflect)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cost-reflect
description: "The 'why is my bill high' skill: audits where spend goes across token categories (cache_read, cache_write, output, input) and per-session attribution. Invoke for questions like 'cost breakdown', 'which sessions are expensive', 'what's driving spend', or 'cold start costs'. Not for week-over-week trend lines (use hermit-evolution) or simple total-spend summaries."
---
# Cost Reflect

Runs a structural cost audit over the last 7 days of `cost-log.jsonl` and delivers the result to the operator. The math is done by a script — your job is to run it and deliver the output through the right channel.

## Invocation mode

- **Manual (no arguments):** reply only to the invoking terminal or channel conversation.
- **Automated (`--maintainer`, or any routine/proactive invocation):** produce the full technical
  report and send it as a maintainer-tier notice.

## Step 1 — Run the analyzer

On a channel-tagged turn without `--maintainer` (the inbound prompt contains a `<channel source="...">` tag), run
the plain-language mode instead of the full breakdown — a channel operator asking "why is my bill
high" shouldn't get raw token-category jargon:

```
bun ${CLAUDE_PLUGIN_ROOT}/scripts/cost-report.ts reflect .claude-code-hermit --plain
```

Otherwise (terminal/dev use or `--maintainer`), run the full breakdown:

```
bun ${CLAUDE_PLUGIN_ROOT}/scripts/cost-report.ts reflect .claude-code-hermit
```

Capture stdout. If the output starts with "No cost data" or "No spend recorded yet", report that message and stop — there's nothing to send.

## Step 2 — Relay the report

**Terminal:** the script output is already formatted and capped at 1500 characters. Relay it verbatim. Don't summarize, reformat, or add commentary — the output is the report.

**Channel (`--plain` output):** reply through that channel's reply tool. The script output is already plain language and jargon-free; no `cache_read`/`cache_write`/token-type labels, no session IDs, no `PROP-`/`T-...`, no slash commands. Relay it **translated into the operator's language** if the inbound message wasn't in English. Translation only; add no commentary and don't reintroduce token-category detail.

## Step 3 — Channel delivery

When `$ARGUMENTS` contains `--maintainer` (or the invocation is a routine/proactive prompt rather than
a direct operator conversation), deliver the report through the operator's channel. Spend detail is
maintainer-tier by definition, so send it as the `maintainer` leg only (no `client` leg):

```
bun ${CLAUDE_PLUGIN_ROOT}/scripts/channel-send.ts .claude-code-hermit --notice
```
with `{"maintainer": "<report>"}` on stdin. On a technical install with no maintainer chat configured, `sendOperatorNotice`'s default `fallback: "client"` puts it in the primary chat. On a `non-technical` install with no maintainer chat, the report goes to `state/watchdog-events.jsonl` and no chat sees it (fail-closed on spend disclosure). If nothing was delivered, follow § Operator Notification's fallback (push if enabled, log to Findings).

To set a preferred channel, add `"primary": "<channel-name>"` inside `channels` in `config.json`.

## Notes

- **Scheduling:** this skill doesn't self-register a routine. To run it on a schedule, add
  `claude-code-hermit:cost-reflect --maintainer` as a routine via `/claude-code-hermit:hermit-settings`.
- **What it measures:** token-type cost composition (cache_read / cache_write / output / input), per-model breakdown (shown when ≥2 models appear, e.g. Opus main + Sonnet heartbeat), cold-start turns (context warm-ups with no prior cache hit), and per-session cost attribution. For week-over-week totals, use `/claude-code-hermit:hermit-evolution` instead.
- **`--plain` mode** (channel-tagged turns only): today's spend vs. a trailing-7-day typical day, drivers named by work (not token type), spend-cap status, and a one-line notional-dollars caveat. No token categories, session IDs, or internal IDs.
- **Non-technical installs** (`config.operator_profile === 'non-technical'`): a client-chat spend question never reaches this skill, since `channel-responder` deflects it with a plain "handled by your provider" reply. Spend figures stay maintainer-side (terminal, maintainer chat, weekly review), so a channel-tagged run here is expected only from a maintainer-audience surface.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.