Skip to content

Add PreToolUse hook to remind using Glob/Grep/Read instead of find#100

Closed
ikuwow wants to merge 1 commit intomainfrom
add-find-command-reminder-hook
Closed

Add PreToolUse hook to remind using Glob/Grep/Read instead of find#100
ikuwow wants to merge 1 commit intomainfrom
add-find-command-reminder-hook

Conversation

@ikuwow
Copy link
Owner

@ikuwow ikuwow commented Mar 18, 2026

Summary

Add a PreToolUse hook that detects find command usage in Bash tool calls and reminds the AI to consider using dedicated tools (Glob/Grep/Read) instead.

  • Uses ^find prefix match so piped find or git grep are not affected
  • Shows an ask dialog (not block), so find can still be used when truly needed

Motivation

Claude Code sometimes uses Bash(find ...) for file exploration when Glob/Grep/Read tools would be more appropriate and provide a better user experience. This hook adds a soft reminder without blocking legitimate use cases.

Closes #99

References

Verification

  • shellcheck passes on the hook script
  • pre-commit hooks pass
  • Hook behavior (find command triggering the ask dialog) has not been manually tested yet

When the find command is detected in Bash tool usage, show an ask dialog
reminding to use dedicated tools (Glob/Grep/Read) instead.

Closes #99

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@ikuwow
Copy link
Owner Author

ikuwow commented Mar 18, 2026

Closing: hook-based approach is not ideal since the AI cannot see the reminder. Will add a rule to AIRULES.md instead to prefer Glob/Grep/Read over find.

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.

Claude Code: findコマンド使用時にGlob/Grep/Readツールの使用をリマインドするPreToolUseフックを追加

1 participant