# Cost Tracker

> Real-time cost tracking across all agent sessions with budget alerts

- Skill: `kevinzai/cost-tracker` (Agent Skill)
- Install (CLI): `npx skillmds@latest add kevinzai/cost-tracker`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kevinzai/cost-tracker/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: KevinZai (https://skillmd.com/u/kevinzai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kevinzai/cost-tracker

---


# /cost — Cost Tracker

Agent HQ API at localhost:3005. Shows spending across all Claude sessions.

## When activated:

Run: `curl -s http://localhost:3005/api/costs`

Parse the JSON and display:
```
Cost Dashboard
═══════════════════════════════
Today:     $[today]     ([todayTokens] tokens)
Yesterday: $[yesterday] ([yesterdayTokens] tokens)
Total:     $[total]     ([totalTokens] tokens)

By Agent:
  [agent1]  $[cost]  [██████████░░░░░░]  [messages] msgs
  [agent2]  $[cost]  [████░░░░░░░░░░░░]  [messages] msgs
  ...
```

Then present via AskUserQuestion:

| Option | What it does |
|--------|-------------|
| View daily breakdown (Recommended) | Show cost per day for last 7 days |
| View by agent | Show cost per agent with message counts |
| View by model | Group costs by model (opus/sonnet/haiku/flash) |
| Set budget alert | Ask threshold, save to state |
| Something else | Free text |

### Budget Alert

If daily cost > $5, show warning:
```
⚠️  Daily spend: $[amount] (threshold: $5.00)
```

### After every action, suggest next steps via AskUserQuestion.

