[Bug] Anthropic API Error: Screenshot exceeds token limit, breaks session state

Resolved 💬 3 comments Opened Jan 12, 2026 by Kabilan108 Closed Jan 15, 2026

Bug Description

i was having claude work on an expo app using commands in a justfile to conrol the emulator. one command allowed claude to take screenshots. after taking a couple of screenshots, it seems one screenshot was too large for the anthropic api and has bugged out the session. now all messages i send are bricked.

the justfile command:

screenshot:
    #!/usr/bin/env bash
    mkdir -p /tmp/pay-me/screenshots
    name="screenshot_$(date +%Y%m%d_%H%M%S)_$RANDOM.png"
    path="/tmp/pay-me/screenshots/$name"
    adb exec-out screencap -p > "$path"
    echo "$path"

Environment Info

  • Platform: linux
  • Terminal: tmux
  • Version: 2.1.4
  • Feedback ID: e8af5649-f33a-4396-8235-e3233b3e00e9

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.33.content.29.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels\"},\"request_id\":\"req_011CX2kZQg3uCbBG6kZC9gr8\"}\n    at C9.generate (file:///home/kabilan/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:492:33583)\n    at qP.makeStatusError (file:///home/kabilan/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:914:2195)\n    at qP.makeRequest (file:///home/kabilan/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:914:5420)\n    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)\n    at async g81.model (file:///home/kabilan/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:4346:6290)\n    at async g81 (file:///home/kabilan/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:1064:97633)\n    at async gH9 (file:///home/kabilan/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:4346:6444)\n    at async file:///home/kabilan/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:4344:3799\n    at async AG0 (file:///home/kabilan/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:1065:1998)\n    at async ZHA (file:///home/kabilan/.bun/install/global/node_modules/@anthropic-ai/claude-code/cli.js:4344:3769)","timestamp":"2026-01-12T03:11:33.671Z"}]

View original on GitHub ↗

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