[BUG] Session permanently stuck on rate limit after reading many image files - unrecoverable

Resolved 💬 4 comments Opened Mar 7, 2026 by Chechesa Closed Apr 7, 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?

While using Claude Code in Antigravity (VS Code extension) to explore a directory with
~800 PNG files, I only asked Claude to look at the file names to help categorize them.
Instead, Claude started reading/opening the actual image files one by one on its own.
At some point it hit "API Error: Rate limit reached" and the session became permanently
stuck. After 3+ days, the session still cannot accept any input - every attempt returns
the same rate limit error. The session is completely unrecoverable.

This is two bugs in one:

  1. Claude read binary image files when only file names were needed (wasting context)
  2. The session became permanently unrecoverable after hitting the rate limit

Additionally, at the time of the error, my 5-hour session token usage was only around
3-5%, and weekly usage was around 10% of my Max subscription allowance. This is not a
legitimate rate limit from overuse - the session just got stuck and never recovered.

What Should Happen?

  1. The session should recover after the rate limit cooldown period ends
  2. Ideally, Claude should have a safeguard to avoid reading too many large binary files

in sequence, or warn the user before the context window fills up with image data

  1. At minimum, there should be a way to "reset" or "clear" a stuck session without

losing the conversation entirely

Error Messages/Logs

API Error: Rate limit reached
(no additional details - the error persists indefinitely, no stack trace available)
5-hour session token usage at the time: ~3-5%
Weekly token usage at the time: ~10% of Max plan allowance

Steps to Reproduce

  1. Open Claude Code in Antigravity (VS Code extension) in a workspace containing

hundreds of PNG files

  1. Ask Claude to help categorize the files based on their names

(NOT asking it to open or analyze the image contents)

  1. Claude decides on its own to read/open the PNG files to visually inspect them
  2. After reading many images, the context window fills up
  3. Session hits "API Error: Rate limit reached"
  4. Session never recovers - even after days of waiting, any new message

returns the same rate limit error

  1. The only option is to start a completely new session, losing all context

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.52 VS extension, 2.1.69 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

The directory contained ~878 PNG files. File names already contained descriptive
info (character names, pose types, dimensions). A simple ls or glob would have
been sufficient, but Claude chose to open the images instead.

Suggestion: Claude Code could implement a "circuit breaker" that stops reading
binary files after N images or after context usage exceeds a threshold, asking
the user if they want to continue.

View original on GitHub ↗

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