feat(claude-code): vendor adapter into projects with global-first fallback - #2
Open
1337hero wants to merge 1 commit into
Open
feat(claude-code): vendor adapter into projects with global-first fallback#21337hero wants to merge 1 commit into
1337hero wants to merge 1 commit into
Conversation
…lback Projects now carry their own Claude Code rails: init/update vendor adapters/claude-code/guard.js as an engine file and merge SessionStart/Stop hooks into the project's committed .claude/settings.json. Each project hook defers to a machine-global install (grep sentinel on ~/.claude/settings.json) so nothing double-fires; without one, the repo is self-sufficient for collaborators who never ran scaffold setup. The global Stop hook now prefers the project's vendored guard over the canonical checkout, so the gate a session runs is the one the repo shipped. Drops the legacy-adapters warning and the template settings.json variant (the CLI generates project settings now).
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
Makes the Claude Code adapter travel with each project instead of living only in the machine-global install:
adapters/claude-code/guard.jsjoins the engine file list, soinit/updatevendor it at.scaffold/adapters/claude-code/guard.jsand keep it current.init/updatemerge SessionStart/Stop hooks into the project's committed.claude/settings.json. Each hook defers to a machine-global install first (grep -qsF '.scaffold/BOOT.md' ~/.claude/settings.json), so nothing double-fires on machines that ranscaffold setup; everywhere else the repo is self-sufficient and collaborators get the rails after Claude Code's one-time trust prompt.settings.jsonvariant (the CLI generates project settings now).Verified
scaffold initin a scratch repo: guard vendored, settings generated, hooks fire BOOT injection without a global install and stay silent with one.scaffold updateis idempotent and preserves foreign hooks/permissions in an existing project settings.json.