Personal configuration files for reproducible setup across machines.
Custom statusline for Claude Code.
- cwd — current working directory (
$HOMEcollapsed to~). - git branch — current branch of the repo containing
cwd, in magenta (⎇ main); a detached HEAD shows the short commit SHA. Read locally withgit, no network call. Outside a repo (or withoutgitinstalled) the segment and its separator are omitted entirely. - model — active model's
display_name, shown in cyan. - ctx — 10-cell progress bar + percentage of the context window used; green <50%, yellow <80%, red ≥80%.
- 5h — percent consumed of the 5-hour rate-limit window and time until reset (
40% → 2h9m). When the window's average rate so far would exhaust the quota before the reset, a projection appears:83% ⚠ out in 35m → reset 2h9m— at this pace you run out in 35 minutes, while the window only renews in 2h9m. Yellow when that's an hour or more away, red under an hour; no warning means you're on track to last until the reset. The warning only fires once usage is at least 5 points ahead of the elapsed share of the window, so a burst in the first minutes doesn't raise a false alarm. Because the percentage is account-level, it already includes tokens burned by parallel subagents and other sessions — the projection is the early warning that a multi-agent run is eating the quota faster than the window replenishes. When the quota is exhausted (≥100%), the segment showsMAXin red. Durations under an hour drop the hour (35m). Falls back to—until the payload includesrate_limits.five_hour(requires a Pro/Max subscription). - 7d — percent consumed of the 7-day rate-limit window and the day + local time of the next reset (
46% → Thu 18:53). SameMAXindicator when the quota is hit. Falls back to—when absent. - service status — Claude health from status.claude.com, judged by what affects Claude Code: green
●when all is well,⚠ minor(yellow) /⚠ major/⚠ critical(red) when the Claude API or Claude Code components are degraded, when an open incident names them, or when an open incident names no component at all (Anthropic sometimes files model-wide outages that way, so those always count).⚙ maint(cyan) during maintenance. Incidents confined to other services (claude.ai, Console, Cowork) show as● otherwith a dimother— visible, but not an alarm; worth a look if something feels off (e.g. a claude.ai login incident can affect subscription logins). The result is cached for 5 minutes and revalidated by a detached backgroundcurl, so the segment never blocks the statusline. Withoutcurlit falls back to the neutral green dot. Reflects Anthropic's published status only — not the selected model or your local session. - ⏱ — cumulative duration of the current session (
Xh Ym).
On any machine where Claude Code is installed:
git clone git@github.com:lntosi/dotfiles.git ~/dotfiles
~/dotfiles/claude/install.shbash(macOS / Linux default). On Windows, run the installer from Git Bash: it writes the full path of Git for Windows'bin/bash.exeintosettings.json, because a barebashthere usually resolves to the WSL launcher (C:\Windows\System32\bash.exe) and the statusline never renders. Re-running the installer fixes an older install (it asks before replacing thestatusLinecommand)jq— install withbrew install jq(macOS),apt install jq(Debian/Ubuntu) orwinget install jqlang.jq(Windows — then close all terminals and restart Claude Code; until then the statusline showsjq not found)curl(optional) — only for the service-status segment; absent it falls back to a neutral dot
- Disable in current shell:
export CLAUDE_STATUSLINE_OFF=1 - Re-enable:
unset CLAUDE_STATUSLINE_OFF - Disable permanently: add the export to
~/.zshrc/~/.bashrc
- Copies
claude/statusline.shto~/.claude/statusline.sh - Backs up existing
~/.claude/settings.json(timestamped) - Merges the
statusLinefield intosettings.jsonviajq— your other settings stay intact. The merged config setsrefreshInterval: 30, so the line also re-renders every 30 seconds while the session idles (e.g. during long multi-agent runs) instead of only after each interaction - Runs a smoke test so you see the output immediately
The installer is transparent and safe-by-default:
- Always shows a unified diff of what will change (both in
settings.jsonand instatusline.sh) before touching anything. - Prompts for confirmation only when there's real risk: an existing customized
statusLinewould be replaced, or the installedstatusline.shdiffers from the source. Fresh installs and identical re-runs are silent no-ops. - Non-interactive shells (e.g.
curl … | bash) abort with a clear error when a conflict is detected. SetCLAUDE_STATUSLINE_FORCE=1to skip prompts in automation. - Timestamped backup (
settings.json.bak-<ts>) is kept as a final safety net.
# Remove the statusLine entry from ~/.claude/settings.json (keeping the rest)
jq 'del(.statusLine)' ~/.claude/settings.json > /tmp/s && mv /tmp/s ~/.claude/settings.json
rm ~/.claude/statusline.sh