Claude Code VS Code : ~181k token system prompt on new chats causes immediate "Prompt is too long"
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?
In the Claude Code VS Code extension, every new chat with modelclaude-sonnet-4-6 starts with an extremely large system prompt
(~181.7k tokens), leaving almost no space in the 200k context window.
As a result, even a single short user message immediately triggers
"prompt is too long" / context overflow, or shows ~98% context usage
before I have any real conversation.
This happens even after clearing all chats and deleting memory.
---
Observed behavior
Context usage for a brand-new chat (example values from my screenshot):
- Model:
claude-sonnet-4-6 - Total: 195.7k / 200.0k tokens (98%)
- System prompt: 181.7k tokens (~90.9%)
- System tools: 11.5k tokens (~5.7%)
- Skills: 2.3k tokens (~1.2%)
- Messages: 119 tokens (<0.1%)
- Autocompact buffer: 33.0k tokens (~16.5%)
Because the system prompt alone is ~181k tokens, there is essentially
no free context for normal usage. I repeatedly get "prompt is too long"
or hit the context limit almost instantly in any new chat.
This occurs:
- With all previous chats deleted.
- With memory cleared.
- In an empty folder with no project files opened.
---
Environment
- OS: Microsoft Windows 11 Pro 10.0.26200
- VS Code version: 1.123.0
- Claude Code extension version: Claude Code extension version: anthropic.claude-code@2.1.165
- Model:
claude-sonnet-4-6andclaude-haiku-4-5 - Other extensions that might interact with Claude: "none"
---
Additional context
- I have cleared all chats, deleted memory, deleted extensions and plugins, and restarted VS Code.
- I see roughly the same ~181k system prompt size on every new chat, even in an empty workspace and with only a single short message.
- Screenshot of the context usage panel is attached below.
What Should Happen?
- A new chat should start with a much smaller system prompt
(typical sizes are on the order of tens of thousands of tokens,
not ~180k), leaving the majority of the 200k context window
available for user messages, tools, and compacted history.
- Context usage in a fresh chat with a single short message should be well below 50%, and should not immediately trigger "prompt is too long".
Error Messages/Logs
Steps to Reproduce
- Open VS Code.
- Open a fresh workspace (can be an empty folder with no files, with all history deleted).
- Open the Claude panel and start a new chat.
- Select model:
claude-sonnet-4-6orclaude-haiku-4-5 - Type a very short message (e.g. "test").
- Open the context usage panel.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.163 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
<img width="292" height="199" alt="Image" src="https://github.com/user-attachments/assets/66138070-a47a-4f11-9825-62414720e260" />
<img width="290" height="222" alt="Image" src="https://github.com/user-attachments/assets/432ee282-9273-471a-825c-36d9c8dde662" />
Co-written by Claude.
3 Comments
Same here. For any model using updated vscode and extension. Stopped working all of the sudden.
I figured it out, i had a commit waiting to be pushed which was a lot of lines long. The code extension was using that as context and running out immedeatly because of the size of the uncomitted diff
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.