Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

fix(statusline): drop the word "pace" from the rate-limit segment (#3053)

Maximilian Roosce7c7c4861aa
diff --git a/docs/content/claude-code.md b/docs/content/claude-code.md
index 1b609532e..7f58af1f0 100644
--- a/docs/content/claude-code.md
+++ b/docs/content/claude-code.md
@@ -109,9 +109,9 @@ On session exit the worktree is offered for removal via the `WorktreeRemove` hoo
`wt list statusline --format=claude-code` outputs a single-line status for the Claude Code statusline. When the CI status cache is stale, this fetches from the network — typically 1–2 seconds — making it suitable for async statuslines but too slow for synchronous shell prompts. If a faster version would be helpful, please [open an issue](https://github.com/max-sixty/worktrunk/issues).
-<code>~/w/myproject.feature-auth !🤖 @<span style='color:#0a0'>+42</span> <span style='color:#a00'>-8</span> <span style='color:#0a0'>↑3</span> <span style='color:#0a0'>⇡1</span> <span style='color:#0a0'>#3035</span> Opus 🌔 65% <span style='color:#a70'>1.4×pace(10am–3pm)</span></code>
+<code>~/w/myproject.feature-auth !🤖 @<span style='color:#0a0'>+42</span> <span style='color:#a00'>-8</span> <span style='color:#0a0'>↑3</span> <span style='color:#0a0'>⇡1</span> <span style='color:#0a0'>#3035</span> Opus 🌔 65% <span style='color:#a70'>1.4×(10am–3pm)</span></code>
-When Claude Code provides context window usage via stdin JSON, a moon phase gauge appears (🌕→🌑 as context fills). A yellow `<n>×pace(<window>)` segment appears when Claude's 5-hour or weekly rate limit is on track to be hit before reset — `1.4×pace(10am–3pm)` reads as 1.4× the pace that would exactly fill that window.
+When Claude Code provides context window usage via stdin JSON, a moon phase gauge appears (🌕→🌑 as context fills). A yellow `<n>×(<window>)` segment appears when Claude's 5-hour or weekly rate limit is on track to be hit before reset — `1.4×(10am–3pm)` reads as 1.4× the pace that would exactly fill that window.
<figure class="demo">
<picture>
diff --git a/skills/worktrunk/reference/claude-code.md b/skills/worktrunk/reference/claude-code.md
index b434e6f28..45f41a26a 100644
--- a/skills/worktrunk/reference/claude-code.md
+++ b/skills/worktrunk/reference/claude-code.md
@@ -111,9 +111,9 @@ On session exit the worktree is offered for removal via the `WorktreeRemove` hoo
`wt list statusline --format=claude-code` outputs a single-line status for the Claude Code statusline. When the CI status cache is stale, this fetches from the network — typically 1–2 seconds — making it suitable for async statuslines but too slow for synchronous shell prompts. If a faster version would be helpful, please [open an issue](https://github.com/max-sixty/worktrunk/issues).
-<code>~/w/myproject.feature-auth !🤖 @<span style='color:#0a0'>+42</span> <span style='color:#a00'>-8</span> <span style='color:#0a0'>↑3</span> <span style='color:#0a0'>⇡1</span> <span style='color:#0a0'>#3035</span> Opus 🌔 65% <span style='color:#a70'>1.4×pace(10am–3pm)</span></code>
+<code>~/w/myproject.feature-auth !🤖 @<span style='color:#0a0'>+42</span> <span style='color:#a00'>-8</span> <span style='color:#0a0'>↑3</span> <span style='color:#0a0'>⇡1</span> <span style='color:#0a0'>#3035</span> Opus 🌔 65% <span style='color:#a70'>1.4×(10am–3pm)</span></code>
-When Claude Code provides context window usage via stdin JSON, a moon phase gauge appears (🌕→🌑 as context fills). A yellow `<n>×pace(<window>)` segment appears when Claude's 5-hour or weekly rate limit is on track to be hit before reset — `1.4×pace(10am–3pm)` reads as 1.4× the pace that would exactly fill that window.
+When Claude Code provides context window usage via stdin JSON, a moon phase gauge appears (🌕→🌑 as context fills). A yellow `<n>×(<window>)` segment appears when Claude's 5-hour or weekly rate limit is on track to be hit before reset — `1.4×(10am–3pm)` reads as 1.4× the pace that would exactly fill that window.
Add to `~/.claude/settings.json`:
diff --git a/src/cli/list.rs b/src/cli/list.rs
index d60478046..f12046f9d 100644
--- a/src/cli/list.rs
+++ b/src/cli/list.rs
@@ -10,24 +10,19 @@ pub enum ListSubcommand {
- `table` (default): `branch status ±working commits upstream ci`
- `json`: Same structure as `wt list --format=json` but for the current worktree only
-- `claude-code`: Reads context from stdin, adds directory, model, context, and rate-limit segments
+- `claude-code`: `dir branch status ±working commits upstream ci model context pace`
## Claude Code mode
-With `--format=claude-code`, reads JSON context from stdin:
-`dir branch status ±working commits upstream ci model context pace`
+`--format=claude-code` reads JSON context from stdin (`.workspace.current_dir` is required; the rest are optional):
-Input fields (`.workspace.current_dir` is required; the rest are optional):
- `.workspace.current_dir` — working directory
- `.model.display_name` — model name
-- `.context_window.used_percentage` — context usage (0-100)
-- `.rate_limits.{five_hour,seven_day}.used_percentage` — rate-limit window usage (0-100)
+- `.context_window.used_percentage` — context usage (0–100)
+- `.rate_limits.{five_hour,seven_day}.used_percentage` — rate-limit window usage (0–100)
- `.rate_limits.{five_hour,seven_day}.resets_at` — window reset time (Unix epoch seconds)
-The pace segment (e.g. `2.9×pace(Tue–Tue 5pm)`) appears only when usage is
-likely to hit a rate limit before its window resets, and shows the
-higher-risk window. With `-vv`, each window's inputs and projection are
-logged to `.git/wt/logs/trace.log`.
+The pace segment appears only when usage is likely to hit a rate limit before its window resets, and shows the higher-risk window: `2.9×(Tue–Tue 5pm)` reads as 2.9× the pace that would exactly fill that window. "Likely" is a Bayesian forecast; early-window bursts don't trigger it. With `-vv`, each window's inputs and projection are logged to `.git/wt/logs/trace.log`.
"#)]
Statusline {
/// Output format (table, json, claude-code)
diff --git a/src/commands/statusline.rs b/src/commands/statusline.rs
index ade6cf08a..9956ae6fc 100644
--- a/src/commands/statusline.rs
+++ b/src/commands/statusline.rs
@@ -485,8 +485,8 @@ fn select_binding_window(
/// Build the rate-limit segment, or `None` to hide.
///
-/// Shape: `<pace>×pace(<window_bounds>)` — e.g. `1.4×pace(10am–3pm)` or
-/// `1.9×pace(Mon–Mon 3pm)`. `pace` is the **naive `u/t` ratio**: what the
+/// Shape: `<pace>×(<window_bounds>)` — e.g. `1.4×(10am–3pm)` or
+/// `1.9×(Mon–Mon 3pm)`. `pace` is the **naive `u/t` ratio**: what the
/// user has actually consumed per unit elapsed window. `1.0×` is on pace
/// to exactly fill the window; `>1.0×` is over-pace. The Bayesian
/// posterior `m₁` is only used by [`p_over`] to decide whether to show —
@@ -511,7 +511,7 @@ fn format_rate_limit_segment(readings: &[RateLimitReading], now_unix: i64) -> Op
// the warning. Unlike informational segments where color picks out one
// sub-glyph (`@+1` green, `?` cyan), here the entire string is the
// "you should look at this" signal.
- Some(color_print::cformat!("<yellow>{pace:.1}×pace({bounds})</>"))
+ Some(color_print::cformat!("<yellow>{pace:.1}×({bounds})</>"))
}
/// Format context usage as a moon phase gauge.
@@ -1390,7 +1390,7 @@ mod tests {
// is wrapped in `<yellow>…</>`.
let visible = out.ansi_strip();
assert!(
- visible.starts_with("1.3×pace(") && visible.ends_with(')'),
+ visible.starts_with("1.3×(") && visible.ends_with(')'),
"unexpected format: {visible:?}"
);
}
diff --git a/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_24h_locale.snap b/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_24h_locale.snap
index 591c55626..18282bb8d 100644
--- a/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_24h_locale.snap
+++ b/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_24h_locale.snap
@@ -2,4 +2,4 @@
source: tests/integration_tests/statusline.rs
expression: out
---
-[PATH] main ^| Opus 🌕 42% 1.3×pace(10:00–15:00)
+[PATH] main ^| Opus 🌕 42% 1.3×(10:00–15:00)
diff --git a/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_at_limit.snap b/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_at_limit.snap
index 754b2fc73..b1c81d179 100644
--- a/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_at_limit.snap
+++ b/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_at_limit.snap
@@ -2,4 +2,4 @@
source: tests/integration_tests/statusline.rs
expression: out
---
-[PATH] main ^| Opus 🌕 42% 1.7×pace(10am–3pm)
+[PATH] main ^| Opus 🌕 42% 1.7×(10am–3pm)
diff --git a/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_clock_time.snap b/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_clock_time.snap
index d589edf43..27064a493 100644
--- a/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_clock_time.snap
+++ b/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_clock_time.snap
@@ -2,4 +2,4 @@
source: tests/integration_tests/statusline.rs
expression: out
---
-[PATH] main ^| Opus 🌕 42% 1.3×pace(10am–3pm)
+[PATH] main ^| Opus 🌕 42% 1.3×(10am–3pm)
diff --git a/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_with_minutes.snap b/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_with_minutes.snap
index ca01ace4b..fc69aa06d 100644
--- a/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_with_minutes.snap
+++ b/tests/snapshots/integration__integration_tests__statusline__rate_limit_5h_with_minutes.snap
@@ -2,4 +2,4 @@
source: tests/integration_tests/statusline.rs
expression: out
---
-[PATH] main ^| Opus 🌕 42% 1.1×pace(8:30am–1:30pm)
+[PATH] main ^| Opus 🌕 42% 1.1×(8:30am–1:30pm)
diff --git a/tests/snapshots/integration__integration_tests__statusline__rate_limit_7d_with_day_and_time.snap b/tests/snapshots/integration__integration_tests__statusline__rate_limit_7d_with_day_and_time.snap
index 528c3188c..16c4c8d92 100644
--- a/tests/snapshots/integration__integration_tests__statusline__rate_limit_7d_with_day_and_time.snap
+++ b/tests/snapshots/integration__integration_tests__statusline__rate_limit_7d_with_day_and_time.snap
@@ -2,4 +2,4 @@
source: tests/integration_tests/statusline.rs
expression: out
---
-[PATH] main ^| Opus 🌕 42% 1.9×pace(Mon–Mon 3pm)
+[PATH] main ^| Opus 🌕 42% 1.9×(Mon–Mon 3pm)
diff --git a/tests/snapshots/integration__integration_tests__statusline__rate_limit_both_picks_worse.snap b/tests/snapshots/integration__integration_tests__statusline__rate_limit_both_picks_worse.snap
index 528c3188c..16c4c8d92 100644
--- a/tests/snapshots/integration__integration_tests__statusline__rate_limit_both_picks_worse.snap
+++ b/tests/snapshots/integration__integration_tests__statusline__rate_limit_both_picks_worse.snap
@@ -2,4 +2,4 @@
source: tests/integration_tests/statusline.rs
expression: out
---
-[PATH] main ^| Opus 🌕 42% 1.9×pace(Mon–Mon 3pm)
+[PATH] main ^| Opus 🌕 42% 1.9×(Mon–Mon 3pm)
diff --git a/tests/snapshots/integration__integration_tests__statusline__rate_limit_with_dirty_worktree_and_context.snap b/tests/snapshots/integration__integration_tests__statusline__rate_limit_with_dirty_worktree_and_context.snap
index d7a3dc87c..eda52cc7f 100644
--- a/tests/snapshots/integration__integration_tests__statusline__rate_limit_with_dirty_worktree_and_context.snap
+++ b/tests/snapshots/integration__integration_tests__statusline__rate_limit_with_dirty_worktree_and_context.snap
@@ -2,4 +2,4 @@
source: tests/integration_tests/statusline.rs
expression: out
---
-[PATH] main ?^| @+1 Opus 🌒 95% 1.3×pace(10am–3pm)
+[PATH] main ?^| @+1 Opus 🌒 95% 1.3×(10am–3pm)