[BUG] 400 after switching to NotebookRead for Jupyter Notebook
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.3 (Claude Code)
- Operating System: Amazon Linux (ec2)
- Terminal: iTerm sshed to ec2
Bug Description
After claude 4 switched to NotebookRead, I consistently get 400s and can't seem to switch it out of that mode. It seems specific to the following open source jupyter notebook, but I'm guessing there's something in it that would cause other similar notebooks to break claude:
https://github.com/victorbserra/projects/blob/main/chords-predict/chords-project/model_3.ipynb
I can't reproduce with basic jupyter notebooks, which makes me think its something in this specific notebook. However when I view the contents of that notebook myself, it looks relatively innocent.
Steps to Reproduce
- Tell claude to fetch https://github.com/victorbserra/projects/blob/main/chords-predict/chords-project/model_3.ipynb and read it into context. It will fail with a 400
- Try giving claude any prompt, it will also fail with a 400
Expected Behavior
Claude should read that notebook into context and allow users to continue with additional prompts.
The failure scenario also seems like it could improve - ideally all future prompts would not also be broken, as now I have to start a new session with blank context.
Actual Behavior
After attempting to read the notebook, claude gives the same 400 error on any additional prompt.
Additional Context
● Read(chord-ml-models/chords-predict/model_3.ipynb)…
⎿ Error: File is a Jupyter Notebook. Use the NotebookRead to read this file.
● Read Notebook(chord-ml-models/chords-predict/model_3.ipynb)…
⎿ Read 93 cells
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.2
42.content.0.tool_result.content.1.image.source.base64: invalid base64 data"}}
> try again maybe? why did that fail
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.2
42.content.0.tool_result.content.1.image.source.base64: invalid base64 data"}}
> why did that fail
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.2
42.content.0.tool_result.content.1.image.source.base64: invalid base64 data"}}
> test prompt. are you there?
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.2
42.content.0.tool_result.content.1.image.source.base64: invalid base64 data"}}This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗