Skip to content

Add rule to prefer Glob/Grep/Read over find command#101

Merged
ikuwow merged 1 commit intomainfrom
add-find-avoidance-rule
Mar 18, 2026
Merged

Add rule to prefer Glob/Grep/Read over find command#101
ikuwow merged 1 commit intomainfrom
add-find-avoidance-rule

Conversation

@ikuwow
Copy link
Owner

@ikuwow ikuwow commented Mar 18, 2026

Summary

Add a rule to AIRULES.md instructing the AI to prefer Glob/Grep/Read tools over Bash find command, limiting find to cases where dedicated tools cannot achieve the goal (e.g., permission/timestamp filtering).

Motivation

Claude Code sometimes uses Bash(find ...) for file exploration when Glob/Grep/Read tools are more appropriate. A hook-based approach (PreToolUse with ask) was explored in #100, but the reminder only appeared to the user, not the AI. A rule-based approach is simpler and directly guides the AI's decision-making before it chooses a tool.

Closes #99

Verification

  • pre-commit hooks pass

Closes #99

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@ikuwow ikuwow marked this pull request as ready for review March 18, 2026 04:47
@ikuwow ikuwow merged commit 1e0dda1 into main Mar 18, 2026
4 checks passed
@ikuwow ikuwow deleted the add-find-avoidance-rule branch March 18, 2026 04:47
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