WebP image causes infinite token generation loop + hallucinated image content

Resolved 💬 4 comments Opened Feb 25, 2026 by WoWJony Closed Mar 25, 2026

Environment

  • Claude Code v2.1.55
  • Model: Opus 4.6 (Claude Max)
  • OS: Windows 11
  • Also reproduced hallucination on claude.ai web

Bug 1: Claude Code — WebP image processing causes token overflow

Steps to Reproduce

  1. Open Claude Code, /clear to start fresh (first message in session)
  2. Paste a .webp image and send a prompt asking to process the image
  3. Claude Code starts generating but never produces useful output

Actual Behavior

  • Claude hits 32000 output token maximum API error
  • Appears to be stuck in a loop attempting to describe/process the image
  • This has happened multiple times with the same pattern — not a one-off

Expected Behavior

  • Either: successfully process the webp image
  • Or: report that the image format is unsupported / failed to load

Bug 2: Claude.ai Web — Hallucinated image content from pasted conversation log

Steps to Reproduce

  1. Copy the Claude Code conversation log (which contains [Image #3] text placeholder)
  2. Paste it into a new claude.ai web conversation to ask about the failure
  3. Claude.ai treats the [Image #3] text as if a real image exists

Actual Behavior

Claude.ai:

  • Repeatedly claims "I can see the image", "Let me examine it carefully"
  • Self-reinforcing loop: each attempt adds more false confidence
  • Fabricates specific, detailed content: invented 12 university courses with names, time slots, and semester dates
  • Actually generates and writes an ICS file with entirely fabricated data
  • Never admits it cannot see any image

Expected Behavior

  • Recognize that [Image #3] is a text placeholder, not an actual image
  • Respond: "I don't see an actual image in this conversation"

Evidence

Claude.ai hallucination conversation (shared link):

https://claude.ai/share/2be6353c-a86e-4b41-9572-c328cb79c5f4

Claude Code raw output:

 ▐▛███▜▌   Claude Code v2.1.55
▝▜█████▛▘  Opus 4.6 · Claude Max
  ▘▘ ▝▝    C:\Users\[REDACTED]

❯ /clear
  ⎿  (no content)

❯ [user prompt + webp image pasted]
  ⎿  [Image #3]
  ⎿  API Error: Claude's response exceeded the 32000 output token maximum.

Analysis

Bug 1 may be a webp decoding issue — the image is present but Claude Code cannot process it, yet instead of failing gracefully, it enters an infinite generation loop.

Bug 2 is a hallucination triggered by strong user intent combined with the [Image #3] text marker. The model assumes an image must exist because the user references one, then fabricates increasingly specific details through a self-reinforcing loop. This is particularly dangerous because it produces confident, detailed, actionable output (a real .ics file) based on entirely fabricated data.

Impact

  • Data integrity: Users may import fabricated calendar data without realizing it's fake
  • Trust: The hallucination is highly convincing — specific course names, times, room numbers
  • Reproducibility: The Claude Code webp issue has occurred multiple times with the same pattern

View original on GitHub ↗

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