- • Two ingest paths: unix socket for Claude hooks, file tail for JSONL logs
- • Unified
Event at internal/event — Pre/Post paired by tool_use_id
- • Cost estimated per-model via
pricing.go (Claude + Codex rate tables)
- •
INSERT OR IGNORE + source_id unique index makes watcher restarts idempotent
- •
sessions — platform, tokens, cost, status
- •
agents — parent_agent_id tracks subagent hierarchy
- •
tool_calls — params, result, duration, outcome
- •
token_usage — per-model token & cost rows
- •
file_changes — path + change type per session
- • TUI — bubbletea 4 tabs, 2s poll + live broadcast; keys:
j k Enter / [ ]
- • Web — HTTP server reads SQLite, serves embedded SPA with daily cost reports
- • Both receive the daemon's live event stream — TUI updates instantly, web refreshes via fetch
- •
tokenmeter web auto-spawns daemon + watchers on start (no manual daemon needed)