ai-spend-tripwirelisted
Install: claude install-skill Xipher-Labs/walter-os
# AI Spend Tripwire
Cost guardrail for the agentic stack. Reads usage data from each provider,
projects spend, alerts on anomalies, and can hard-stop runaway loops.
## What it tracks
**Anthropic (Claude API + Claude Code):**
- `ANTHROPIC_ADMIN_API_KEY` → `/v1/organizations/usage_report/messages` and
cost endpoint, polled hourly.
- Claude Code local logs at `~/.claude/projects/*/conversations/*.jsonl`
parsed via `ccusage` (or its equivalent) for per-session cost breakdown.
**OpenAI (Codex CLI + direct):**
- Codex JSONL logs at `~/.codex/sessions/*.jsonl` parsed by `ccusage`
(which supports both Claude Code and Codex).
- `OPENAI_API_KEY` doesn't have a great cost API; rely on session logs +
monthly dashboard scrape.
**Google (Gemini for nanobanana, etc.):**
- Session files at `~/.gemini/tmp/*/chats/session-YYYY-MM-DD.json`
- Free tier: 1,000 req/day. Paid: tracked via Google AI Studio dashboard
(no public usage API as of May 2026).
**OpenRouter (if used as a gateway):**
- Native usage endpoint, polled hourly.
## Output and alerts
The skill maintains a status JSON at `~/.config/walter-os/spend-status.json`:
```json
{
"updated_at": "2026-05-03T12:00:00Z",
"today_usd": 4.32,
"this_month_usd": 71.50,
"projected_month_usd": 220.00,
"monthly_budget_usd": 250.00,
"burn_rate_per_hour": 0.18,
"by_provider": {
"anthropic": 52.00,
"openai": 14.00,
"google": 5.50
},
"alerts": []
}
```
Alert tiers:
- **Notice** — daily spend > 1.5x trailing