[BUG] IDE context indicator ("In <filename>") never clears after deselecting text or closing the file
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?
When Claude Code is connected to a JetBrains IDE, the prompt input shows an
"In <filename>" context indicator for the file currently open in the IDE.
That indicator never goes away. Dismissing the text selection does not clear it,
and closing the file does not clear it either. Focusing a different file only
replaces the name — there is no state in which the indicator disappears.
Observed from inside the session: only "opened file" notifications are delivered
to the assistant. No file-closed or selection-cleared event ever arrives, which
suggests the event is either not sent by the plugin or not handled on the
Claude Code side.
What Should Happen?
The indicator should clear when the text selection is dismissed, and again when
the file is closed — leaving the prompt input with no file context attached.
Error Messages/Logs
Steps to Reproduce
- Connect Claude Code to IntelliJ IDEA with /ide
- Open any file in the IDE — the prompt input shows "In <filename>"
- Select some text, then click elsewhere to dismiss the selection
-> indicator still shows the file
- Close the file entirely
-> indicator still shows the file
- Open a different file
-> indicator is replaced with the new filename, never cleared
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.270
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
_No response_