← ClaudeAtlas

cost-reportlisted

Capture token cost from the active Claude Code session, append to the local sessions store, and surface the 50/75/90/100% budget alert ladder with cost-profile suggestions.
event4u-app/agent-config · ★ 7 · AI & Automation · score 84
Install: claude install-skill event4u-app/agent-config
<!-- cloud_safe: noop --> # /cost:report Records the current Claude Code session's token usage and checks it against the configured budget. Local-only: writes to `agents/cost-tracking/sessions.jsonl` (no MCP / external services). ## Steps ### 1. Capture the active session ```bash node scripts/cost/track.mjs ``` Emits a Markdown summary of the session (model breakdown, per-tier cost, total USD) and appends a JSON record to `agents/cost-tracking/sessions.jsonl`. If `track.mjs` exits 2 with `no Claude Code project dir`, the user is not in a Claude Code session — surface that and stop. ### 2. Check the budget ```bash node scripts/cost/budget.mjs check ``` Reads the runtime budget config under `agents/cost-tracking/` (set via step 4 if missing) and the JSONL store, computes utilization, and prints the alert level. ### 3. Surface the alert ladder The check output already includes the level. Translate it into a profile recommendation per the table: | Level | Utilization | Recommendation | |---|---|---| | 🟢 OK | < 50% | within budget — no action | | 🟡 INFO | ≥ 50% | log notification, no UX disruption | | 🟠 WARNING | ≥ 75% | suggest dropping the **model tier** — `model.auto_switch: auto`, or pick a lighter `model_tier` for routine work (the dominant spend lever) | | 🔴 CRITICAL | ≥ 90% | recommend a lighter model tier first; only as a last resort suggest [`/set-cost-profile minimal`](set-cost-profile.md) **with a capability-loss warning** | | 🛑 HARD_STOP | ≥ 100% | ha