Skip to content

Cost tracking: show token usage and cost per run #13

Closed

Description

@dominicnunez

Summary

Track and display cost at the end of each run.

=== Run Complete ===
  Tasks: 5/5 completed
  Iterations: 7
  Tokens: 245K in / 89K out
  Cost: ~$12.40
  Duration: 34m 22s

Why

Running Opus in loops burns money. You need to know what each run costs to make informed decisions about model selection and task granularity.

Implementation

We already receive the result event from stream-json which includes:

{"type":"result", "total_cost_usd": 5.57, "usage": {"input_tokens": ..., "output_tokens": ...}}

Accumulate across iterations, display at end. Optionally log to ~/.sfk/costs/.

Activity

  1. dominicnunez commented on Feb 21, 2026

    @dominicnunez
    OwnerAuthor

    Not a priority for #24 - Springfield Ultra. Cost tracking can be addressed as a future enhancement if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions