Skip to content

🔇 fix: remove PreToolUse hook to reduce noise#65

Merged
vaayne merged 1 commit intomainfrom
remove-pretooluse-hook
Apr 13, 2026
Merged

🔇 fix: remove PreToolUse hook to reduce noise#65
vaayne merged 1 commit intomainfrom
remove-pretooluse-hook

Conversation

@vaayne
Copy link
Copy Markdown
Owner

@vaayne vaayne commented Apr 13, 2026

Summary

Remove PreToolUse hook event from all agent hooks. It fires on every tool invocation, causing excessive state transitions and noise. UserPromptSubmit alone is sufficient to signal the working state.

Changes

  • Hook scripts: Removed PreToolUse from case statements in mori-agent-hook.sh, mori-codex-hook.sh, mori-droid-hook.sh
  • AgentHookConfigurator.swift: Removed PreToolUse from Claude and Droid event registrations
  • Docs: Updated agent-hooks.md and agent-hooks.zh-Hans.md to reflect the change

PreToolUse fires on every tool invocation, causing excessive state
transitions. UserPromptSubmit alone is sufficient to signal working state.

Removed from all agent hooks (Claude, Codex, Droid), event registrations,
and documentation.

Amp-Thread-ID: https://ampcode.com/threads/T-019d876e-953d-74ae-aaa4-0d6842e143a6
Co-authored-by: Amp <amp@ampcode.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c206bf970

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +19 to +22
private static let claudeEvents = ["UserPromptSubmit", "Stop", "Notification"]

/// Droid hook event names (same lifecycle events as Claude Code).
private static let droidEvents = ["UserPromptSubmit", "PreToolUse", "Stop", "Notification"]
private static let droidEvents = ["UserPromptSubmit", "Stop", "Notification"]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep removing legacy PreToolUse hooks during migration

Because claudeEvents/droidEvents drive both install and uninstall loops, dropping PreToolUse here means existing users who already have that hook registered will never be cleaned up. After upgrade, reinstalling still leaves the old PreToolUse entry active (so the noisy callback continues), and uninstalling deletes the script file but leaves a dangling PreToolUse command in ~/.claude/settings.json/~/.factory/settings.json, which can trigger hook execution errors on future tool invocations.

Useful? React with 👍 / 👎.

@vaayne vaayne merged commit 30dca6a into main Apr 13, 2026
5 checks passed
@vaayne vaayne deleted the remove-pretooluse-hook branch April 13, 2026 15:34
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