Stop surprise AI bills. Track, budget, and optimize your agent spending.
๐ฅ GitHub Copilot just moved to usage-based billing (HN 545pts, Apr 2026). Cost awareness is no longer optional โ it's survival.
You're spending money. You don't know how much.
- "How much did today's 6-hour coding session cost?"
- "Why is my Claude bill $200 this month?"
- "I'd use cheaper models for simple tasks but always forget"
- "My team blew through the AI budget in week one"
GitHub Copilot โ usage billing. free-claude-code 16Kโ (+2,949/day). mattpocock/skills 30Kโ (+5,645/day). The signal is clear: cost control is the #1 AI agent pain point in 2026.
Agent Cost Guard gives you visibility and control:
๐ฐ This Session: $3.47
โโ Claude Opus 4: $2.81 (81%)
โโ Claude Sonnet 4: $0.66 (19%)
๐ Today: $7.23 / $10 daily budget
โ ๏ธ Alert: 72% of budget used
๐ก Tip: 12 simple edits could use Haiku โ Save $4.20
# Install
git clone https://github.com/aptratcn/agent-cost-guard.git ~/.agent-skills/
# Check status
cost-status
# Set daily budget ($10)
cost-budget --daily 10
# See history
cost-history --7d
# Get recommendations
cost-optimize| Feature | What it Does | Why It Matters |
|---|---|---|
| Real-time tracking | Estimates cost per task | Know before the bill |
| Budget alerts | Warn at 70%, stop at 100% | Never overspend again |
| Model recommendations | "Use Haiku for this" | Save 60-80% on simple tasks |
| Cost reports | By project, task, time | Track where money goes |
$ cost-status
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ฐ Agent Cost Guard โ Session Summary โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Session Time: 2h 34m โ
โ Tasks Completed: 23 โ
โ โ
โ ๐ต Cost Breakdown: โ
โ โโ Complex Debug (Opus 4): $4.12 (60%) โ
โ โโ Code Review (Sonnet): $1.87 (27%) โ
โ โโ Quick Edits (Sonnet): $0.89 (13%) โ
โ Total: $6.88 โ
โ โ
โ ๐ Budget Status: โ
โ Daily: $6.88 / $10.00 (69%) โ ๏ธ โ
โ Monthly: $143.21 / $200.00 (72%) โ
โ โ
โ ๐ก This Session Insights: โ
โ โข 8 quick edits could use Haiku (-$2.10) โ
โ โข Batch 3 similar queries (-$0.80) โ
โ Potential savings: $2.90 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโๆๆซ็่ดฆๅ๏ผ$347
ไฝ ๏ผ"๏ผ๏ผ๏ผๆไน่ฑไบ่ฟไนๅค๏ผ"
Agents: ๐คทโโ๏ธ
ๆฏๅคฉ๏ผ้ข็ฎ $10๏ผๅทฒ็จ $7.23๏ผๆถๅฐๆ้
ๅจๆฅ๏ผๆฌๅจ $48๏ผๅปบ่ฎฎ็ $12๏ผ็จ Haiku ๆฟไปฃ็ฎๅไปปๅก๏ผ
ไฝ ๏ผๅฟไธญๆๆฐ๏ผไธปๅจไผๅ
| Model | Prompt ($/1M) | Completion ($/1M) | Best For |
|---|---|---|---|
| Claude Opus 4 | $15 | $75 | Complex debug, architecture |
| Claude Sonnet 4 | $3 | $15 | Most coding tasks |
| Claude Haiku 3.5 | $0.80 | $4 | Simple edits, comments |
| GPT-4o | $2.50 | $10 | General tasks |
| GPT-4o-mini | $0.15 | $0.60 | Quick queries |
Rule of thumb: Haiku for tasks you'd trust a junior dev, Opus for problems that need a principal engineer.
| Solution | Problem |
|---|---|
| Check billing dashboard | After the fact, no prevention |
| Set API limits | Hard cutoffs, no visibility |
| Use cheaper models manually | Easy to forget |
| Agent Cost Guard | Prevention + visibility + recommendations |
.cost-guard.json:
{
"dailyBudget": 10,
"monthlyBudget": 200,
"warnThreshold": 70,
"stopThreshold": 100,
"defaultModel": "claude-sonnet-4",
"cheapModel": "claude-haiku-3.5",
"premiumModel": "claude-opus-4"
}Typical developer using AI agents 4 hours/day:
- Without optimization: ~$200/month
- With Cost Guard recommendations: ~$120/month
- Savings: $80/month = $960/year
Team scenario (10 devs): $9,600/year saved
# Option 1: Clone to skills directory
git clone https://github.com/aptratcn/agent-cost-guard.git ~/.agent-skills/
# Option 2: npx install (if using skills registry)
npx skills@latest add aptratcn/agent-cost-guard
# Option 3: Add to AGENTS.md
echo "- agent-cost-guard: ~/.agent-skills/agent-cost-guard" >> AGENTS.md- context-mode โ Context window optimization
- claude-mem โ Session memory
- free-claude-code โ Free Claude Code access
MIT
Stop guessing. Start tracking. ๐