What
New-screen rows already show the git branch (src/core/git.ts readGitBranch, zero-spawn). It'd be nice to also show an uncommitted-changes indicator (e.g. ±3) — but only for the currently highlighted row, so we never shell out to git for every row on the hot scan path.
Why lazy / highlighted-only
CLAUDE.md calls this out explicitly: don't spawn git per row on the scan path; "a future lazy dirty-count for the highlighted row only is the sole allowed exception." So this is the sanctioned way to add it.
Pointers
src/core/git.ts — add a small countDirty(dir): Promise<number> that runs git status --porcelain once for a single dir (this is the one allowed spawn).
src/cli/screens/NewScreen.tsx — fetch the count for the highlighted dir only (debounced on cursor move), render it next to the branch (e.g. ⎇ main ±3).
- Add a unit test for parsing
git status --porcelain output → count.
Acceptance
- Highlighted row shows
±N when the repo has uncommitted changes; nothing for clean repos.
- No extra git spawns for non-highlighted rows.
- Test covers the porcelain-count parser.
What
New-screen rows already show the git branch (
src/core/git.tsreadGitBranch, zero-spawn). It'd be nice to also show an uncommitted-changes indicator (e.g.±3) — but only for the currently highlighted row, so we never shell out to git for every row on the hot scan path.Why lazy / highlighted-only
CLAUDE.mdcalls this out explicitly: don't spawngitper row on the scan path; "a future lazy dirty-count for the highlighted row only is the sole allowed exception." So this is the sanctioned way to add it.Pointers
src/core/git.ts— add a smallcountDirty(dir): Promise<number>that runsgit status --porcelainonce for a single dir (this is the one allowed spawn).src/cli/screens/NewScreen.tsx— fetch the count for the highlighted dir only (debounced on cursor move), render it next to the branch (e.g.⎇ main ±3).git status --porcelainoutput → count.Acceptance
±Nwhen the repo has uncommitted changes; nothing for clean repos.