feat(install): one-command setup — auto-wire inject hook + self-heal - #7
Merged
Conversation
`install-push-hook.sh setup` now installs the push hook AND idempotently merges two entries into the consumer's .claude/settings.json: - PreToolUse -> inject-readme-context.mjs (progressive-disclosure context) - SessionStart -> re-install the push hook each session (self-healing) Paths are computed relative to the git root (works wherever the tool is vendored), the merge never clobbers existing hooks, and it's idempotent. install is now non-fatal inside setup so the inject hook still wires even if a foreign pre-push blocks the push-hook install. Resolve script-dir + git-root to physical paths so symlinked checkouts don't break the relative-path computation. Dogfood: wire this repo's own settings.json. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Makes adoption one step:
install-push-hook.sh setupinstalls the push hook and idempotently wires.claude/settings.json:PreToolUse→inject-readme-context.mjs(the progressive-disclosure context injection — per-dir READMEs fed into Claude when it reads/edits a file)SessionStart→ re-install the push hook each session (self-healing, since the installed git hook is untracked)Details:
tools/…).installis non-fatal insidesetupso the inject hook still wires even if a foreignpre-pushblocks the push-hook install./tmp) don't corrupt the relative path..claude/settings.json.README updated with the one-command path + an accurate mid-session activation note (the PreToolUse hook goes live immediately via Claude Code's settings file-watcher; only SessionStart waits for the next session).
🤖 Generated with Claude Code