feat: hook-managed status line install (opt-in flag, self-healing) + 0.11.0#5
Merged
Merged
Conversation
- SessionStart hook wires .claude/settings.local.json to the current plugin version's statusline.mjs when statusline.enabled=true in projectstore.json — re-derived each start, so the path self-heals across plugin updates - /projectstore:statusline on|off|status simplified to flip the flag (no more LLM path resolution, no version-baked path to maintain by hand) - syncStatusLine() in lib.mjs: idempotent, never clobbers a foreign statusLine (marker tightened to "scripts/statusline.mjs"), bails on unparseable settings, removes only our own entry on disable - README + roadmap updated; bump plugin + marketplace to 0.11.0 Maintainer: ekonev@smartandpoint.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Simplifies how the v0.10 status line gets installed. Instead of an LLM-driven command resolving paths and writing
settings.local.json, enabling is now a one-flag opt-in and the SessionStart hook does the wiring — and keeps it correct across plugin updates.Why
The old
/projectstore:statusline onwas chatty (the command reasoned through path resolution because$CLAUDE_PLUGIN_ROOTisn't available to command bash) and baked a version-specific absolute path (…/0.10.0/scripts/statusline.mjs) that silently breaks on the next plugin update. The hook has$CLAUDE_PLUGIN_ROOTand self-locates, so it re-derives the current path every session start.Changes
scripts/lib.mjs— newsyncStatusLine(cfg, projectDir): whenprojectstore.json→statusline.enabled=true, writes/refreshes.claude/settings.local.json→statusLinetonode "<current-plugin>/scripts/statusline.mjs". Idempotent (writes only on change); never clobbers a foreign status line; bails on unparseable settings; removes only our own entry on disable; returns a status string, never throws.hooks/session-start.mjs— callssyncStatusLine(guarded) after the config guard.commands/statusline.md—on|off|statusnow only flipsstatusline.enabledinprojectstore.json(approval-gated); warns on a foreign local status line. The hook ownssettings.local.json.scripts/statusline.mjs— "ours" marker tightenedstatusline.mjs→scripts/statusline.mjs(don't skip/clobber a foreign script that merely ends instatusline.mjs).0.10.0→0.11.0.Review & tests
projectstore:code-reviewerverdict commit; both 🟡 findings fixed (broad sentinel →scripts/statusline.mjs; conservative foreign guard for command-less entries). 13/13 ad-hoc state-machine assertions pass (create / stale-rewrite / unquoted-requote / foreign-no-clobber / preserve-keys / disable-remove / corrupt-bail / no-flag / command-less), plus confirmed it still composes over the real oh-my-claudecode HUD.Note for v0.10 status-line users: run
/projectstore:statusline ononce to adopt the managed (self-healing) wiring.Maintainer: ekonev@smartandpoint.com