Give this a try and let me know your thoughts. Save the file in your user folder in .claude/statusline-command.sh Example: Opus 4.7 (1M context) | [█░░░░░░░░░] 11% | branch:main | 5h:44% | 7d:6% | session:1h0m #!/usr/bin/env bash # ANSI colors GREEN=“\033[32m” YELLOW=“\033[33m” RED=“\033[31m” ORANGE=“\033[38;5;214m” CYAN=“\033[38;5;45m” WHITE=“\033[37m” RESET=“\033[0m” input=$(cat) # ── Model name & context size ───────────────────────────────────────────────── model_name=$(echo “$input” | jq -r ‘.model.display_name // empty’) ctx_size=$(echo “$input” | jq -r ‘.context_window.context_window_size // empty’) if [ -n “$ctx_size” ] && [ “$ctx_size” -ge 1000000 ] 2>/dev/null; then ctx_label=“$(( ctx_size / 1000000 ))M context” elif [ -n “$ctx_size” ] && [ “$ctx_size” -ge 1000 ] 2>/dev/null; then ctx_label=“$(( ctx_size / 1000 ))K context” else ctx_label=“” fi if [ -n “$model_name” ] && [ -n “$ctx_label” ]; then case “$model_name” in *(*context)) model_part=“$model_name}" ;; *) model_part=“${model_name} (${ctx_label})” ;; esac elif [ -n “$model_name” ]; then model_part=“${model_name}” else model_part=“” fi # ── Context window bar ──────────────────────────────────────────────────────── used_pct=$(echo “$input” █”; done for i in $(seq 1 $empty); do bar=“$bar}░“; done if [ “$used_int” -le 15 ]; then color=”$GREEN" elif [ “$used_int” -le 50 ]; then color=“$YELLOW” elif [ “$used_int” -le 75 ]; then color=“$ORANGE” else color=“$RED” fi ctx_bar_part=“${WHITE}[${RESET}${color}${bar}${RESET}${WHITE}]${RESET} ${color}${used_int}%${RESET}” else ctx_bar_part=“${WHITE}[${RESET}${GREEN}░░░░░░░░░░${RESET}${WHITE}]${RESET} ${GREEN}0%${RESET}” fi if [ -n “$model_part” ]; then model_colored=“${ORANGE}${model_part}${RESET}” ctx_part="${model_colored} ” else ctx_part=“$ctx_bar_part” fi # ── Git branch ──────────────────────────────────────────────────────────────── branch_part=“” git_branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) if [ -n “$git_branch” ]; then branch_part=" | branch:$CYAN}${git_branch}${RESET}" fi # ── Rate limits ─────────────────────────────────────────────────────────────── five=$(echo “$input” rate_part=“” if [ -n “$five” ] && [ -n “$week” ]; then five_int=$(printf ‘%.0f’ “$five”) week_int=$(printf ‘%.0f’ “$week”) five_color=$(_rate_color “$five”) week_color=$(_rate_color “$week”) rate_part=" | 5h:$five_color}${five_int}%${RESET} $week_int}%${RESET} $five_int}%${RESET} $week_int}%${RESET} ${hours}h${minutes}m${RESET}" fi fi # ── Output ──────────────────────────────────────────────────────────────────── printf ‘%b’ “${ctx_part}${branch_part}${rate_part}${session_time_part}” submitted by /u/Spiritual_Cycle_3263
Originally posted by u/Spiritual_Cycle_3263 on r/ClaudeCode
