[BUG] VS Code extension — context limit error (400) when auto-compaction fails to trigger

Resolved 💬 3 comments Opened Feb 13, 2026 by akazelig Closed Feb 17, 2026

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?

During a long coding session in the VS Code extension, Claude hits the
context window limit without auto-compaction triggering in time. The session
becomes completely stuck — Claude cannot respond and the only recovery is
reloading the interface, which wipes all conversation history and leaves
work unfinished. The /bug command is not available in the VS Code extension,
so reporting through GitHub instead.

What Should Happen?

Auto-compaction should trigger before the context limit is reached,
summarizing the conversation and allowing the session to continue
seamlessly — as documented behavior.

Error Messages/Logs

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and `max_tokens` exceed context limit: 182026 + 32000 > 200000, decrease input length or `max_tokens` and try again"},"request_id":"req_011CY5pXm33oVFx1tR37SASa"}

Steps to Reproduce

  1. Open a project in VS Code with the Claude Code extension
  2. Start a multi-step coding task (e.g. refactoring across multiple files)
  3. Continue working in the same session over an extended period
  4. Session approaches context limit — auto-compaction does not trigger
  5. The error above appears; Claude cannot continue
  6. No recovery option except reloading, which clears all history

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.39

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

The request_id in the error (req_011CY5pXm33oVFx1tR37SASa) may help
with internal diagnostics. This appears related to previously reported
auto-compaction failures in the VS Code extension (e.g. issue #11494).
The session had been running for an extended period before the error occurred.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗