Problem
Zero instrumentation on Anthropic API spend. No cost per job in YAML, no daily total on dashboard, no threshold alert. A single autoresearch job could cost $5 or $50 — currently no way to know.
Fix
Claude Code prints a cost summary at the end of each session:
- In worker.py, after job completion, grep the tmux pane output for the cost pattern:
import re
cost_match = re.search(r'Total cost: \$([0-9.]+)', pane_output)
if cost_match:
yq -i f'.cost_usd = {cost_match.group(1)}' job_yaml
- Add
cost_usd field to job YAML schema
- Aggregate daily/weekly totals in morning report
- Dashboard shows per-job cost and running total
- Alert (ntfy) if daily spend > threshold (configurable, start with $10)
Acceptance Criteria
Context
From Jensen limitation audit (2026-03-22). Workstream: WS-001.
Problem
Zero instrumentation on Anthropic API spend. No cost per job in YAML, no daily total on dashboard, no threshold alert. A single autoresearch job could cost $5 or $50 — currently no way to know.
Fix
Claude Code prints a cost summary at the end of each session:
cost_usdfield to job YAML schemaAcceptance Criteria
cost_usdfield in every completed job YAMLContext
From Jensen limitation audit (2026-03-22). Workstream: WS-001.