Skip to content

fix(hooks): simplify project-scope injection and dispatch config - #272

Merged
jeff-r2026 merged 2 commits into
mainfrom
worktree-issue-264-simplify-hooks
Jul 31, 2026
Merged

fix(hooks): simplify project-scope injection and dispatch config#272
jeff-r2026 merged 2 commits into
mainfrom
worktree-issue-264-simplify-hooks

Conversation

@jeff-r2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #264.

  • dispatch cwd detection: hook-dispatch-cli now calls detectProjectConfig(stdin.cwd) before falling back to loadLocalConfig(), so filterHandlersForConfig can honour a project-level repo.kind (e.g. suppressing gitOnly handlers for HTTP-only projects)
  • remove redundant projectRoot writes: resolveHookScopeTargets no longer duplicates hook entries into <projectRoot>/.claude/settings.json — HOME already covers every cwd
  • legacy cleanup: hooksRemove still cleans up old projectRoot entries left by previous versions

pull.ts is intentionally unchanged — its per-scope reconcile uses separate manifests and baseDirs, which is correct for the different teamDefs each scope may have.

Test plan

🤖 Generated with Claude Code

jeff-r2026 and others added 2 commits July 31, 2026 17:33
Two changes:
1. hook-dispatch-cli now prefers detectProjectConfig(stdin.cwd) over
   the hardcoded loadLocalConfig(), so filterHandlersForConfig honours
   project-level repo.kind (e.g. suppressing gitOnly handlers for HTTP
   projects).
2. resolveHookScopeTargets no longer writes a redundant copy of hook
   entries into <projectRoot>/.claude/settings.json — HOME already
   covers every cwd. hooksRemove still cleans up legacy projectRoot
   entries left by older versions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Align the #85 E2E assertions with the new behaviour: project-scope
inject now writes only to HOME, and the redundant projectRoot copy is
no longer created.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jeff-r2026
jeff-r2026 merged commit 2843f9c into main Jul 31, 2026
7 checks passed
@jeff-r2026
jeff-r2026 deleted the worktree-issue-264-simplify-hooks branch July 31, 2026 11:55
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.

简化 hooks 下发:project scope 无需两边写 settings.json,dispatch 应按 cwd 识别项目

1 participant