[Bug] IDE Diff Approval Adds Entire File to Context Instead of Diff
Bug Description
IDE diff approval adds entire file content to context instead of just the diff.
This happens for ALL file sizes, causing rapid context exhaustion even with smaller files.
Critical Discovery:
- BUG OCCURS: When clicking "Accept" in JetBrains IDE diff confirmation → entire file added to context (very bad)
- BUG AVOIDED: When clicking confirmation in Claude Code terminal while IDE diff is open → only diff added to context (correct behavior)
Reproduction (clean session test - consistently reproduced every time):
- Start fresh Claude Code session
- Run
/context- empty (9% usage) - Make a small edit in a big file of 9000+ lines / 300KB+ (for example, ask Claude to add an import)
- IDE shows diff confirmation dialog with "Accept" or "Reject" buttons.
- Path A: Click "Accept" in IDE → ERROR "Context low" and cannot continue →
/contextshows over 100% overflow ❌ - Path B: Click "Accept" in Claude Code terminal → Continues with no error →
/contextshows almost empty context like before ✅
The Problem:
- Large files (7000+ lines / 300KB+): Immediate context overflow, session unusable
- Medium files (1000-5000 lines): Context fills fast, requiring frequent compaction
This means even normal-sized projects become unmanageable as edits add entire file contents, not just the changes.
Workaround Found:
Always confirm changes in Claude Code terminal, never use IDE's Accept button.
Or always use auto-accept on so no changes are being asked for approval at all.
Expected Behavior:
Both confirmation methods should only add the diff to context. A 1-word change should add ~10-50 tokens regardless of file size.
Impact:
- Makes IDE's natural workflow unusable
- Forces constant context management even for small files
- Requires users to remember terminal-only confirmation
- Unable to manually modify suggested changes before accepting them.
Environment:
- JetBrains IDE WebStorm (latest) & PyCharm (latest) with official Claude Code plugin 0.1.11-beta (latest)
- Terminal: pycharm / webstorm (PowerShell 7 inside the IDE)
- Platform: win32 (Windows 11)
- Version: 1.0.112
- All Claude Code versions affected (including latest 1.0.112)
- Bug isolated to IDE plugin's diff approval handler
This is a critical bug in the IDE plugin that breaks the fundamental context management model.
Errors
[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"prompt is too long: 205699 tokens > 200000 maximum\"}}\n at J4.generate"}]This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗