Documentation
¶
Overview ¶
Package statusline is the sink of Claude Code's status line: the platform's statusline script posts the JSON Claude gives it on every refresh, the sink keeps the subscription limits and the session's figures from it, and answers the line to show, which is the output of the person's own statusLine command when they have one.
Index ¶
Constants ¶
const ( // DefaultTimeout is how long the person's command may run: the script's curl gives up after 2 s anyway. DefaultTimeout = 2 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Sink ¶
type Sink struct {
// Authorized is the old API's own check (a page session or the cli-token); TokenOK is the cli-token the handler
// asks for besides.
Authorized, TokenOK func(*http.Request) bool
// Home is the person's home ($HOME in a command), ClaudeDir Claude Code's folder (its settings.json).
Home, ClaudeDir string
Limits *limits.Cache
Stats *history.Stats
// Ultracode says whether a session belongs to a tab whose remembered launch asked for ultracode; nil for none.
Ultracode func(sessionID any) bool
// Broadcast hands the session's stored figures to the conversation views that show it.
Broadcast func(stats *jsvalue.Object)
// Script is the platform's own statusline script: a statusLine command that runs it would post here again.
Script string
// Timeout bounds the person's command (DefaultTimeout when 0).
Timeout time.Duration
// Now is the clock (tests freeze it); nil is the real one.
Now func() time.Time
// contains filtered or unexported fields
}
Sink answers POST /api/status/statusline.