[Bug] Anthropic API Error: Unspecified API Interaction Issue - Claude Sonnet 4.5 misusing the many images tool

Resolved 💬 4 comments Opened Sep 30, 2025 by ariccio Closed Oct 4, 2025

Bug Description
Claude made a mistake with your API - an understandable one - but should be improved

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.0.1
  • Feedback ID: bfab7e73-a4d4-4d9b-926a-fcd51229ce66

Errors

[{"error":"SyntaxError: Unexpected token '/', \"/Users/ale\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:747:9932\n    at Q (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:713:13287)\n    at f_0.<anonymous> (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:3678:224)\n    at f_0.B [as _actionHandler] (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:703:528)\n    at file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:707:3127\n    at f_0._chainOrCall (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:707:1694)\n    at f_0._parseCommand (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:707:3103)\n    at f_0.parseAsync (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:704:4195)\n    at xe5 (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:3707:1502)","timestamp":"2025-09-30T13:31:01.433Z"},{"error":"Error: Request was aborted.\n    at cG1 (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:27650)\n    at cG1.next (<anonymous>)\n    at q2B (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:35921)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:34180\n    at async ZH0 (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:9568)\n    at async r11 (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:1120:34150)\n    at async bO (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:3162:11922)\n    at async h9 (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:3215:52870)\n    at async n9 (file:///Users/alexanderriccio/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-ai/claude-code/cli.js:3215:53825)","timestamp":"2025-09-30T13:32:25.479Z"},{"error":"Error: ⚠️ Warning: 2025-09-30 09:33:08.333 appintentsmetadataprocessor[31188:5579701] warning: Metadata extraction skipped. No AppIntents.framework dependency found.\n---\n❌ Error: /Users/alexanderriccio/Documents/GitHub/DeeDee-todo-work/DeeDee Prototype/Features/HealthIncident/AreYouOkayViewModel.swift:64:5: error: Type Contents Order Violation: A 'deinitializer' should not be placed amongst the type content(s) 'other_method' (type_contents_order)\n---\n⚠️ Warning: /Users/alexanderriccio/Documents/GitHub/DeeDee-todo-work/DeeDee Prototype/Features/Dashboard/SeniorDashboard/SeniorDashboardView.swift:531:24: warning: Multiple Closures with Trailing Closure Violation: Trailing closure syntax should not be used when passing more than one closure argument (multiple_closures_with_trailing_closure)\n---\n⚠️ Warning: /Users/alexanderriccio/Documents/GitHub/DeeDee-todo-work/DeeDee Prototype/HealthKit/Managers/MultiModalFallRiskEngine.swift:1258:9: warning: Unused Parameter Violation: Parameter 'sleepManager' is unused; consider removing or replacing it with '_' (unused_parameter)\n---\n❌ Error: /Users/alexanderriccio/Documents/GitHub/DeeDee-todo-work/DeeDee Prototype/Features/HealthIncident/AreYouOkayViewModel.swift:65:9: error: main actor-isolated property 'observationTask' can not be referenced from a nonisolated context\n---\n❌ [stderr] ** BUILD FAILED **\n---\n❌ [stderr] The following build commands failed:\n---\n❌ [stderr] \tSwiftCompile normal arm64 Compiling\\ FlockTabView.swift,\\ AreYouOkayView.swift,\\ AreYouOkayViewModel.swift,\\ HomeView.swift,\\ HomeView+AreYouOkayToolbar.swift,\\ MainTabView.swift,\\ InnerCircleView.swift,\\ PersonEditorView.swift,\\ AdvancedHealthAnalyticsView.swift,\\ AppleHealthSettingsView.swift,\\ AreYouOkaySettingsSection.swift,\\ HealthKitAuthorizationView.swift,\\ HealthKitPermissionStatusView.swift,\\ MockDataSettingsView.swift,\\ SettingsView.swift,\\ SMSAlertSettingsSection.swift,\\ HealthKitAuthorizationManager.swift,\\ HealthKitAuthorizationHelper.swift /Users/alexanderriccio/Documents/GitHub/DeeDee-todo-work/DeeDee\\ Prototype/Features/Flock/FlockTabView.swift /Users/alexanderriccio/Documents/GitHub/DeeDee-todo-work/DeeDee\\ Prototype/Features/HealthIncident/AreYouOkayView.swift /Users/alexander

Note: Error logs were truncated.

Claude code was having trouble figuring something out with the iOS simulator. I asked it to record a video, it did it using @cameroncooke's XCodeBuildMCP MCP, and then I directed it to export the video to frames that I know it can inspect, it also did that as I'd expect with ffmpeg -i /tmp/toggle-demo.mp4 -vf "select='not(mod(n\,15))'" -vsync vfr /tmp/frame_%04d.png 2>&1 | tail -20, (sidenote: that's also very impressive, since it used to take me 20-30 minutes to get the ffmpeg incantations exactly right!)

But then it tried to apparently send too many large images at once through to the API:

⏺ Bash(ffmpeg -i /tmp/toggle-demo.mp4 -vf "select='not(mod(n\,15))'" -vsync vfr /tmp/frame_%04d.png 2>&1 | tail -20)
  ⎿  [swscaler @ 0x149658000] [swscaler @ 0x149698000] No accelerated colorspace conversion found from yuv420p to rgb24.                                                                                                    
     [swscaler @ 0x149658000] [swscaler @ 0x1496a8000] No accelerated colorspace conversion found from yuv420p to rgb24.
     [swscaler @ 0x149658000] [swscaler @ 0x1496b8000] No accelerated colorspace conversion found from yuv420p to rgb24.
     [swscaler @ 0x149658000] [swscaler @ 0x1496c8000] No accelerated colorspace conversion found from yuv420p to rgb24.
     [swscaler @ 0x149658000] [swscaler @ 0x1496d8000] No accelerated colorspace conversion found from yuv420p to rgb24.
     [swscaler @ 0x149658000] [swscaler @ 0x1496e8000] No accelerated colorspace conversion found from yuv420p to rgb24.
     Output #0, image2, to '/tmp/frame_%04d.png':
       Metadata:
         major_brand     : mp42
         minor_version   : 1
         compatible_brands: isommp41mp42
         encoder         : Lavf61.7.100
       Stream #0:0(und): Video: png, rgb24(pc, gbr/unknown/unknown, progressive), 1206x2622, q=2-31, 200 kb/s, 16.15 fps, 16.15 tbn (default)
           Metadata:
             creation_time   : 2025-09-30T14:55:37.000000Z
             handler_name    : Core Media Video
             vendor_id       : [0][0][0][0]
             encoder         : Lavc61.19.101 png
[out#0/image2 @ 0x600002504300] video:17335KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
     frame=   42 fps=0.0 q=-0.0 Lsize=N/A time=00:00:38.07 bitrate=N/A speed=42.6x

⏺ Bash(ls -lh /tmp/frame_*.png | head -10)
  ⎿  -rw-r--r--  1 alexanderriccio  wheel   255K Sep 30 10:57 /tmp/frame_0001.png
     -rw-r--r--  1 alexanderriccio  wheel   274K Sep 30 10:57 /tmp/frame_0002.png
     -rw-r--r--  1 alexanderriccio  wheel   296K Sep 30 10:57 /tmp/frame_0003.png
     -rw-r--r--  1 alexanderriccio  wheel   311K Sep 30 10:57 /tmp/frame_0004.png
     -rw-r--r--  1 alexanderriccio  wheel   232K Sep 30 10:57 /tmp/frame_0005.png
     -rw-r--r--  1 alexanderriccio  wheel   320K Sep 30 10:57 /tmp/frame_0006.png
     -rw-r--r--  1 alexanderriccio  wheel   324K Sep 30 10:57 /tmp/frame_0007.png
     -rw-r--r--  1 alexanderriccio  wheel   322K Sep 30 10:57 /tmp/frame_0008.png
     -rw-r--r--  1 alexanderriccio  wheel   313K Sep 30 10:57 /tmp/frame_0009.png
     -rw-r--r--  1 alexanderriccio  wheel   312K Sep 30 10:57 /tmp/frame_0010.png

⏺ Read(file_path: "/tmp/frame_0001.png")
  ⎿  Read image (254.9KB)

⏺ Read(file_path: "/tmp/frame_0003.png")
  ⎿  Read image (296.2KB)

⏺ Read(file_path: "/tmp/frame_0005.png")
  ⎿  Read image (232KB)

⏺ Read(file_path: "/tmp/frame_0007.png")
  ⎿  Read image (323.9KB)
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.71.content.11.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 
     pixels"},"request_id":"req_011CTenGTeuDeP31otaqgb6H"}

Stop [(cd "$(git rev-parse --show-toplevel 2>/dev/null || echo .)" && ./scripts/swift-violations-check-session.sh)] completed successfully

Stop [jq -r '.message // "Claude notification"' | xargs -I {} terminal-notifier -title "Claude Code" -subtitle "DeeDee Development STOP" -message "{}" -sound "Glass" -group "claude-code"] completed successfully: * Removing 
previously sent notification, which was sent on: 2025-09-30 14:56:16 +0000

> You may need to manually binary search through the images to find the right one. Apparently also you've hit a claude API restriction from the images being full resolution - perhaps re-export them with ffmpeg at a much scaled down 
resolution? 
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.71.content.9.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 
     pixels"},"request_id":"req_011CTenMNXipVESJXmU7YDrX"}

Stop [(cd "$(git rev-parse --show-toplevel 2>/dev/null || echo .)" && ./scripts/swift-violations-check-session.sh)] completed successfully

Stop [jq -r '.message // "Claude notification"' | xargs -I {} terminal-notifier -title "Claude Code" -subtitle "DeeDee Development STOP" -message "{}" -sound "Glass" -group "claude-code"] completed successfully: * Removing 
previously sent notification, which was sent on: 2025-09-30 14:57:30 +0000

The part where this becomes more of just a bug than a mere poor behavior is that it didn't know what to do next, and gave up. It's still hitting an API error for me:

> You may need to manually binary search through the images to find the right one. Apparently also you've hit a claude API restriction from the images being full resolution - perhaps re-export them with ffmpeg at a much scaled down 
resolution? 
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.71.content.9.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 
     pixels"},"request_id":"req_011CTenMNXipVESJXmU7YDrX"}

Stop [(cd "$(git rev-parse --show-toplevel 2>/dev/null || echo .)" && ./scripts/swift-violations-check-session.sh)] completed successfully

Stop [jq -r '.message // "Claude notification"' | xargs -I {} terminal-notifier -title "Claude Code" -subtitle "DeeDee Development STOP" -message "{}" -sound "Glass" -group "claude-code"] completed successfully: * Removing 
previously sent notification, which was sent on: 2025-09-30 14:57:30 +0000

> /feedback 
  ⎿  Feedback / bug report submitted

> Please try again? I tried to send this message:
You may need to manually binary search through the images to find the right one. Apparently also you've hit a claude API restriction from the images being full resolution - perhaps re-export them with ffmpeg at a much scaled down 
resolution? 
  ⎿  API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.71.content.9.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 
     pixels"},"request_id":"req_011CTeoU7GWNafps5kQyRc1p"}

Stop [(cd "$(git rev-parse --show-toplevel 2>/dev/null || echo .)" && ./scripts/swift-violations-check-session.sh)] completed successfully

Stop [jq -r '.message // "Claude notification"' | xargs -I {} terminal-notifier -title "Claude Code" -subtitle "DeeDee Development STOP" -message "{}" -sound "Glass" -group "claude-code"] completed successfully: * Removing 
previously sent notification, which was sent on: 2025-09-30 14:58:38 +0000

View original on GitHub ↗

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