fix(init): skip hook injection for uninstalled tools#133
Closed
jeff-r2026 wants to merge 7 commits into
Closed
Conversation
Show user and project scope storage paths (e.g. ~/.teamai/, $PWD/.teamai/) before the scope selection prompt so users know where data will be stored. Closes Tencent#7
…ope-paths feat(init): display storage paths when prompting for scope
Resolves Tencent#6. Instead of spawning N separate `teamai <subcommand>` processes per Claude Code hook event, introduce a unified `teamai hook-dispatch <event>` command that reads STDIN once and fans out to all handlers internally. Key changes: - New dispatcher core (hook-dispatch.ts) with routing, isolation via Promise.allSettled, per-handler timeout, and output merging - Handler registry (hook-handlers.ts) wrapping existing subcommand logic - hooks.ts now emits 9 merged dispatch entries instead of 13 individual ones - Legacy hooks are auto-cleaned on next `teamai hooks inject` - Backward compatible: standalone subcommands (pull, track, etc.) unchanged Performance: lightweight events (prompt-submit) drop from ~1040ms to ~220ms by eliminating redundant Node.js cold starts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…format The E2E test file still expected the old 13-hook format. Updated to match the new 9-entry dispatch format (1 per event+matcher instead of N per event). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: merge multiple hooks per event into single hook-dispatch process
feat: auto-migrate hooks to dispatch format on first session after update
injectHooksToAllTools now checks 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>
Collaborator
Author
|
Closing in favor of a clean PR with a single commit (no merge history noise). |
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.
Summary
injectHooksToAllToolsnow checks whether the tool's root directory exists before writing hooks.claude-internal,.tclaude,.tcodex,.codex-internaletc. for tools the user hasn't installedpull.tswhich already usesisToolInstalledchecksTest plan
pathExiststo return false → tool skipped.claude→ only.claude/settings.jsonwritten🤖 Generated with Claude Code