@@ -11,8 +11,6 @@ import (
1111 "strings"
1212
1313 "github.com/spf13/cobra"
14-
15- "github.com/RandomCodeSpace/ctm/internal/claude"
1614)
1715
1816func init () {
@@ -24,17 +22,15 @@ func init() {
2422// we print a three-line display on stdout. Hidden because it's an
2523// internal hook, not a user-facing command.
2624//
27- // Output layout (3 lines):
25+ // Output layout (2 lines):
2826//
2927// Line 1: <model> · <project> (project shown as a plain path)
30- // Line 2: c 25% (437k) w 40% h 10% (context % + tokens + rate limits)
31- // Line 3: ↑ 117k ↓ 434k (cumulative session input / output)
28+ // Line 2: ctx 25% w 40% h 10% (context % + rate limits)
3229//
33- // Cache_read (⚡) was dropped from the status because its magnitude is
34- // already captured in the context-tokens parenthesis and Claude Code's
35- // own focus-mode overlay duplicates the information. Weekly / 5-hour
36- // rate limits share line 2 with context because they're all
37- // percentages; tokens share line 3 because both are cumulative ints.
30+ // Cache_read (⚡) was dropped because its magnitude is already captured
31+ // in the context-tokens parenthesis and Claude Code's own focus-mode
32+ // overlay duplicates the information. Weekly / 5-hour rate limits
33+ // share line 2 with context because they're all percentages.
3834var statuslineCmd = & cobra.Command {
3935 Use : "statusline" ,
4036 Short : "Internal statusLine renderer — reads JSON on stdin (hidden)" ,
@@ -138,9 +134,6 @@ const (
138134 cMagenta = "\x1b [1;38;5;220m" // weekly bar
139135 cYellow = "\x1b [1;38;5;208m" // 5-hour bar
140136 cHdrModel = "\x1b [1;97m"
141- cTokIn = "\x1b [1;38;5;33m"
142- cTokOut = "\x1b [1;38;5;37m"
143- cDimGray = "\x1b [90m"
144137)
145138
146139func renderStatusline (in * statuslineInput ) string {
@@ -153,9 +146,6 @@ func renderStatusline(in *statuslineInput) string {
153146 if mid != "" {
154147 lines = append (lines , mid )
155148 }
156- if s := buildTokenLine (in ); s != "" {
157- lines = append (lines , s )
158- }
159149 return strings .Join (lines , "\n " )
160150}
161151
@@ -201,66 +191,15 @@ func buildHeader(in *statuslineInput) string {
201191 }
202192}
203193
204- // readEffortLevel is a cmd-package-local wrapper so other renderers can
205- // pick up the current effort level without duplicating the path dance.
206- // Silent on every error path — effort is a nice-to-have, not critical.
207- func readEffortLevel () string {
208- p , err := claude .SettingsJSONPath ()
209- if err != nil {
210- return ""
211- }
212- return claude .ReadEffortLevel (p )
213- }
214-
215- // buildContextLine builds the `c <pct>% (<tokens>)` segment of line 2.
216- // The context-window-used percentage is the primary signal; the
217- // parenthesised token sum (input + cache_creation + cache_read, per
218- // Claude Code's input-only formula) is a secondary concrete number.
194+ // buildContextLine builds the `ctx <pct>%` segment of line 2.
219195// Returns "" when used_percentage is absent.
220196func buildContextLine (in * statuslineInput ) string {
221197 used := in .ContextWindow .UsedPercentage
222198 if used == nil {
223199 return ""
224200 }
225201 usedPct := int (math .Round (* used ))
226- entry := fmt .Sprintf ("%sc %d%%%s" , cCyan , usedPct , cReset )
227- if ctx := contextTokens (in ); ctx > 0 {
228- entry += fmt .Sprintf (" %s(%s)%s" , cDimGray , fmtTokens (ctx ), cReset )
229- }
230- return entry
231- }
232-
233- // buildTokenLine renders the cumulative session token totals: `↑ <input>`
234- // and `↓ <output>`. cache_read (⚡) used to live here too; it was dropped
235- // from the statusline — the token magnitude is already visible as the
236- // parenthesised number on the context line and Claude Code's focus-mode
237- // overlay renders its own cache indicator.
238- func buildTokenLine (in * statuslineInput ) string {
239- var parts []string
240- add := func (glyph rune , color string , n * int64 ) {
241- if n == nil || * n <= 0 {
242- return
243- }
244- parts = append (parts , fmt .Sprintf ("%s%c%s %s%s%s" ,
245- color , glyph , cReset , cDimGray , fmtTokens (* n ), cReset ))
246- }
247- add ('↑' , cTokIn , in .ContextWindow .TotalInputTokens )
248- add ('↓' , cTokOut , in .ContextWindow .TotalOutputTokens )
249- line := strings .Join (parts , " " )
250-
251- // Tack the current effort level onto the last line. Sourced from
252- // ~/.claude/settings.json via readEffortLevel — not in Claude
253- // Code's statusLine payload. Dim-gray so it reads as secondary
254- // info next to the token counts. Only appended when at least one
255- // token is present so a truly empty payload doesn't render a
256- // lone "· xhigh" orphan.
257- if line == "" {
258- return ""
259- }
260- if effort := readEffortLevel (); effort != "" {
261- line += fmt .Sprintf (" %s%s%s" , cDimGray , effort , cReset )
262- }
263- return line
202+ return fmt .Sprintf ("%sctx %d%%%s" , cCyan , usedPct , cReset )
264203}
265204
266205// buildRateLimitLine renders `w <pct>%` and `h <pct>%` for weekly and
0 commit comments