Skip to content

[FEATURE] Include Token Usage in Status Line JSON #10436

@max-oberbrunner

Description

@max-oberbrunner

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Add token usage information to the JSON input provided to custom status line commands, allowing users to display conversation token counts in their status line.

Current Behavior: The JSON passed to statusLine.command includes:

  • session_id, cwd, model, workspace, cost
  • exceeds_200k_tokens (boolean flag)

Proposed Solution

Add token usage fields to the JSON:
{
"tokens": {
"used": 39583,
"total": 200000,
"remaining": 160417
},
// ... existing fields
}

Alternative Solutions

Currently only exceeds_200k_tokens is available, which is binary and provides limited visibility.

Priority

Low - Nice to have

Feature Category

CLI commands and flags

Use Case Example

Users want to monitor conversation length directly in their status line (e.g., 🎯 40K/200K or 20%) to:

  • Know when to start fresh conversations
  • Track context window usage in real-time
  • Avoid hitting token limits unexpectedly

Additional Context

Token usage is already visible in system messages (budget:token_budget) during conversations, so this data exists internally and could be exposed to status line scripts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions