Skip to content

Commit f448668

Browse files
GordonBeemingclaudegitbutler-client
committed
feat: show effort level and thinking flag on dedicated model line
Move model display to its own line and add the current Claude effort level (color-coded: dim/plain/yellow/red) plus a thinking-mode indicator when extended thinking is enabled. Reads .effort.level and .thinking.enabled from the statusline JSON input. Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: GitButler <gitbutler@gitbutler.com>
1 parent 8dceeec commit f448668

2 files changed

Lines changed: 50 additions & 16 deletions

File tree

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# claude-statusline
22

3-
An enhanced multi-line status line for [Claude Code](https://claude.com/claude-code) that adds repo name, git branch info, cost tracking, rate limits, and token usage — grouped by category across three lines.
3+
An enhanced multi-line status line for [Claude Code](https://claude.com/claude-code) that adds repo name, git branch info, model + effort level, cost tracking, rate limits, and token usage — grouped by category across four lines.
44

55
## Features
66

77
- Shows current repo name with a folder icon
88
- GitButler support: displays active GitButler branches when on `gitbutler/workspace`
99
- Falls back to regular git branch display when not using GitButler
10+
- Shows current model name with its effort level (color-coded) and a thinking-mode indicator when extended thinking is on
1011
- Cost tracking via [goccc](https://github.com/backstabslash/goccc) (session + daily cost in your local currency)
1112
- Rate limit progress bar (5-hour window with time remaining, color-coded green/yellow/red)
1213
- Falls back to session duration display when rate limit data isn't available
@@ -17,7 +18,8 @@ An enhanced multi-line status line for [Claude Code](https://claude.com/claude-c
1718
## Status Line Example
1819

1920
```
20-
📂 xylem · 🌿 gb-branch-5 · 🤖 Opus 4.6
21+
📂 xylem · 🌿 gb-branch-5
22+
🤖 Opus 4.7 · ⚡ high · 🤔
2123
💸 A$1.21 session · 💰 A$48.00 today · ⏱️ ██░░░░░░░░ 23% 4h0m left
2224
💭 █░░░░░░░░░ 11% ctx · 🧠 45k in / 12k out
2325
```
@@ -26,9 +28,10 @@ Each line groups related information:
2628

2729
| Line | Purpose | Contents |
2830
|------|---------|----------|
29-
| 1 | **Identity** | 📂 Repo name · 🌿/🔀 Branch · 🤖 Model |
30-
| 2 | **Spend & limits** | 💸 Session cost · 💰 Daily cost · ⏱️ Rate limit bar |
31-
| 3 | **Technical** | 💭 Context usage bar · 🧠 Token counts |
31+
| 1 | **Identity** | 📂 Repo name · 🌿/🔀 Branch |
32+
| 2 | **Model** | 🤖 Model name · ⚡ Effort level · 🤔 Thinking flag |
33+
| 3 | **Spend & limits** | 💸 Session cost · 💰 Daily cost · ⏱️ Rate limit bar |
34+
| 4 | **Technical** | 💭 Context usage bar · 🧠 Token counts |
3235

3336
### Icons
3437

@@ -38,6 +41,8 @@ Each line groups related information:
3841
| 🌿 | GitButler active branch(es) |
3942
| 🔀 | Regular git branch (when not using GitButler) |
4043
| 🤖 | Current model |
44+
|| Effort level (`low` dim, `medium` plain, `high` yellow, `xhigh`/`max` red) |
45+
| 🤔 | Extended thinking is enabled (hidden when off) |
4146
| 💸 | Session cost (local currency) |
4247
| 💰 | Daily cost (local currency) |
4348
| ⏱️ | 5-hour rate limit (progress bar + time remaining) |

statusline.sh

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ eval "$(echo "$stdin_data" | jq -r '
5555
@sh "total_input=\(.context_window.total_input_tokens // 0)",
5656
@sh "total_output=\(.context_window.total_output_tokens // 0)",
5757
@sh "five_hour_pct=\(.rate_limits.five_hour.used_percentage // "")",
58-
@sh "five_hour_resets=\(.rate_limits.five_hour.resets_at // "")"
59-
' 2>/dev/null || echo 'cwd=""; model_name=""; model_id=""; session_cost_usd=0; duration_ms=0; ctx_pct=0; ctx_size=0; total_input=0; total_output=0; five_hour_pct=""; five_hour_resets=""')"
58+
@sh "five_hour_resets=\(.rate_limits.five_hour.resets_at // "")",
59+
@sh "effort_level=\(.effort.level // "")",
60+
@sh "thinking_enabled=\(.thinking.enabled // false)"
61+
' 2>/dev/null || echo 'cwd=""; model_name=""; model_id=""; session_cost_usd=0; duration_ms=0; ctx_pct=0; ctx_size=0; total_input=0; total_output=0; five_hour_pct=""; five_hour_resets=""; effort_level=""; thinking_enabled=false')"
6062

6163
# --- Get currency and daily cost from goccc ---
6264
currency_symbol="$"
@@ -137,6 +139,24 @@ if [[ -n "$model_name" ]]; then
137139
model_display="🤖 ${model_name}"
138140
fi
139141

142+
# --- Effort level ---
143+
effort_display=""
144+
if [[ -n "$effort_level" ]]; then
145+
case "$effort_level" in
146+
low) effort_display=$(printf '⚡ %b%s%b' "$DIM" "$effort_level" "$RESET") ;;
147+
medium) effort_display="${effort_level}" ;;
148+
high) effort_display=$(printf '⚡ %b%s%b' "$YELLOW" "$effort_level" "$RESET") ;;
149+
xhigh|max) effort_display=$(printf '⚡ %b%s%b' "$RED" "$effort_level" "$RESET") ;;
150+
*) effort_display="${effort_level}" ;;
151+
esac
152+
fi
153+
154+
# --- Thinking flag ---
155+
thinking_display=""
156+
if [[ "$thinking_enabled" == "true" ]]; then
157+
thinking_display="🤔"
158+
fi
159+
140160
# --- Session cost (convert USD to local currency) ---
141161
session_cost_local=""
142162
if [[ "$session_cost_usd" != "0" && "$session_cost_usd" != "null" ]]; then
@@ -201,22 +221,27 @@ if [[ -n "$repo_name" ]]; then
201221
fi
202222

203223
# --- Build multi-line output ---
204-
# Line 1: Identity — repo, branch, model
224+
# Line 1: Identity — repo, branch
205225
line1_parts=()
206226
[[ -n "$repo_name" ]] && line1_parts+=("📂 ${repo_name}")
207227
[[ -n "$branch_info" ]] && line1_parts+=("$branch_info")
208-
[[ -n "$model_display" ]] && line1_parts+=("$model_display")
209228

210-
# Line 2: Spend & limits — session cost, daily cost, rate limit
229+
# Line 2: Model — name, effort, thinking flag
211230
line2_parts=()
212-
[[ -n "$session_cost_local" ]] && line2_parts+=("$session_cost_local")
213-
[[ -n "$daily_cost_display" ]] && line2_parts+=("$daily_cost_display")
214-
[[ -n "$rate_display" ]] && line2_parts+=("$rate_display")
231+
[[ -n "$model_display" ]] && line2_parts+=("$model_display")
232+
[[ -n "$effort_display" ]] && line2_parts+=("$effort_display")
233+
[[ -n "$thinking_display" ]] && line2_parts+=("$thinking_display")
215234

216-
# Line 3: Technical — context, tokens
235+
# Line 3: Spend & limits — session cost, daily cost, rate limit
217236
line3_parts=()
218-
[[ -n "$ctx_display" ]] && line3_parts+=("$ctx_display")
219-
[[ -n "$token_display" ]] && line3_parts+=("$token_display")
237+
[[ -n "$session_cost_local" ]] && line3_parts+=("$session_cost_local")
238+
[[ -n "$daily_cost_display" ]] && line3_parts+=("$daily_cost_display")
239+
[[ -n "$rate_display" ]] && line3_parts+=("$rate_display")
240+
241+
# Line 4: Technical — context, tokens
242+
line4_parts=()
243+
[[ -n "$ctx_display" ]] && line4_parts+=("$ctx_display")
244+
[[ -n "$token_display" ]] && line4_parts+=("$token_display")
220245

221246
# Join parts within each line
222247
join_parts() {
@@ -244,5 +269,9 @@ if (( ${#line3_parts[@]} > 0 )); then
244269
[[ -n "$output" ]] && output+=$'\n'
245270
output+=$(join_parts "${line3_parts[@]}")
246271
fi
272+
if (( ${#line4_parts[@]} > 0 )); then
273+
[[ -n "$output" ]] && output+=$'\n'
274+
output+=$(join_parts "${line4_parts[@]}")
275+
fi
247276

248277
echo -e "$output"

0 commit comments

Comments
 (0)