From b7d68d63acb5344c7bd0cbaac9ed6c49d3f722bf Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 13 Jan 2026 23:06:00 +0900 Subject: claude: show used percentage of context window in status line --- bin/__claude-code-statusline | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/__claude-code-statusline b/bin/__claude-code-statusline index d12d5d0..e315e1f 100755 --- a/bin/__claude-code-statusline +++ b/bin/__claude-code-statusline @@ -12,6 +12,7 @@ consumed_tokens="$(echo "$input" | jq -r ' (.input_tokens // 0) + (.cache_creation_input_tokens // 0) + (.cache_read_input_tokens // 0) | [. * 10 / 1000, 0] | max | floor / 10 | " \(.)k" ')" +used_percentage="$(echo "$input" | jq -r '.context_window.used_percentage // 0 | " @ \(.)%"')" cost="$(echo "$input" | jq -r '.cost.total_cost_usd // 0 | . * 100 | floor / 100 | " ($\(.))"')" -echo "[$model]$consumed_tokens$cost ${cwd/#$HOME/\~}" +echo "[$model]$consumed_tokens$used_percentage$cost ${cwd/#$HOME/\~}" -- cgit v1.2.3-70-g09d2