Skip to content
lntosiPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

dotfiles

Personal configuration files for reproducible setup across machines.

claude/

Custom statusline for Claude Code.

Fields

  • cwd — current working directory ($HOME collapsed to ~).
  • git branch — current branch of the repo containing cwd, in magenta (⎇ main); a detached HEAD shows the short commit SHA. Read locally with git, no network call. Outside a repo (or without git installed) 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 shows MAX in red. Durations under an hour drop the hour (35m). Falls back to — until the payload includes rate_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). Same MAX indicator 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 ● other with a dim other — 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 background curl, so the segment never blocks the statusline. Without curl it 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).

Install

On any machine where Claude Code is installed:

git clone git@github.com:lntosi/dotfiles.git ~/dotfiles
~/dotfiles/claude/install.sh

Requirements

  • bash (macOS / Linux default). On Windows, run the installer from Git Bash: it writes the full path of Git for Windows' bin/bash.exe into settings.json, because a bare bash there 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 the statusLine command)
  • jq — install with brew install jq (macOS), apt install jq (Debian/Ubuntu) or winget install jqlang.jq (Windows — then close all terminals and restart Claude Code; until then the statusline shows jq not found)
  • curl (optional) — only for the service-status segment; absent it falls back to a neutral dot

Toggle

  • Disable in current shell: export CLAUDE_STATUSLINE_OFF=1
  • Re-enable: unset CLAUDE_STATUSLINE_OFF
  • Disable permanently: add the export to ~/.zshrc / ~/.bashrc

What the installer does

  1. Copies claude/statusline.sh to ~/.claude/statusline.sh
  2. Backs up existing ~/.claude/settings.json (timestamped)
  3. Merges the statusLine field into settings.json via jq — your other settings stay intact. The merged config sets refreshInterval: 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
  4. 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.json and in statusline.sh) before touching anything.
  • Prompts for confirmation only when there's real risk: an existing customized statusLine would be replaced, or the installed statusline.sh differs 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. Set CLAUDE_STATUSLINE_FORCE=1 to skip prompts in automation.
  • Timestamped backup (settings.json.bak-<ts>) is kept as a final safety net.

Uninstall

# 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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages