← Claude Docs

Customize your status line - Claude Code Docs

Claude Docs · April 8, 2026
The status line is a customizable bar at the bottom of Claude Code that runs any shell script you configure. It receives JSON session data on stdin and displays whatever your script prints, giving you a persistent, at-a-glance view of context usage, costs,

Detailed Analysis

Anthropic's Claude Code documentation introduces a customizable status line feature that enables developers to embed real-time session data directly into their coding environment's interface. The status line operates as a persistent bar at the bottom of the Claude Code terminal interface, executing any user-defined shell script and rendering its output continuously. The system works by piping structured JSON session data to the configured script via stdin, then displaying whatever the script prints to stdout — a clean, Unix-philosophy approach that grants developers granular control over what information surfaces during a working session. Configuration is handled either through the `/statusline` natural-language command, which generates and registers a script automatically, or through manual edits to `~/.claude/settings.json`, where users specify a script path or inline shell command alongside optional parameters like `padding` and `refreshInterval`.

The data payload available to status line scripts is notably comprehensive, exposing fields that span model identity, working directory state, git worktree information, cumulative cost in USD, total and API-specific duration in milliseconds, lines of code added and removed, and detailed context window token counts including current usage percentage and remaining capacity. This breadth of telemetry transforms the status line from a simple display widget into a functional observability layer, allowing developers to monitor session economics and context constraints without interrupting their workflow. The inclusion of `workspace.added_dirs`, `workspace.project_dir`, and `workspace.git_worktree` fields reflects particular attention to multi-directory and multi-worktree workflows, where orientation cues become meaningfully harder to maintain.

The architecture of the update mechanism reveals deliberate engineering trade-offs. Status line scripts trigger after each assistant message, on permission mode changes, and on vim mode toggles, with a 300-millisecond debounce to consolidate rapid state changes into single executions. Critically, any in-flight script execution is cancelled if a new update event arrives, preventing stale renders from overlapping with current state. For scenarios where the main session becomes idle — such as when a coordinator agent waits on background subagents — the optional `refreshInterval` field allows time-driven polling independent of event triggers, ensuring that time-based segments like clocks or externally-sourced git state remain accurate even during quiet periods.

This feature sits within a broader trend in AI-assisted development tooling toward ambient awareness and persistent context management. As AI coding assistants extend session lengths and introduce multi-agent coordination patterns, the cognitive cost of tracking resource consumption, branching state, and session costs rises substantially. The status line addresses this by externalizing that monitoring burden into the interface layer rather than requiring developers to query it explicitly. The decision to implement this as an arbitrary shell script — rather than a fixed template or GUI configuration — is architecturally significant: it integrates naturally with existing terminal tooling, supports ANSI colors, OSC 8 hyperlinks, and multi-line output, and enables developers to incorporate any data source accessible from the shell, far beyond what the Claude Code JSON payload alone provides.

The feature also reflects a maturation in Anthropic's approach to developer tooling, moving beyond core model capability toward the ergonomic infrastructure surrounding sustained, professional use. Features like cost tracking via `cost.total_cost_usd` and context window pressure indicators via `context_window.used_percentage` directly address pain points that emerge when AI assistants move from experimental to production-grade use in engineering workflows. The combination of a natural-language setup command (`/statusline`) for accessibility and raw shell-script extensibility for power users mirrors Anthropic's broader dual-audience strategy: lowering barriers for adoption while preserving the full configurability that sophisticated users demand.

Read original article →