[BUG] IDE file-open events cancel pending tool permission prompts

Resolved 💬 4 comments Opened Mar 29, 2026 by OlorinMedas Closed May 1, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using Claude Code with a JetBrains IDE extension, opening or switching files in the IDE editor while tool calls are waiting for permission approval causes the pending tool calls to be cancelled. The system treats the IDE file-open context event as user terminal input, returning "User answered in terminal" and aborting the tool.

This makes batch operations (multi-file edits, sequential tool calls) fragile — any accidental click in the IDE file tree during the permission flow kills the pending operation.

Additionally, there is a potential security concern: if IDE-sourced content (e.g., selected text like y, 1, or n) could be interpreted as a response to a permission prompt, it could lead to unintended approvals or denials. Permission approvals should only come from direct keyboard input in the Claude Code terminal, never from IDE context events.

What Should Happen?

IDE context events (file-open notifications, selection changes) should not cancel or respond to pending permission prompts. These are separate input channels — one is informational context, the other is a blocking approval flow.

Error Messages/Logs

# Repeated pattern during a batch edit operation:
# Each Edit/Write/Bash tool call was cancelled:
Error: User answered in terminal

# System reminders appearing between tool calls:
# <system-reminder>
# The user opened the file d:\...\SKILL.md in the IDE.
# This may or may not be related to the current task.
# </system-reminder>

Steps to Reproduce

  1. Open a project in JetBrains IDE with Claude Code extension connected
  2. Ask Claude Code to perform a multi-step task requiring several file edits (e.g., "add YAML frontmatter to these 3 files")
  3. Claude Code queues tool calls (Write/Edit) that need permission approval
  4. While the first permission prompt is displayed, click on a different file in the IDE's file explorer
  5. The pending tool call is cancelled with "User answered in terminal"
  6. Claude Code must retry the operation

Environment

  • Claude Model: Opus
  • Is this a regression? I don't know
  • Claude Code Version: 2.1.86 (Claude Code)
  • Platform: Anthropic API
  • Operating System: Windows 11
  • Terminal/Shell: IntelliJ IDEA terminal

Additional Information

The workaround is to use fast atomic bash commands (e.g., { echo ...; cat ...; } > file) instead of the dedicated Write/Edit tools, since bash completes before the next IDE event fires. This defeats the purpose of dedicated tools which provide better UX and reviewability.

Severity: Medium — it doesn't lose data, but forces users to avoid all IDE interaction during permission flows, which is counterintuitive in an IDE-integrated tool.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗