← back to AbramsEgo
build-queue/done/04-model-usage-subagents.md
16 lines
# AbramsEgo task 04 — model-usage + sub-agent-runs panel
Read SPEC.md first. Add the command-center "Sessions & sub-agent runs" surface (panel 5).
1. `server.js`: add an authed `GET /api/usage` collector that reads `~/.claude/cost-ledger.jsonl`
and returns model-usage breakdown (calls + tokens + $ per model, last 24h and all-time) and,
from `~/.claude/projects/**/*.jsonl` mtimes, a count of active/recent Claude sessions and recent
sub-agent runs (last 20, newest first). Fold a compact form into the main snapshot too.
2. `public/index.html`: render a "Model Usage" mini-bar-chart (per-model share) and a "Recent
sub-agent runs" list. Each run row is an admin card → MUST show created date+time
(`🕓 …`, toLocaleString, full ISO in title=) per Steve's hard rule.
3. Verify: `pm2 restart abramsego`, curl `/api/usage` returns non-empty, page renders the panel.
Commit `feat: model-usage + sub-agent-runs panel`.
Local only. No deploy/keys/publish.