[BUG] Claude Code sends desktop notification in the Kitty terminal even if I've focused on the terminal window
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?
Claude Code sends desktop notification in the Kitty terminal even if I've focused on the terminal window. This is distracting -- if I'm already looking at the terminal, I don't need a notification. Please note, the notification settings explicitly mentions Kitty, and hence the bug report and proposed fix that addresses Kitty specifically.
What Should Happen?
Claude should not notify when the terminal window is focused.
Error Messages/Logs
Steps to Reproduce
Run Claude in Kitty and focus on the Kitty terminal window. Construct any scenario that Claude sends a notification, like wait on the prompt line for a while.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.92
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
There's a super easy fix.
Add o=unfocused to the Kitty OSC 99 metadata. This is a one-line change in the escape sequence:
Before: \033]99;i=<id>:d=0:p=title;...\033\\
After: \033]99;i=<id>:d=0:p=title:o=unfocused;...\033\\
Kitty will then suppress the notification when the terminal window has keyboard focus. The o key accepts always, unfocused, or invisible, documented in the Kitty desktop notifications protocol.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗