JetBrains IDEA extension silently overwrites working files with stale/older versions

Resolved 💬 4 comments Opened Apr 5, 2026 by ngravi Closed Apr 8, 2026

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?

Description

The Claude Code JetBrains extension appears to cache file contents and silently write stale versions back to disk, overwriting the user's current working copy. This has occurred across multiple independent sessions.

Environment

Claude Code JetBrains IDEA extension (latest)
IntelliJ IDEA on Windows 11 Pro (10.0.26200)
Source control: Perforce (primary), with a secondary local .git repo
Java/Gradle project
Steps to reproduce

Open a project in IntelliJ IDEA with the Claude Code extension active
Have files in a working state (locally modified, ahead of depot/repo version)
Start a Claude Code session and interact with files (read, edit, write)
After the session, files on disk are found to contain older versions of the content — not matching the user's local working copy, and in some cases older than the version checked into source control
Observed behavior

Files on disk are silently replaced with content from an earlier point in time
The replacement happens without any user action or confirmation
The issue persists across sessions — it is not a one-time occurrence
Affected files include both files that Claude Code read/wrote during the session AND files it did not directly interact with
Running p4 revert (Perforce) after Claude Code edits may compound the issue, as the extension's cached state and Perforce's depot state may diverge from the user's actual working copy
Expected behavior

Files on disk should never be modified unless explicitly requested via a tool call (Write/Edit) that the user approves
The extension should not hold stale file content in memory and flush it to disk
File reads should always reflect the current on-disk state, not a cached version
Impact

Loss of local work requiring manual restoration from Perforce history
Significant time spent diagnosing and recovering from silent file corruption
Undermines trust in using the extension for active development
Additional context

The issue may be related to how the extension handles file caching, file watchers, or write-back behavior when IntelliJ's VFS and the extension's internal state diverge
Perforce workspace uses p4 edit (files are read-only until opened for edit), which may interact poorly with the extension's file handling

What Should Happen?

It should not corrupt.

Error Messages/Logs

Steps to Reproduce

Open a project in IntelliJ IDEA with the Claude Code extension active
Have files in a working state (locally modified, ahead of depot/repo version)
Start a Claude Code session and interact with files (read, edit, write)
After the session, files on disk are found to contain older versions of the content — not matching the user's local working copy, and in some cases older than the version checked into source control
Observed behavior

Does not happen all the time, happened twice today in two different sessions.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

Version 1.569.0 (49894a)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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