VS Code extension: system-reminder file-change injections consume context window with no exclusion mechanism
Summary
Since the claude-sonnet-4-6 update, the VS Code extension injects large system-reminder blocks into every conversation turn when files have been recently modified. These blocks contain the full diff/content of the modified files and repeat on every message in the session, rapidly consuming the context window and causing \"prompt too long\" errors.
Behavior
Every user message receives prepended system-reminder blocks like:
<system-reminder>
Note: /path/to/file.md was modified, either by the user or by a linter. This change was intentional...
[full file diff — potentially hundreds of lines]
</system-reminder>
This fires for every modified file, on every turn, for the entire session duration.
Impact
In projects where large planning or tracking documents are frequently modified (e.g. by an agent or CI), these injections compound quickly:
- 2 modified files × 180 lines each × many turns = context window exhausted within a single session
- \"Prompt too long\" errors block continued work
- No way to dismiss or exclude the injections mid-session
What's missing
There is currently no mechanism to:
- Exclude specific files or glob patterns from the modified-file injection (e.g.
docs/planning/**) - Disable the behavior globally or per-project
- Limit injection to once-per-session rather than once-per-turn
Requested
A configuration option — in .claude/settings.json or VS Code extension settings — to exclude file patterns from the modified-file system-reminder injection. For example:
{
"contextInjection": {
"excludeModifiedFiles": [
"docs/planning/**",
"*.md"
]
}
}
Or at minimum, inject once per session rather than on every turn.
Environment
- Claude Code VS Code extension (claude-sonnet-4-6)
- macOS Darwin 25.2.0
- Large monorepo with frequently-modified planning docs (edited by both human and agent)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗