{#- Token use (dash/tokens.py, docs/token-dashboard.md). -#} {% macro summary(f, steps) -%}
{{ f.context_tokens|tok }} context read ({{ f.cache_hit|pct }} from the cache) {{ f.output_tokens|tok }} output ({{ f.thinking_share|pct }} thinking) {{ f.cost_usd|money or "-" }} {% if f.quota_week is not none %}{{ f.quota_week|pct }} of the weekly quota{% endif %} {{ f.failed_share|pct }} on failed attempts {% if f.cache_breaks %}{{ f.cache_breaks }} cache break{{ "s" if f.cache_breaks > 1 }}{% endif %} {{ steps }} step{{ "s" if steps != 1 }}
{%- endmacro %} {#- The subscription quota as of the newest step (tokens.quota). -#} {% macro quota(q) -%} {%- if q %}
{% for w in q %}{{ w.label }} quota {{ w.used|pct }} used {% if w.reset %}(reset {{ w.resets }}; no step has run since){% else %}(resets {{ w.resets }}, in {{ w.left }}){% endif %} {% endfor %}as of the step that ended {{ q[0].at[:16]|replace("T", " ") }} UTC
{%- endif %} {%- endmacro %} {% macro chart(c, title, legend=True) -%} {%- if c %} {% if c.left %}{{ c.max|money if c.unit == "usd" else c.max|tok }} {% endif %} {% for b in c.bars %} {% if b.link %}{% endif %}{{ b.title }} {% for s in b.segs %}{% endfor %} {% if b.failed %}{% endif %} {% if b.label %}{{ b.label }}{% endif %} {% if b.link %}{% endif %} {% endfor %} {%- if legend %}
{{ title }}: {% for cls, name in c.legend %}{{ name }}{% endfor %}
{% endif %} {%- endif %} {%- endmacro %} {#- Runner and the sessions people drove, side by side (tokens.spend_split, docs/session-cost-plan.md S4). -#} {% macro spend(sp) -%} {%- set w, a = sp.window, sp.all %}

Spend: runner and your sessions

Last {{ sp.days }} daysAll time
Runner{{ w.runner|money or "$0" }}{{ a.runner|money or "$0" }}
Your sessions est. {{ w.sessions.usd|money or "$0" }}{% if w.sessions.unpriced %}*{% endif %} {{ a.sessions.usd|money or "$0" }}{% if a.sessions.unpriced %}*{% endif %}
Total{{ w.total|money or "$0" }}{{ a.total|money or "$0" }}
{% if w.chart %}{{ chart(w.chart, "Spend per day") }}{% endif %}

Your sessions: Claude Code and Codex in the editors and terminals the board ties to a task ({{ a.sessions.sessions }} session{{ "s" if a.sessions.sessions != 1 }}, {{ a.sessions.tokens|tok }} tokens). The runner's cost is what the harness reported; sessions are priced from their tokens.

{%- endmacro %} {% macro sessions(rows, link=None) -%}
{% for r in rows %} {% endfor %}
HarnessSessionTaskModelTokensEst. costLast active
{{ r.harness }}{% if r.client %} ({{ r.client }}){% endif %} {{ r.short }} {% if link and r.wpid %}{{ r.task }}{% else %}not determined{% endif %} {{ r.models }}{{ r.tokens|tok }} {{ r.usd|money or ("-" if r.unpriced else "$0") }}{% if r.unpriced and r.usd %}*{% endif %} {{ r.last|epoch }}
{%- endmacro %} {% macro table(rows, first, link=None, sess=None) -%}
{% if sess is not none %}{% endif %} {% for r in rows %} {% if sess is not none %}{% set su = sess.get(r.wpid, 0) %}{% endif %} {% endfor %}
{{ first }}StepsCostSessionsTotalWeek quotaContextCache hitCache writeOutputThinkingOn failures
{% if link and r.wpid %}{{ r.label }}{% else %}{{ r.label }}{% endif %} {{ r.steps }}{{ r.cost_usd|money }}{{ su|money if su else "" }}{{ ((r.cost_usd or 0) + su)|money }}{{ r.quota_week|pct }} {{ r.context_tokens|tok }}{{ r.cache_hit|pct }} {{ r.cache_write|tok }}{{ r.output_tokens|tok }} {{ r.thinking_share|pct }}{{ r.failed_share|pct }}
{%- endmacro %} {#- Where the context went (view 5, toolcost.py). Carried = size × the calls that read it. -#} {% macro _share(r) -%} {{ r.share|pct }} {%- endmacro %} {% macro tools(t, one=False) -%} {%- if t %}

Each call reads the whole context so far, so a tool result costs its size times the calls after it ("carried"). Carried adds up to the context read{% if not one %} over {{ t.steps }} step{{ "s" if t.steps != 1 }} with transcripts{% endif %}.

{% for r in t.by_tool %} {{ _share(r) }} {% endfor %}
ToolResultsErrorsSizeCarriedShare
{{ r.label }}{{ r.n if r.tool or r.label[0] != "(" else "" }}{{ r.errors or "" }} {{ r.tokens|tok }}{{ r.carried|tok }}
{% for r in t.by_kind %} {{ _share(r) }} {% endfor %}
Command or fileToolResultsCarriedShare
{{ r.label|truncate(48, True, "…") }}{{ r.tool }}{{ r.n }} {{ r.carried|tok }}

Biggest single results

{% if not one %}{% endif %} {% for x in t.top %} {% if not one %}{% endif %} {% endfor %}
StepToolTargetCallSizeCarried
{% if x.link %}{{ x.step }}{% else %}{{ x.step }}{% endif %}{{ x.tool }}{% if x.error %} error{% endif %}{{ x.target|truncate(80, True, "…") }} {{ x.call }}{{ x.tokens|tok }}{{ x.carried|tok }}
{% if t.repeats %}

Lines read again in the same step

{% if not one %}{% endif %} {% for r in t.repeats %} {% if not one %}{% endif %} {% endfor %}
FileReads againStepsCarried
{{ r.target }}{{ r.n }}{{ r.steps }}{{ r.carried|tok }}

A read after an edit to the same lines is expected; the rest is context the step paid for twice.

{% endif %} {%- endif %} {%- endmacro %}