Expand description
StatusContext is the canonical, tool-agnostic model parsed from a
statusline JSON payload (Claude Code today; per-tool normalizers are
added as other tools wire in). Rate-limit windows live on
DataContext::usage() and are not parsed from stdin; see
docs/specs/input-schema.md for the full contract.
Structs§
- Context
Window - Cost
Metrics - GitWorktree
- Model
Info - Output
Style - Active output style. Kept as a struct (rather than collapsing to
Option<String>) sonamecan later evolve to an enum with aCustom(String)variant without breaking downstream type signatures. See ADR-0008. - Parse
Opts - Caller-side hooks for
parse_with_opts. - Percent
- Percentage in
0.0..=100.0. Construction outside that range returnsNoneso normalizers can translate toParseError::InvalidValue. - Source
Pos - Status
Context - The canonical, tool-agnostic input to the rendering pipeline.
ArcaroundrawkeepsStatusContext::cloneat O(1) when segments cache. - Turn
Usage - Per-turn token breakdown from
context_window.current_usage. All counts are for the most recent API call only — useContextWindow’stotal_*_tokensfor cumulative session values. - Workspace
Info
Enums§
- Effort
Level - Json
Type - Parse
Error - Tool
Tool::Other(s)is intentionally NOT canonicalized: it compares unequal to a known variant even whens.eq_ignore_ascii_case("claude"). Supply runtime-detected tool names through the public entry points (parse_with_optswithParseOpts::with_tool, or theLINESMITH_TOOLenv var) — the internal alias table folds known names into canonical variants before reachingOther, so directTool::Other("claude")-style construction is a contract violation.- VimMode
- Vim editing mode reflected from Claude Code’s
vim.modefield.Commandis Vim’s:-prefix command-line buffer, not “a command was run”.
Functions§
- parse
- Parse a statusline JSON payload into a
StatusContext. - parse_
with_ opts - Parse a statusline JSON payload into a
StatusContextwith caller hooks. Tool detection follows the precedence indocs/specs/input-schema.md§“Heuristic detection”: opts override →LINESMITH_TOOLenv → shape heuristic → Fallback (ClaudeCode).