Critical: Claude ignores user instructions and loops on oversized screenshot errors

Resolved 💬 8 comments Opened Jan 6, 2026 by Mediaquotes Closed Feb 26, 2026

Bug Description

Claude Code enters an infinite retry loop when attempting to read screenshots that exceed the 8000 pixel dimension limit, and ignores repeated explicit user instructions to stop.

Reproduction Steps

  1. Boris QA tester subagent creates screenshots using Playwright/Chromium during testing
  2. Screenshots exceed 8000px in at least one dimension (common with full-page captures)
  3. Claude attempts to read the screenshot using the Read tool
  4. API returns: At least one of the image dimensions exceed max allowed size: 8000 pixels
  5. User explicitly instructs Claude to stop reading the screenshots (multiple times, different languages)
  6. Claude ignores all instructions and retries the same Read operation repeatedly

Expected Behavior

When an image Read fails due to size limits, Claude should:

  • Detect the specific error type (dimension limit exceeded)
  • NOT retry the same Read operation
  • Acknowledge the file is too large to process
  • Continue with other tasks without the screenshot
  • Immediately obey user instructions to stop

Actual Behavior

  • Claude retried the same failed Read operation 5+ times
  • Ignored 4 explicit user commands to stop (in both German and English)
  • Generated identical API errors each time
  • Wasted significant tokens on repeated failures
  • Created extremely poor user experience where user felt helpless

Evidence from Conversation Log

User commands that were ignored:

  1. "du sollst diese screenshots doch nicht anschauen wenn sie viel zu gross sind" (German: "you shouldn't look at these screenshots when they're too large")
  2. "nicht die screenshots anschauen" (German: "don't look at the screenshots") - said twice
  3. "Do not check the screenshots!" (English, direct command)

All commands were completely ignored and Claude continued retrying the same failed Read.

Impact

  • High: Users get trapped in unproductive loops with no escape
  • Critical: Claude ignores direct user instructions - fundamental safety issue
  • Medium: Token waste on repeated failures
  • High: Demonstrates gaps in both error handling AND instruction-following

Environment

  • Model: Claude Sonnet 4.5 (claude-sonnet-4-5-20250929)
  • Platform: Linux
  • Tool: Read tool with image files
  • Context: Boris QA testing workflow (Playwright/Chromium screenshots)
  • Typical screenshot size: Full-page captures often exceed 8000px height

Root Cause Analysis

  1. No error pattern detection: Same API error repeated 5+ times without adaptation
  2. No user instruction override: Direct stop commands didn't interrupt the retry loop
  3. No file validation: No pre-check for image dimensions before Read attempt
  4. Poor error recovery: After first failure, Claude should have abandoned the screenshot

Suggested Fixes

  1. Priority 1: Ensure user instructions to stop/abort ALWAYS take precedence over any autonomous behavior
  2. Add error detection for API errors with specific patterns (dimension exceeded)
  3. Implement retry prevention: never retry the exact same file/operation after a size-related error
  4. Add file size/dimension pre-check before attempting Read on images
  5. Provide user-friendly message when images are too large: "Screenshot too large (>8000px), skipping analysis"
  6. For Boris/Playwright workflow: Add screenshot resize option or skip Read for oversized captures

Workaround

User had to create a text file (broken-chat.txt) to report the issue, as the conversation was stuck in the error loop.

---

Reporter: User of Claude Code CLI experiencing production issue
Severity: Critical - affects core instruction-following capability

View original on GitHub ↗

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