{"success":true,"name":"brimind-director-token-roi","description":"Put a cost on every result — tokens spent per agent, per session and per outcome (ack, reply, fix, dossier) from the CLI's own transcripts — and act when a seat burns tokens without moving a number (switch model, shrink its brief, turn a repeated task into a rail). Use at every closing meeting, when an agent's session grows huge, when the Claude quota runs low, and before giving a seat more work o","category":"unitary","path":"unitary/brimind-director-token-roi/SKILL.md","file":"SKILL.md","content":"---\nname: brimind-director-token-roi\ndescription: Put a cost on every result — tokens spent per agent, per session and per outcome (ack, reply, fix, dossier) from the CLI's own transcripts — and act when a seat burns tokens without moving a number (switch model, shrink its brief, turn a repeated task into a rail). Use at every closing meeting, when an agent's session grows huge, when the Claude quota runs low, and before giving a seat more work or a bigger model.\n---\n> Imported from [PRIVATE_HOST] `~/unitary/agents/s3a/skills/brimind-director-token-roi`. Paths are relative to `[PRIVATE_HOST]:[PATH]`; run commands there via `ssh [PRIVATE_HOST] 'cd ~/unitary && ...'`. Owner send rules from skill i7-remote-ops still apply.\n\n\n# Token ROI: what did each result cost?\n\nAudit both consumption and outcomes: high token use is not inherently waste, and subscription usage is not automatically an extra cash charge. When the user expands the scope from one seat to the whole team, rank all detected seats and investigate the named agents specifically; do not silently limit the audit to the original seat. Explain findings in a plain-language colored table with one row per requested agent: recorded usage and period, concrete benefit, specific observed waste or blocked work, and a qualified verdict. Keep unregistered and heuristic `agent?` sessions separate until their identity and overlap are established. Distinguish the internal S3A team seat from member-facing S3A instances; evidence for one is not evidence for the other.\n\n## Decide whether the work was necessary before calling it waste\n\n1. Read the agent's latest owner orders, role, deadlines and expected outcomes; then inspect dated task artifacts and the actual transcript/tool activity for the same period. Distinguish explicitly required reporting from obsolete, duplicate, excessively frequent or blocked checks. A stats or follower page visit alone does not prove waste.\n2. Match each suspect task or trigger to the actual session/turn and its usage records. Count only attributable turns, deduplicate streamed message IDs, keep fresh input, cached input and output separate, and report the period, task and account. If a turn mixes necessary and unnecessary work, report a bounded or unknown task cost rather than attributing the entire session to waste.\n3. In the colored table, give each requested agent or activity its concrete result, evidence of benefit, specific avoidable work and attributable token amount; mark unmeasured amounts unknown. Do not convert flat-rate plan usage into an extra cash loss or imply high usage alone means low value.\n\n## Read the spend (ground truth: the transcripts)\n\n```bash\nnode telegram/worker/sessions.mjs usage --day <YYYY-MM-DD>                 # all seats, per session\nnode telegram/worker/sessions.mjs usage --days 7 --agent <id> --top 10     # one seat, the week\nnode telegram/worker/sessions.mjs live                                     # context size of every open session\n```\nThe dashboard's Tokens tab (`GET :3999/api/tokens?days=14`) reads the same files. Its cost figure is indicative, at public API rates. Check ledger provider and CLI coverage against the transcript roots; the Unitary monthly ledger can omit Claude and different data sources may overlap. Inspect `telegram/worker/usage.js` to establish field semantics before interpreting its total: it sums fresh input, cache creation, cache reads and output across calls, so repeated cached context is not unique text or a cash charge. Parse each metric separately, deduplicate streamed message IDs, and specify the period, model and input/cache/output field used for any ranking. When a transcript appears in multiple session-day rows, read it once or bucket each turn by its date; rereading the entire transcript for every row double-counts usage outside the requested day. A recorded zero cost is not proof of free usage.\n\nFor task rankings, join projected IDs and titles in Mongo `sessions` and `subsessions` to CLI transcripts and `agent-service/data/sessions`. Filter actual call timestamps for a rolling window. Never add a Claude transcript to its service summary, or a Codex service turn to its ledger duplicate. Hermes ledger records lack task IDs: reconcile model, time and token fields against read-only `~/.hermes/state.db`; for resumed sessions require a unique exact reconciliation of per-run deltas with cumulative usage. Keep estimates and unmatched usage separate. Use order IDs or actual message subjects rather than generic charter titles to group tasks.\n\n## Divide by what it produced\n\n| Seat | Unit of result | Source |\n|---|---|---|\n| SoloBro, Farah | provider ack · human reply | `stats.mjs --since` |\n| Omar, Nour | prospect **queued** · dossier with sized gap | `queues.mjs`, `market-gaps/` |\n| Dali | tool fixed and then used successfully | blocker tag closed with evidence |\n| Artisto | post published + engagement | `social/data/posted.jsonl` |\n| Director | decisions filed with a number | `register.mjs`, notes |\n\nInspect dated agent notes, task artifacts, test results and, when available, provider/payment records for both benefits and repeated or failed work. Distinguish an agent-authored report from independently verified evidence, a provider acknowledgement from delivery or a sale, a lead from contact, and a price-risk finding from a fix. Resolve agent IDs and shared artifacts before attributing outcomes to multiple seats. Calculate `tokens ÷ results` only when the usage and unique, verified outcomes cover the same period and scope; otherwise mark it unknown. Compare like-for-like metrics with the team median or prior period only when available.\n\n## Trace triggers and explain uncertainty\n\nTrace timers, mail, idle wakes, retries and resumed sessions to actual model calls; count skipped checks separately. Repeated quota refusals prove wasted attempts or delay, not token consumption. Inspect the reserve guard's transcript roots and effective runtime override for each login: a default path alone does not prove the live account is unmonitored. Distinguish five-hour from weekly limits, historical snapshots from current usage, and subscription quota exhaustion from a cash loss. Rank behaviors by token waste only when usage is attributed to the trigger; otherwise rank measured agent usage by its exact field and label trigger impact unknown.\n\n## Act on it\n\n| Pattern | Likely mechanism | Action |\n|---|---|---|\n| Large measured context during small turns | A resumed session may repeatedly supply unnecessary history | Verify actual context and compaction first; rotate only when a compact handover preserves active work. A multi-call token total alone is not context-window size |\n| Same 3+ commands every pass | A missing rail | `brimind-repeat-becomes-rail` → Dali builds it |\n| Opus spent on short relances | Wrong model for the seat | Propose a model change (registry.json **and** `.claude/agents/<id>.md`, both). The owner decides |\n| High spend, 0 results, rungs 1–5 fine | Wrong brief or target | Rewrite the order (`brimind-director-order-brief`) |\n| Spend with the Claude CLI blocked | Fell to fallback engines | Check the Team tab engine chain. Blocker tag |\n\nNever move a Claude model onto OpenRouter or OpenCode to save tokens. The law is\nClaude through the CLI only, with the $2/M cap on every other model.\n\n## In the minutes\n\n`Tokens | SoloBro 2.5M → 9 acks (278k/ack, median 190k) 🟡 · Dali 1.1M → 2 tags closed 🟢 · Omar 800k → 0 queued 🔴`\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}