[BUG] Grep tool causes "hook execution cancelled" errors that make Claude Code unusable
Status Fixed / completed
Maintainer reply ✓ Yes — dicksontsai
Workaround ✓ Mentioned in thread ↓
Activity 13 comments · opened Aug 23, 2025 · closed Aug 24, 2025
💡 Likely answer: A maintainer (dicksontsai, collaborator)
responded on this thread — see the highlighted reply below.
Environment
- Platform (select one):
- [x] Other: Claude Code CLI
- Claude CLI version: 1.0.89 (Claude Code)
- Operating System: macOS 15.6.1 (24G90)
- Terminal: Terminal App (or iTerm2 - specify which you use)
## Bug Description
PostToolUse:Grep hook execution consistently gets cancelled, displaying "PostToolUse:Grep hook execution cancelled" error messages that interrupt and stop Claude sessions, making Claude Code unusable.
## Steps to Reproduce
- Start a Claude Code session
- Ask Claude to search for anything using the Grep tool
- Observe "PostToolUse:Grep hook execution cancelled" error appears
- Claude session gets interrupted/stopped
## Expected Behavior
Grep tool should execute successfully without hook cancellation errors, and Claude session should continue normally.
## Actual Behavior
- "PostToolUse:Grep hook execution cancelled" error appears consistently
- Error interrupts the Claude session
- Makes Claude Code effectively unusable for any tasks requiring search functionality
## Additional Context
- Issue persists even with completely disabled hooks (
"hooks": {}) - Reinstalling Claude Code does not resolve the issue
- Multiple Claude processes were initially running, but killing all processes and clearing cache didn't fix it
- Error appears to be a PostToolUse event handling bug rather than user configuration issue
Immediate workaround
- Instruct Claude to use
rg(ripgrep) via the Bash tool for all file searches instead of the Grep tool
<img width="600" height="380" alt="Image" src="https://github.com/user-attachments/assets/9b4e2265-ff6e-4741-bd64-00bacab7c738" />
13 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I'm experiencing this issue too. Yesterday suddenly Claude Code consistently fails to do anything as it constantly tries to call Grep then cancels itself
Yeah, right now I'm also facing this issue after using the claude code for some time.
I am also getting this issue.
I am also getting this issue too
I am also getting this issue too.
window 11.24h2 26100.4946
Claude Code v1.0.89 opus (claude-opus-4-1-20250805)
same issue
<img width="322" height="43" alt="Image" src="https://github.com/user-attachments/assets/01344862-198b-4dea-949e-1c2ea44f1b5c" />
I'm also getting this issue
Same issue started happening within the last day or so.
<img width="801" height="493" alt="Image" src="https://github.com/user-attachments/assets/697a9e9e-0e1f-43fe-82ba-1ee2ee37911d" />
I asked Claude to find a workaround to this issue.
If you ask Claude to search using the Task Tool, it it will work.
<img width="588" height="236" alt="Image" src="https://github.com/user-attachments/assets/8ee56095-5014-48ad-898d-4fd2f9103970" />
The hook system message is mis-triggering due to a cancellation in the Grep tool call itself. The Search tool itself is cancelling due to a stricter timeout. We are looking into this issue.
v1.0.90 (just released) should fix this issue.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.