Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · claude-code

Customize your status line changedstatusline

Upstream edited this page at 23 Nov 2026 05:19 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 23 Nov 2026 05:37 UTC.

Upstream edited
Recorded here
Lines+14added
Lines−2removed
From line 159 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits44to this page, all time

The whole hunk

from line 159, old and new numbered
/
lines
from line 159
159159 
160160### Size output to the terminal
161161 
162Claude Code captures your script's output instead of connecting it directly to the terminal, so `tput cols` and language-level width detection cannot read the terminal size from inside the script. Read the `COLUMNS` and `LINES` environment variables instead. Claude Code sets these to the current terminal dimensions before running your script.
162To fit your status line to the terminal, read the size that Claude Code passes to your script. Claude Code puts the width in the `COLUMNS` environment variable and the height in `LINES`, and updates both each time it [runs your script](#when-the-status-line-updates). Calls that ask the terminal directly, such as `stty size`, can fail because your script isn't connected to the terminal.
163163 
164To keep a line from being cut off with `…`, make it at least four columns narrower than the terminal. Those four columns leave room for the spacing Claude Code adds on each side.
165 
166This Bash example calculates the widest your output can be:
167 
168```bash theme={null}
169max_width=$((COLUMNS - 4))
170```
171 
172In an 80-column terminal, `max_width` is 76. If you set [`padding`](#manually-configure-a-status-line), also subtract twice its value from `max_width`.
173 
174When you measure a line, count an emoji such as 📁 as two columns.
175 
164176## Available data
165177 
166178Claude Code sends the following JSON fields to your script via stdin:
from line 1175
11631175 
11641176* System notifications like MCP server errors and auto-updates display on the right side of the row. Transient notifications such as the context-low warning also cycle through this area.
11651177* Enabling verbose mode adds a token counter to this area, showing the size of your context as the last API response reported it, not the [per-turn count beside the spinner](https://code.claude.com/docs/en/costs.md#read-the-token-count-beside-the-spinner)
1166* On narrow terminals, these notifications may truncate your status line output
1178* When a notification doesn't fit beside your status line, the notification moves to a row below
11671179 
Feedback