Documentation
¶
Overview ¶
Package statusline draws the sitrep block of Claude Code's status line: the optional upstream status line (such as Claude HUD) first, then the session's Objective, Progress and Now, and a queue line. Claude Code gives it the session as JSON on standard input.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextOf ¶ added in v0.8.0
ContextOf reads the context window of a session from the status line's input, and says whether there is one. The percentage is used_percentage when that is above 0: Claude Code sends 0 or null before the first answer though current_usage is real, so otherwise it is the tokens over the size. A window and no usage (a new session, or just after /compact) is empty, 0 used.
Types ¶
type Line ¶
type Line struct {
Store state.Store
Conf conf.Conf
Run runner.Runner
Env []string // the environment of the upstream command, which gets SITREP_RENDERING=1 added
// Version is this program's version; a newer release recorded by the daily check is announced after the queue line. Empty means no notice.
Version string
// Now is the time recorded with the context window; time.Now when nil.
Now func() time.Time
}
Line draws the status line.