[BUG] Screen flickers on every keystroke after resuming session with PostToolUse hooks
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Screen flickers on every keystroke after resuming session with PostToolUse hooks
Environment
- Claude Code version: 2.1.11
- OS: macOS 15.7.1 (Build 24G231)
- Terminal: Default macOS Terminal
Description
After using /exit to end a session and then resuming it with /resume (or claude --resume), the screen flickers on every keystroke typed in the input dialog. This makes the CLI unusable until a fresh session is started.
Steps to Reproduce
- Start Claude Code in a project with
PostToolUsehooks configured:
``json``
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/detect-code-change.sh",
"timeout": 10
}
]
}
]
}
}
- Perform some operations that trigger the hooks (e.g., have Claude edit a file)
- Exit the session with
/exit
- Resume the session with
claude --resumeor/resume
- Start typing a message - observe screen flickering on every keystroke
Expected Behavior
Typing in the input dialog should be smooth without any screen flickering.
Actual Behavior
- Screen flickers/redraws on every single keystroke
- The "Running PostToolUse hook…" messages appear in the replayed history
- The CLI becomes very difficult to use due to the constant flickering
Investigation Done
- Tested with hooks disabled: Flickering still occurs after resume, even when hooks are removed from settings.json
- Checked for stale processes: No orphaned hook processes running
- Cleaned stale IDE lock files: Found and removed 6 stale lock files in
~/.claude/ide/, but issue persists
Workaround
Start a fresh session instead of using /resume.
Additional Context
The issue appears to be related to session resume functionality rather than the hooks themselves, since disabling hooks does not fix the problem. The hooks only correlate with the issue because they were triggered during the original session.
What Should Happen?
Typing in the input dialog should be smooth without any screen flickering, and not every key stroke triggering a post tool use hook.
Error Messages/Logs
Steps to Reproduce
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.11
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
my post tool use hooks keep triggering, and this only happens when i resume the chat. new chats don't have this issue!
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗