[BUG] /context command doesn't work if the previous prompt has 'ultrathink' in it.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
/context doesn't show the context usage and throws a 400 error.
What Should Happen?
I need to be able the see the memory consumption by different resources with this command.
Error Messages/Logs
> /context
⎿ Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.3.content.0: When thinking is disabled, an `assistant` message in the final position cannot
contain `thinking`. To use thinking blocks, enable `thinking` in your request."},"request_id":"req_vrtx_XXXX"}
Steps to Reproduce
Go to an existing project.
Switch to Sonnet 4.5 and ask for it to provide project analysis and ask it to 'Ultrathink'. Make sure that 'Ultrathink' is in the prompt.
After the analysis is complete and the response is provided by Claude, try /context to see the error.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.0.126
Claude Code Version
2.0.0
Platform
Google Vertex AI
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
No response
I think this was a bug before today's release, been annoying me all week as I keep forgetting about it. You can get round it by Tabbing to turn thinking off, then running /context again.
I'm using the Console interface from Windows.
you need to send /context again when think mode is on
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.