From claude-code-hermit
Audits API token spend across cache_read, cache_write, output, and input categories with per-session attribution. Useful for understanding cost drivers, expensive sessions, and cold start costs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-hermit:cost-reflectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
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.
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.
If this skill was invoked from a channel-arrived message (the inbound prompt contains a <channel source="..."> tag), reply via that channel's reply tool. Otherwise emit to conversation.
On a channel-tagged turn (Step 0 detected 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-reflect.ts .claude-code-hermit --plain
Otherwise (terminal/dev use), run the full breakdown:
bun ${CLAUDE_PLUGIN_ROOT}/scripts/cost-reflect.ts .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.
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): the script output is already plain language and jargon-free — no cache_read/cache_write/token-type labels, no session IDs, no PROP-/S-NNN, 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.
When this skill fires from a routine or proactively (i.e., not from a direct operator conversation), deliver the report through the operator's channel:
Resolve the outbound channel:
bun ${CLAUDE_PLUGIN_ROOT}/scripts/resolve-outbound-channel.ts .claude-code-hermit
Parse stdout as JSON. On success ("id" and "chat_id" present), send via mcp__plugin_<id>_<id>__reply with { chat_id, text: <report> } where <id> is the resolved channel name.
If the script exits non-zero or returns {"error":"no_reachable_channel"}: if push_notifications === true in config.json, fire PushNotification(message="cost-reflect: <first line of report>", status="proactive") so the summary still reaches the operator. Then append a single Findings line to .claude-code-hermit/sessions/SHELL.md: "cost-reflect: no reachable channel configured, channel-send skipped". Only log this once per session to avoid noise.
To set a preferred channel, add "primary": "<channel-name>" inside channels in config.json.
/claude-code-hermit:hermit-settings — a Sunday 22:00 cadence (0 22 * * 0) before weekly-review works well./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.npx claudepluginhub p/gtapps-claude-code-hermit-plugins-claude-code-hermitRoutes Claude Code token usage and cost analysis requests to sub-skills for health checks, cost audits, anomaly detection, project reviews, trends, and usage patterns. Provides quick overviews for ambiguous intents.
Tracks and reports Claude Code token usage, spending, and budgets from the local cost-tracker metrics log. Activates on cost, spending, usage, tokens, budgets queries.