Telemetry & Cost Tracking

Every model call Telesis makes is logged to .telesis/telemetry.jsonl. This gives you complete visibility into token usage, cost, and which components are consuming your API budget.

What’s Tracked

Each model call records:

FieldDescription
idUnique call identifier
timestampISO 8601 timestamp
componentWhich Telesis feature made the call (e.g., interview, generate:vision, review, planner, validator)
modelModel used (e.g., claude-sonnet-4-6)
providerAPI provider (anthropic)
inputTokensTokens sent to the model
outputTokensTokens returned by the model
cacheReadTokensTokens served from prompt cache (if applicable)
cacheWriteTokensTokens written to prompt cache (if applicable)
durationMsWall-clock duration of the call
sessionIdSession identifier for grouping related calls

Viewing Usage

1
telesis status

The status command aggregates telemetry across all calls and displays total input tokens, total output tokens, call count, and estimated cost.

Cost Derivation

Costs are derived at display time, not stored. This is an intentional design decision — token counts are immutable facts, but pricing changes. By storing tokens and deriving cost from the current pricing configuration, Telesis ensures cost estimates remain accurate even after pricing changes.

Pricing is configured in .telesis/pricing.yml:

1
2
3
4
5
6
7
8
9
models:
  claude-sonnet-4-6:
    inputCost: 0.003        # Per 1K input tokens
    outputCost: 0.015       # Per 1K output tokens
    cacheReadCost: 0.0003   # Per 1K cache read tokens
    cacheWriteCost: 0.0075  # Per 1K cache write tokens
  claude-haiku-4-5-20251001:
    inputCost: 0.00008
    outputCost: 0.0004

The cost formula for each call:

1
2
3
4
cost = (inputTokens / 1000 × inputCost)
     + (outputTokens / 1000 × outputCost)
     + (cacheReadTokens / 1000 × cacheReadCost)
     + (cacheWriteTokens / 1000 × cacheWriteCost)

Telemetry by Component

The component field lets you understand where your tokens are going. Common components:

ComponentFeature
interviewtelesis init conversation
generate:visionVISION.md generation
generate:prdPRD.md generation
generate:architectureARCHITECTURE.md generation
generate:milestonesMILESTONES.md generation
reviewCode review analysis
review:judgeLLM judge for dismissal re-raises
review:dedupCross-persona deduplication
review:themesTheme extraction
plannerPlan decomposition
validatorTask validation
oversight:reviewerReviewer observer
oversight:architectArchitect observer
oversight:chroniclerChronicler observer

Error Handling

Telemetry write failures are logged to stderr but never abort the operation. If .telesis/telemetry.jsonl can’t be written (permissions, disk full, etc.), Telesis continues working — losing telemetry is preferable to failing the actual task.

Storage Format

Telemetry uses JSONL (JSON Lines) — one record per line, append-only. This format is efficient for streaming writes and simple to parse with standard tools:

1
2
3
4
5
6
7
8
# Count total model calls
wc -l .telesis/telemetry.jsonl

# Find the most expensive calls
cat .telesis/telemetry.jsonl | jq -s 'sort_by(.outputTokens) | reverse | .[0:5]'

# Total tokens by component
cat .telesis/telemetry.jsonl | jq -s 'group_by(.component) | map({component: .[0].component, totalInput: (map(.inputTokens) | add), totalOutput: (map(.outputTokens) | add)})'