dotfiles/claude
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jonny Barnes 35e170b40c
Back off after a failed usage fetch instead of retrying every redraw
A failed fetch left the cache mtime untouched, so with no network every
redraw — and a redraw happens on every keystroke — tried curl again and
could wait --max-time 10 for it. Cutting the TTL from an hour to five
minutes made that start 55 minutes sooner, so it is worth fixing now.

The marker is a separate file rather than a touch of the cached
response: a cold /tmp has no response to touch, and that is exactly the
case with no stale data to fall back on, where the timeout is paid in
full with nothing to show for it.

It goes down before the request and is cleared when that lands, not
written afterwards. A fetch is in flight for as long as curl takes to
give up, and this cache dir is shared by every session, so redraws
starting inside that window are real rather than hypothetical: they now
serve stale data instead of each launching their own doomed request.
Every attempt writes it, so a repeated failure restarts the backoff, and
only an attempt does, so the redraws it suppresses cannot keep
re-stamping it and it always lapses.

Missing credentials stays outside the backoff — it costs no timeout, and
the redraw after a login should show the bars rather than wait out a
retry window it had no part in earning.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 13:22:52 +01:00
..
tests Back off after a failed usage fetch instead of retrying every redraw 2026-09-02 13:22:52 +01:00
statusline.burnrate.sh Fix Opus statusline hue rendering as black in light theme 2026-08-04 17:35:33 +01:00
statusline.isaacaudet.sh Back off after a failed usage fetch instead of retrying every redraw 2026-09-02 13:22:52 +01:00
statusline.original.sh Switch Claude Code statusline to burnrate variant 2026-08-03 14:40:40 +01:00