Skip to content

fix(init): skip hook injection for uninstalled tools#134

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
jeff-r2026:fix/hooks-tool-detection
Jul 3, 2026
Merged

fix(init): skip hook injection for uninstalled tools#134
jeff-r2026 merged 1 commit into
Tencent:mainfrom
jeff-r2026:fix/hooks-tool-detection

Conversation

@jeff-r2026

Copy link
Copy Markdown
Collaborator

Summary

  • injectHooksToAllTools and reconcileHooksToAllTools now check whether the tool's root directory exists before writing hooks
  • Prevents creating .claude-internal, .tclaude, .tcodex, .codex-internal etc. for tools the user hasn't installed
  • Aligns hook injection behavior with pull.ts which already uses isToolInstalled checks for skills/rules/agents

Test plan

  • Unit test: mock pathExists to return false → tool skipped
  • E2E test: only pre-created tool dirs receive hooks, others untouched
  • hooks-reconcile-scope tests updated and passing
  • Full test suite passes (1554 tests, excluding pre-existing import-* failures on main)

🤖 Generated with Claude Code

injectHooksToAllTools and reconcileHooksToAllTools now check whether
the tool's root directory exists before writing hooks, preventing
creation of .claude-internal, .tclaude, .tcodex etc. directories
for tools the user hasn't installed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jeff-r2026 jeff-r2026 merged commit 013a2b1 into Tencent:main Jul 3, 2026
7 checks passed
@hsuchifeng hsuchifeng mentioned this pull request Jul 3, 2026
3 tasks
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