Skip to content

Keep ccstatusline's git cache until HEAD or the index changes, plus ADR 0061 - #67

Merged
technicalpickles merged 4 commits into
mainfrom
ccstatusline-git-cache-ttl
Oct 16, 2026
Merged

technicalpickles merged 4 commits into
mainfrom
ccstatusline-git-cache-ttl

Conversation

@technicalpickles

@technicalpickles technicalpickles commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Sets ccstatusline's gitCacheTtlSeconds to 0, which keeps its cached git results valid until .git/HEAD or .git/index changes. The default of 5 reruns four git processes every 5 seconds per session even when nothing changed, and two of them stat the whole worktree (ccstatusline forces fsmonitor off).
  • Adds ADR 0061, which writes up the whole statusline thread: what one refresh actually costs, why pinning didn't help, the mise install + shim from Run ccstatusline from a mise install instead of npx #66, this cache change, and the Rust statuslines I benchmarked and passed on for now.

Tradeoff

An unstaged edit doesn't show up in the +/- counts until something rewrites the index. A plain git status, diff, or add does; tools running with --no-optional-locks don't. I barely look at those counts, so a little stale beats paying for it on every refresh.

Rollout

config/ccstatusline/settings.json is a hand-copied twin of ~/.config/ccstatusline/settings.json, not a symlink, so copy it over (already done on this machine).

🤖 Generated with Claude Code

technicalpickles and others added 4 commits October 16, 2026 14:24
With the default gitCacheTtlSeconds of 5, every refresh in every session
re-runs four git processes (two of them full worktree stats, since
ccstatusline forces fsmonitor off) every 5 seconds, even when nothing
changed. A TTL of 0 means the cached result stays valid until
.git/HEAD or .git/index changes.

Tradeoff: an unstaged edit doesn't show in the +/- counts until
something rewrites the index (a plain git status/diff/add does).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers the pin, the mise install + shim (#66), and the HEAD/index-keyed
git cache, with the per-refresh breakdown and the Rust statusline
benchmarks that were considered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@technicalpickles technicalpickles changed the title Only rerun ccstatusline's git calls when HEAD or the index changes Keep ccstatusline's git cache until HEAD or the index changes, plus ADR 0061 Oct 16, 2026
@technicalpickles
technicalpickles merged commit d6e0e35 into main Oct 16, 2026
1 check passed
@technicalpickles
technicalpickles deleted the ccstatusline-git-cache-ttl branch October 16, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant