Skip to content

[aw][code health] README command examples are stale (missing column, wrong token format) #239

@microsasa

Description

@microsasa

Root Cause

The live and cost command examples in README.md were written before the current render_live_sessions and render_cost_view implementations and no longer match the actual output.

Findings

copilot-usage live — two discrepancies

1. Missing "Est. Cost" column

The README shows a 7-column table:

│ Session ID │ Name │ Model │ Running │ Messages │ Output Tokens │ CWD │

The actual render_live_sessions in report.py:203-206 adds an "Est. Cost" column between Messages and Output Tokens, yielding 8 columns:

table.add_column("Messages", ...)
table.add_column("Est. Cost", ...)       # ← absent from README example
table.add_column("Output Tokens", ...)
table.add_column("CWD", ...)
```

**2. Wrong Output Tokens format**

The README shows raw comma-formatted integers (`468,625`, `1,225,990`). The actual code calls `format_tokens(output_tok)` (`report.py:236`), which renders as `468.6K` and `1.2M`.

### `copilot-usage cost` — wrong value in "Since last shutdown" row

The README example shows `N/A` in the **Premium Cost** column for the "↳ Since last shutdown" row:
```
│   ↳ Since last shutdownclaude-opus-4.6N/AN/A │ ...

The actual render_cost_view (report.py:1005-1011) sets Requests to "N/A" but Premium Cost to an estimated value (est = _estimate_premium_cost(...), e.g. ~3), never "N/A".

Resolution

Update the example output blocks in README.md to match the current output:

  • Add the Est. Cost column to the live example table.
  • Replace raw token integers with K/M formatted values (468.6K, 483.8K, 1.2M).
  • Fix the cost "↳ Since last shutdown" row to show an estimated cost (e.g. ~3) in the Premium Cost column instead of N/A.

Testing Requirement

No new tests needed — the README examples are documentation only. Verify by running copilot-usage live and copilot-usage cost against a real session-state directory (or the existing e2e fixtures) and diffing against the updated README examples.

Generated by Code Health Analysis ·

Metadata

Metadata

Assignees

No one assigned

    Labels

    awCreated by agentic workflowaw-dispatchedIssue has been dispatched to implementer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions