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
feat(ccusage): support context_window field from Claude Code statusline hook (#749)
* 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. * docs: add context_window reference to statusline guide Add note about Claude Code's context_window data being used for accurate token counts, with link to official documentation. * chore(ccusage): fix typo colour to color
0 commit comments