Skip to content

feat(claude-code): vendor adapter into projects with global-first fallback - #2

Open
1337hero wants to merge 1 commit into
mainfrom
feat/scaffold-update
Open

feat(claude-code): vendor adapter into projects with global-first fallback#2
1337hero wants to merge 1 commit into
mainfrom
feat/scaffold-update

Conversation

@1337hero

Copy link
Copy Markdown
Owner

What

Makes the Claude Code adapter travel with each project instead of living only in the machine-global install:

  • adapters/claude-code/guard.js joins the engine file list, so init/update vendor it at .scaffold/adapters/claude-code/guard.js and keep it current.
  • init/update merge 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 ran scaffold setup; everywhere else the repo is self-sufficient and collaborators get the rails after Claude Code's one-time trust prompt.
  • The global Stop hook now prefers the project's vendored guard over the canonical checkout, falling back for repos that predate vendoring. Fixes sessions running whatever guard happens to be in the dev checkout rather than the one the repo shipped.
  • Drops the legacy-adapters warning and the template settings.json variant (the CLI generates project settings now).

Verified

  • scaffold init in a scratch repo: guard vendored, settings generated, hooks fire BOOT injection without a global install and stay silent with one.
  • Stop guard blocks on a dirty-main scratch repo via stdin hook JSON.
  • scaffold update is idempotent and preserves foreign hooks/permissions in an existing project settings.json.
  • Deployed to CISS PR #222.

…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant