diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-01-13 23:06:00 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-01-13 23:06:00 +0900 |
| commit | b7d68d63acb5344c7bd0cbaac9ed6c49d3f722bf (patch) | |
| tree | e163e2ace2c1807ceb98e016e4f4a2247e8a89a8 /bin/__claude-code-statusline | |
| parent | 37e4e92569b5f0b2e7bf4a101db011a0c4c6fbac (diff) | |
| download | dotfiles-b7d68d63acb5344c7bd0cbaac9ed6c49d3f722bf.tar.gz dotfiles-b7d68d63acb5344c7bd0cbaac9ed6c49d3f722bf.tar.zst dotfiles-b7d68d63acb5344c7bd0cbaac9ed6c49d3f722bf.zip | |
claude: show used percentage of context window in status line
Diffstat (limited to 'bin/__claude-code-statusline')
| -rwxr-xr-x | bin/__claude-code-statusline | 3 |
1 files changed, 2 insertions, 1 deletions
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/\~}" |
