feat(init): never clobber a user-defined statusline (#191) - #199
feat(init): never clobber a user-defined statusline (#191)#199Frankie-Xu wants to merge 1 commit into
Conversation
A foreign Claude Code statusLine is kept, Graft's own helper is refreshed by path, and --no-statusline / GRAFT_NO_STATUSLINE skip installing one so a user-level bar is not hidden. Co-authored-by: Cursor <cursoragent@cursor.com>
91d8a14 to
178dbb6
Compare
|
Rebased onto current
|
🌱 graft blast radiusNothing outside this diff depends on it. 2 areas changed; no indexed dependents at depth 2. Test signal per changed area — 1 ✓ · 1 ✗Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
Summary
graft initno longer hides a custom Claude Code statusline. A project-levelstatusLinethat is not Graft's is left untouched (this was already true);--no-statusline/GRAFT_NO_STATUSLINE=1skip installing one at all, so a bar in~/.claude/settings.jsonstays visible.graft-statusline.cjs(not a full-command string match) and will refresh that command on re-init. The choice is recorded in the wiring stamp, so a later session refresh cannot put Graft's bar back.Closes #191
What was actually happening
Merge already kept a project-level foreign
statusLine. The override people hit is:~/.claude/settings.json).graft initwrites a projectstatusLinebecause.claude/settings.jsonhas none.--no-statuslineis the opt-out (same shape asGRAFT_NO_GITIGNORE/--no-global): default install is unchanged for anyone who does not already have a custom bar.Why not "append as a new line"
Claude Code has one
statusLinecommand per session (the merge warning already said this). Graft's helper already prints multiple lines from that one command (renderStatusline(…).join('\n')). Combining two independent commands would need a wrapper that tees stdin JSON (consumed once) and merges timeouts — too fragile to do by default. To show both, pointstatusLineat a small wrapper that runs your command then.claude/helpers/graft-statusline.cjs.Behavior matrix
statusLinegraft initgraft-statusline.cjsin the command, even an old path)--no-statusline/GRAFT_NO_STATUSLINE=1--no-statuslineHooks, skill, MCP, and the statusline shim file are still installed. Only the
statusLine/subagentStatusLinefields are skipped.Test plan
npm run build && npm test— 891 passingnode --import tsx --test test/claude-settings-merge.test.ts test/claude-init.test.ts test/upkeep.test.tsstatusLinepreserved--no-statusline/GRAFT_NO_STATUSLINE=1skip install--no-statuslinegraft init --no-agents --no-statuslinein a repo whose~/.claude/settings.jsonhas a custom bar; project settings have nostatusLine; Claude Code still shows the custom bar after restartMade with Cursor