capture-hooks install: add --components opt-out (SessionStart re-registration) (#26)#29
Open
danielhertz1999-bit wants to merge 1 commit into
Conversation
capture-hooks install always (re)registered all three capture hooks — Stop, UserPromptSubmit, and the SessionStart prefix/recall hook — with no way to opt out. Users who had deliberately removed the noisy SessionStart prefix injection got it silently put back on every run. Add `--components` (default `stop,turn,recall`, i.e. unchanged behavior). `--components=stop,turn` installs ambient capture without wiring the SessionStart recall hook; an excluded component's template copy and settings.json registration are both skipped. Unknown names are rejected with a clear error (exit 2). Factored the per-hook template-copy / command-string into local helpers to keep the three component blocks parallel. status/uninstall already report and remove each hook independently, so no change needed there. Addresses the second half of CodeAbra#26 (reported by @Marsu6996). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.
Addresses the second half of #26.
The problem
capture-hooks installalways (re)registers all three capture hooks —Stop,UserPromptSubmit, and theSessionStartrecall/prefix hook — and there's no way to opt out. A user who had deliberately removed theSessionStartprefix injection (too noisy at every startup/resume/clear/compact) but keptStop+UserPromptSubmitcapture got theSessionStartentry silently put back on the nextinstall, with no--forceto gate it and no flag to skip it.The change
Add a
--componentsflag tocapture-hooks install:stop,turn,recall— identical to today's behavior, so existing installs are unaffected.--components=stop,turn— installs ambient capture without wiring theSessionStartrecall hook. An excluded component's template copy and itssettings.jsonregistration are both skipped.statusanduninstallalready report/remove each hook independently, so no change was needed there. Refactored the repeated template-copy / command-string construction into small local helpers so the three component blocks read in parallel.Verification
Ran the installer against a redirected temp
$HOME:--components=stop,turn→settings.jsonhasStop+UserPromptSubmit, noSessionStart.--components=stop,bogus→ exits 2 withunknown capture component(s): bogus.Note
This doesn't try to auto-detect "deliberately removed" (which isn't reliably distinguishable from "never installed" without a stamped marker) — it gives the explicit opt-out you suggested instead. Pairs with #28 (the in-wheel-wrapper resolution fix) to close out #26.
🤖 Generated with Claude Code