claude-code - 💡(How to fix) Fix Claude Code VS Code : ~181k token system prompt on new chats causes immediate "Prompt is too long"

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Root Cause

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.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

In the Claude Code VS Code extension, every new chat with model claude-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: [email protected]
  • Model: claude-sonnet-4-6 and claude-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

  1. Open VS Code.
  2. Open a fresh workspace (can be an empty folder with no files, with all history deleted).
  3. Open the Claude panel and start a new chat.
  4. Select model: claude-sonnet-4-6 or claude-haiku-4-5
  5. Type a very short message (e.g. "test").
  6. 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING