A band above the prompt showing the last turn's and the session's list-price cost estimate.

Small Claude Code mods and skills from the [MateAI]
| Plugin | What it does | Install |
|---|---|---|
cost-band | Band above the prompt showing the last turn's and the session's list-price cost estimate. | claude plugin install cost-band@mateai-mods |
delegate | Plan a coding task on Opus, hand the implementation to Sonnet subagents, then review and verify their work. | claude plugin install delegate@mateai-mods |
Add the marketplace once, then install whichever plugins you want. Each one installs independently:
claude plugin marketplace add mategog/mateai-mods
A band above the prompt that shows what the last turn and the whole session would cost at API list prices:
Last turn $0.042 · Session $0.318 · list-price estimate, not a bill
The mod reads the session cost Claude Code already computes (the same number as "Total cost" in /usage). It contains no price table, so there are no hard-coded rates to go stale.
Check your version with claude --version (terminal) or /status (Desktop, local session).
From a terminal:
claude plugin marketplace add mategog/mateai-mods
claude plugin install cost-band@mateai-mods
Or inside a Claude Code session:
/plugin marketplace add mategog/mateai-mods
/plugin install cost-band@mateai-mods
Then restart the session. The band appears above the prompt after the first completed turn.
claude plugin marketplace update mateai-mods
claude plugin disable cost-band@mateai-mods
claude plugin marketplace remove mateai-mods
Mods are not sandboxed. A mod runs inside Claude Code with your permissions, so it could read your files and environment variables, start programs and use the network. Only install mods from people you trust, and read the code first. This one is short:
| File | What it does |
|---|---|
plugins/cost-band/hooks/register.tsx | On turn.complete it reads session.usage(); on ui.render it draws the band. |
plugins/cost-band/hooks/cost.ts | Pure functions: last-turn math and $ formatting. |
plugins/cost-band/hooks/hooks.json | Registers the module. |
It makes no network calls and starts no processes. You can also check what any mod registers without running it:
claude plugin validate plugins/cost-band
Cost estimate unavailable in this session./clear the session total starts over, and so does the last-turn figure..claude-plugin/marketplace.json marketplace "mateai-mods"
plugins/cost-band/ the plugin
.claude-plugin/plugin.json
hooks/{hooks.json,register.tsx,cost.ts}
hooks/*.test.ts unit tests for the cost math and registration
types/index.d.ts
A skill, not a mod: it runs no code of its own. You run it in an Opus session. Opus researches and plans the task, then hands the implementation to Sonnet subagents and reviews what they wrote. Experimental (v0.3.0).
The goal is lower cost by moving implementation to cheaper models. In our benchmark it never beat plain Opus: when it delegated, it cost 1.7–2.5× as much and saved no time; when it chose not to delegate, it matched plain Opus. See Benchmark.
/delegate:delegate add pagination to the orders API and cover it with tests
It is only ever run by you typing the command; Claude will not start it on its own.
implementer agent with only Read, Write, Edit, Bash and Skill, which makes each one cheaper to start. They can't commit, push or deploy, they only run narrow checks on their own files, and they report "blocked" instead of redesigning.code-review for risky changes. Max 2 correction rounds per task, then Opus takes over.Five tasks on a small Node project (bench/delegate/fixture, about 150 lines), each started from the same commit with the same prompt. Correctness is graded by hidden tests the agent never sees. Run on 2026-10-14 with Claude Code 2.1.238 (opus = claude-opus-5, sonnet = claude-sonnet-5), one run per cell unless noted. Cost is Claude Code's list-price estimate (total_cost_usd), not a bill.
Two versions of the delegation rule are compared:
Round 1: small and medium tasks (plain Opus vs v0.2.0)
| Task | Run | Delegated? | Hidden tests | Cost | Wall time | Output tokens | Total tokens |
|---|---|---|---|---|---|---|---|
| T1 small: fix quoted fields in one CSV function | Opus | – | 5/5 | $0.92 | 86 s | 6.7k | 424k |
| v0.2.0 | no | 5/5 | $0.97 | 80 s | 5.9k | 506k | |
| T2 medium: validation in 3 modules + shared error class | Opus | – | 3/3 | $0.84 | 97 s | 6.6k | 598k |
| v0.2.0 | yes, 3 Sonnet subagents | 3/3 | $2.07 (Opus $1.17 + Sonnet $0.89) | 166 s | 18.5k | 2,039k | |
T3 mechanical: rename qty → quantity across 7 files | Opus | – | 4/4 | $0.96 | 159 s | 7.9k | 719k |
| v0.2.0 | no | 4/4 | $0.92 | 95 s | 7.7k | 589k |
Round 2: larger tasks (plain Opus vs v0.2.0 vs v0.3.0)
| Task | Run | Delegated? | Hidden tests | Cost | Wall time | Output tokens | Total tokens |
|---|---|---|---|---|---|---|---|
| T4 six new feature modules with tests (12 new files, ~400 lines) | Opus | – | 6/6 | $1.16 | 164 s | 17.2k | 478k |
| v0.2.0 | yes, 3 Sonnet subagents | 6/6 | $2.23 (Opus $1.32 + Sonnet $0.92) | 162 s | 24.1k | 1,911k | |
| v0.3.0 | no, below the size bar | 6/6 | $1.11 | 155 s | 15.0k | 460k | |
T5 migrate every amount to a Money type (coupled, 8 files) | Opus | – | 2/2 | $0.94 | 106 s | 9.4k | 570k |
| v0.2.0 | no, too coupled | 2/2 | $0.99 | 113 s | 9.7k | 605k | |
| v0.3.0 | no | 2/2 | $0.96 | 120 s | 10.0k | 488k |
Round 3: self-contained briefs (experimental variants that keep v0.2.0's rule, so they still delegate; patches against v0.2.0 in bench/delegate/variants/)
implementer subagent that only has Read, Write, Edit, Bash and Skill.| Task | Run | Delegated? | Hidden tests | Cost | Wall time | Subagent tool calls | Total tokens |
|---|---|---|---|---|---|---|---|
| T4 six new feature modules | Opus, 2nd run | – | 6/6 | $1.02 | 130 s | – | 463k |
| v0.2.0, 2nd run | yes, 3 Sonnet subagents | 6/6 | $2.43 (Opus $1.50 + Sonnet $0.93) | 212 s | 33 | 2,028k | |
| v0.4a | yes, 3 Sonnet subagents | 6/6 | $2.14 (Opus $1.28 + Sonnet $0.86) | 155 s | 20 | 1,741k | |
| v0.4b | yes, 3 lean subagents | 6/6 | $1.88 (Opus $1.35 + Sonnet $0.53) | 151 s | 19 | 1,315k | |
| T2 validation in 3 modules | v0.4a | no | 3/3 | $0.84 | 89 s | – | 476k |
| v0.4b | no | 3/3 | $0.81 | 90 s | – | 412k |
Total tokens include cache reads and writes, which are most of the volume.
What it shows
Limits: mostly one run per cell, a small project, and tasks of at most ~450 changed lines. Delegation might pay off on much larger work (thousands of lines of mostly new code); that is not tested.
To reproduce (each run is capped at $12 list price):
bench/delegate/run.sh t4 baseline
bench/delegate/run.sh t4 delegate
To test another version of the plugin, point DELEGATE_PLUGIN at its plugins/delegate folder and give the run a label, e.g. DELEGATE_PLUGIN=/path/to/plugins/delegate bench/delegate/run.sh t4 v020. For the Round 3 variants, apply a patch from bench/delegate/variants/ (with git apply) to a copy of the v0.2.0 plugin and point DELEGATE_PLUGIN at that copy. Results land in bench/delegate/results/. The tasks are in bench/delegate/tasks/ and the grading tests in bench/delegate/hidden/.
karpathy-guidelines skill it relies on is bundled in this plugin. It also uses the code-review skill for risky changes when you have it; without it, Opus reviews the diff itself.It installs independently of cost-band:
claude plugin marketplace add mategog/mateai-mods
claude plugin install delegate@mateai-mods
Or inside a Claude Code session:
/plugin marketplace add mategog/mateai-mods
/plugin install delegate@mateai-mods
claude plugin marketplace update mateai-mods
claude plugin disable delegate@mateai-mods
The plugin is three plain-text files: the delegate skill, the bundled karpathy-guidelines skill (a short, independent write-up of four coding rules, not affiliated with Andrej Karpathy), and the implementer subagent definition. They are plain instructions for Claude, but it makes Claude spawn subagents that edit files and run commands with your permissions. Read it, and try it first on a branch or a throwaway repo.
plugins/delegate/ the plugin
.claude-plugin/plugin.json
agents/implementer.md
skills/delegate/SKILL.md
skills/karpathy-guidelines/SKILL.md
bench/delegate/ benchmark: fixture, tasks, hidden tests, runner, results
MIT. See LICENSE.
hooks/register.tsx 36 lines1import { atom, read, update } from 'claude-code'
2import type { Register } from 'claude-code'
3
4import { formatUsd, nextCost, START } from './cost'
5
6const cost = atom({ plugin: 'cost-band', key: 'cost' } as const, START)
7
8export const register: Register = on => {
9 on('turn.complete', async ($, e, next) => {
10 const usage = await $.session.usage()
11 await update($, cost, prev => nextCost(prev, usage.cost?.usd))
12
13 return next(e)
14 })
15
16 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
17 const { turns, total, last } = await read($, cost)
18
19 if (e.props.hasSurvey || turns === 0) {
20 return next(e)
21 }
22
23 const { Box, Text } = $.ui.resolve(e)
24
25 return (
26 <Box>
27 <Text dimColor>
28 {total === null || last === null
29 ? 'Cost estimate unavailable in this session'
30 : `Last turn ${formatUsd(last)} · Session ${formatUsd(total)} · list-price estimate, not a bill`}
31 </Text>
32 </Box>
33 )
34 })
35}
36hooks/cost.ts 17 lines1import type { Cost } from '../types'
2
3export const START: Cost = { turns: 0, total: null, last: null }
4
5// `usd` is the session's running total; a total below the previous one means /clear started over.
6export function nextCost(prev: Cost, usd: number | undefined): Cost {
7 if (usd === undefined) return { turns: prev.turns + 1, total: null, last: null }
8
9 const before = prev.total === null || usd < prev.total ? 0 : prev.total
10
11 return { turns: prev.turns + 1, total: usd, last: usd - before }
12}
13
14export function formatUsd(n: number): string {
15 return '$' + n.toFixed(n < 1 ? 3 : 2)
16}
17types/index.d.ts 8 lines1export type Cost = { turns: number; total: number | null; last: number | null }
2
3declare module 'claude-code' {
4 interface PluginState {
5 'cost-band': { cost: Cost }
6 }
7}
8