Claude Code: add context window % to status line
β’ 122 words β’ 1 min β’ updated
Claude code now officially supports showing context window information like percentage of usage in status line (via Ashik Nesin):
> /statusline Add a progress bar showing the percentage of context currently used
βΊ statusline-setup(Configure statusline progress bar)
βΏ Done (3 tool uses Β· 7.4k tokens Β· 44s)
βΊ I've configured your statusline to include a context usage progress bar. Your status line will now show something like:
.claude (git:main) [Claude 3.5 Sonnet] [ββββββββββ 60%]
The progress bar displays:
- Filled blocks (β) for used context
- Empty blocks (β) for remaining context
- Percentage showing exact usage
The context calculation includes input tokens, cache creation tokens, and cache read tokens relative to the total context window size.My updated
.claude/statusline.sh.