You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 36f376d
Browse filesBrowse the repository at this point in the historyBrowse files
feat(ccusage): support context_window field from Claude Code statusline hook
Claude Code now provides context_window data in its statusline hook JSON,
containing total_input_tokens, total_output_tokens, and context_window_size.
This change:
- Adds context_window field to statuslineHookJsonSchema in _types.ts
- Updates statusline command to prefer context_window data when available
- Falls back to existing transcript-based calculation when not provided
- Refactors context info formatting into reusable helper function
- Uses Result type pattern for consistent functional error handling
The context_window data from Claude Code is more accurate than parsing
the transcript file, as it reflects the actual token counts used by the API.
0 commit comments