{% extends "base.html" %} {% import "_links.html" as links with context %} {% block title %}Tokens — Cairn Dashboard{% endblock %} {% block content %}

Token usage

Estimated context tokens per tool, ranked by total — the most context-expensive tool first.

{#- FR-002: the label names the mode that produced these numbers; uncalibrated means the window had no usable stored-summary sample, so the chars/token heuristic divisor stood in. -#}

Estimation mode: {{ tools.token_mode }}{% if tools.calibrated %} — calibrated at ~{{ tools.chars_per_token }} chars/token from this window's stored summaries{% elif 'heuristic' not in tools.token_mode %} — uncalibrated for this window; estimates use the {{ tools.chars_per_token }} chars/token heuristic divisor{% endif %}.

{% include "window_control.html" %} {#- FR-005: exports ride the view's current filters (the selected store rides links.url). -#} {%- set export_q = {} %} {%- if window != "all" %}{% set _ = export_q.update({'window': window}) %}{% endif %}

Export: CSV JSON

{% if tools %}
{{ tools | length }}
tools
{{ tools | sum(attribute='calls') }}
calls
~{{ tools | sum(attribute='total_tokens') }}
est. tokens total
{% for t in tools %} {#- FR-003: unknown (no recorded truncation evidence) is not zero. -#} {% endfor %}
Tool Calls Est. req tokens Est. resp tokens Total est. tokens Mean est. tokens Truncated calls Chars cut
{{ links.view_link('history', 'tool', t.tool_name, window) }} {{ t.calls }} ~{{ t.est_req_tokens }} ~{{ t.est_resp_tokens }} ~{{ t.total_tokens }} ~{{ t.mean_tokens | mean }}{% if t.truncated_calls is none %}unknown{% else %}{{ t.truncated_calls }}{% endif %} {% if t.truncated_chars is none %}—{% else %}{{ t.truncated_chars }}{% endif %}
{% else %}

No tool calls recorded yet.

{% endif %}
{% endblock %} {% block scripts %}{% endblock %}