[BUG] VS Code file saves eating context
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?
Lately, I have noticed that I run out of context very quickly while using VS Code. I asked Claude Code about it, and it reviewed the logs. It confirmed that I have been running out quickly, and it saw that every time I save a file - regardless of whether I am working with Claude on that file - it gets a file system notification with the all the modified lines, which eats context. So, if I have the Claude Code window open and I'm working without engaging it, I'm still eating up context every time I save a file. And I do have auto-save turned on. That means that every time I edit a file and switch tabs, Claude Code gets notified.
Here is a portion of the conversation with Claude Code:
ME: You've been running out of context really quickly the past week or so. Do you know why?
Looking at the session history, I can identify a few factors that are consuming context rapidly:
System reminders for file modifications - Every time a file is saved (including linter/formatter changes), I receive the full modified file content in system reminders. In this session alone, I received 6 system reminder blocks showing the complete updated files (HeightEditorViewModel.cs, HeightEditor.xaml, HeightEditor.xaml.cs, etc.). These add up quickly, especially with XAML files.
Conversation summaries - The session started with a very detailed summary of the previous conversation, including:
Full chronological analysis
All code snippets from the previous session
Complete error traces and fixes
Every user message quoted This comprehensive summary, while helpful for continuity, takes significant context space upfront.
Multiple file reads in context - The session began with 5 file reads already in context, each showing the full file content.
Tool descriptions - The extensive tool documentation in the system prompt (Task tool, Bash tool, git workflows, PR creation instructions, etc.) is quite verbose.
The biggest contributor seems to be #1 - the system reminders for file changes. When working iteratively on multiple files with auto-formatting enabled, each save triggers a full file content reminder, which compounds quickly. To help manage this, you could:
Disable auto-format-on-save temporarily during active development
Work in smaller, more focused sessions on individual components
Ask me to be more concise in my responses (less explanation, more action)
Would you like me to adjust my response style to be more code-focused and less explanatory?
ME: So, whether I engage you or not, you get notified every time I modify a file?
Yes, exactly. Every time you save a file (or your linter/formatter auto-saves it), I receive a system reminder with the modified content - whether you've sent me a message or not. Looking at this current exchange:
You asked me one question about context usage
I received 7 system reminder blocks just from file saves that happened while we were talking
Each reminder includes the full file path and all the modified lines
So if you're actively working and have auto-save/auto-format enabled, I'm accumulating context even during silent periods. This is particularly impactful when:
Working with large XAML files
Making iterative changes across multiple files
The formatter is triggered on every save
This explains why sessions burn through context quickly - I'm essentially getting a live feed of all file modifications regardless of whether we're actively collaborating on those specific files.
ME: That seems horribly inneficient. And I could run out of daily context without even talking to you. That sounds like a bug.
You're absolutely right - that does seem like a bug. The system shouldn't be burning through your daily context allocation just from passive file-save notifications when we're not actively collaborating on those files. This appears to be unintended behavior. The file modification reminders make sense when:
I've just edited a file and you save it (so I know my changes went through)
We're actively discussing specific files
But getting reminders for every file save in your workspace - including auto-formatter changes, files you're browsing, or work you're doing independently - is wasteful and could indeed exhaust your context budget without any actual interaction. You should report this at https://github.com/anthropics/claude-code/issues. This seems like something that should either:
Only trigger when files I've recently touched are modified
Only trigger when we have an active exchange happening
Be much more selective about what constitutes a "relevant" file change
The current behavior where you can burn through context by just having the extension open while working is definitely problematic.
What Should Happen?
Claude Code did have some thoughts in the exchange above, but I think the ideal would be that file changes don't impact context. Maybe they only get stored in the context if they are relevant to the discussion.
Basically, I shouldn't have to close my Claude Code window to avoid hitting my context limit.
Error Messages/Logs
Steps to Reproduce
- Start a Claude Code conversation in VS Code
- Work normally
- Occasionally ask Claude Code a question or to do something
- See that after a couple of hours, the context size pie shows up
- See that it rapidly drops to about 22% after engaging with it.
- At that point, it compacts the conversation
Once the conversation has been compacted, this process happens faster because now you've got the summary of all those things that happened already baked in.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
claude-sonnet-4-5-20250929
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗