Skip to content

Commit b994613

Browse files
AnnatarHeclaude
andcommitted
fix(cc): include output tokens in context calculation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 0cd5c4a commit b994613

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

commands/cc_statusline.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616
)
1717

1818
var CCStatuslineCommand = &cli.Command{
19-
Name: "statusline",
20-
Usage: "Output statusline for Claude Code (reads JSON from stdin)",
19+
Name: "statusline",
20+
Usage: "Output statusline for Claude Code (reads JSON from stdin)",
2121
Action: commandCCStatusline,
2222
}
2323

@@ -96,6 +96,7 @@ func calculateContextPercent(cw model.CCStatuslineContextWindow) float64 {
9696
// Use current_usage if available for accurate context window state
9797
if cw.CurrentUsage != nil {
9898
currentTokens := cw.CurrentUsage.InputTokens +
99+
cw.CurrentUsage.OutputTokens +
99100
cw.CurrentUsage.CacheCreationInputTokens +
100101
cw.CurrentUsage.CacheReadInputTokens
101102
return float64(currentTokens) / float64(cw.ContextWindowSize) * 100

0 commit comments

Comments
 (0)