[BUG] /context not working for Claude Code Bedrock users anymore

Status Closed — not planned
Maintainer reply None cached
Activity 11 comments · opened Oct 1, 2025 · closed Jan 9, 2026

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 not working for Claude Code Bedrock users anymore.

What Should Happen?

It gives an Error:
"400 'temperature' may only be set to 1 when thinking is enabled. Please consult our documentation at [anthropic-link/extended-thinking]"

Error Messages/Logs

Steps to Reproduce

  1. Enter claude code CLI
  2. Enter /context

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.2

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

11 Comments

deepnz · 11 months ago

It worked after specifying the AWS_REGION as an env var. The docs can be more helpful by specifying that.

atcheson-aws · 11 months ago

I've observed that the /context command works if issued as the very first prompt in a session. After adding any other prompts to the session, that temperature error appears (regardless of AWS_REGION existence/value)

deepnz · 11 months ago

Yeah I thought adding that fixed it but it looks like it only works if you run it first before any prompt! And this is happening not only in the IDE extension but also the CLI when using Bedrock

JacekLach · 10 months ago

this seems to happen on local sessions too, if you try to run /context after some iteration with a thinking claude

jreisch02 · 10 months ago

I've found exactly the same using our Bedrock Claude this week as @JacekLach and @deepnz . Here is Claude Code's own analysis of what might be going on:

It is also worth mentioning that this happens with Claude Code in the integrated VS Code terminal on AlmaLinux 9 (not using the extension). I noticed the bug has a platform:macos label on it, but this is clearly a cross-platform issue.

""" Based on the error message and the pattern you're describing, here's my diagnosis: The Problem The issue is likely related to prompt caching state in long-running sessions. Here's what's probably happening: 1. In long sessions: Claude Code accumulates context (conversation history, files read, etc.) and uses prompt caching to speed up requests. Some internal state is causing the temperature parameter to be set incorrectly when the /context command runs. 2. After compaction: The conversation state is reset/cleaned, so the temperature parameter is correctly set (or defaults properly). Why the Temperature Error? The error message indicates that Bedrock's Claude API has a constraint: - When extended thinking is enabled, temperature MUST equal 1 - The /context command is apparently using extended thinking mode - In long sessions, something is causing temperature to be set to a different value (possibly 0 or a cached value from previous non-thinking requests) Likely Root Cause This could be a bug in Claude Code where: 1. The /context command uses extended thinking to analyze your conversation 2. In long sessions, there's stale state (possibly from prompt caching or parameter inheritance) causing temperature to not reset to 1 3. After compaction, the state is fresh, so temperature correctly defaults to 1 Workaround Until this is fixed, try compacting the conversation before running /context in long sessions. Reporting This You should report this issue to the Claude Code team at https://github.com/anthropics/claude-code/issues with: - Your Bedrock/AWS setup details - Steps to reproduce (long session → /context → error) - The fact that it works after compaction This appears to be a state management bug specific to how Claude Code handles parameters when using Bedrock's extended thinking feature in long-running sessions. """
ryancnelson · 10 months ago

i also hit this bug:
claude's own suggestion that i file this bug, but i found this previously reported issue:

```⏺ This looks like a bug in Claude Code's /context command. The error indicates that:

  1. This session has thinking enabled (extended reasoning mode)
  2. When thinking is enabled, temperature MUST be set to 1 (per API constraints)
  3. The /context command is trying to set a different temperature value (probably the default 0 or some other value)

You didn't set temperature - Claude Code's /context command implementation did, and it's not respecting the thinking mode
constraint.

What to do:

Report this as a bug:
# As mentioned in the help, report issues at:
open https://github.com/anthropics/claude-code/issues

Bug details to include:

  • Command: /context
  • Error: Temperature constraint violation when thinking mode is enabled
  • Expected: /context should work regardless of thinking mode
  • Actual: Crashes with 400 error about temperature

Workaround:

For now, if you need to use /context, you might need to start a new session without thinking mode, though that's not ideal.

This is definitely a bug in Claude Code's command handling - the /context command should either:

  • Use temperature=1 when thinking is enabled, or
  • Not set temperature at all and use the session default
bradfa · 10 months ago

I hit this issue in a normal CLI terminal on a Max plan, not on bedrock nor using VScode, if I turn thinking on for a few interactions then turn thinking off and issue /context. The first time I execute /context after turning thinking off will result in this bug. If I run /context again then it will correctly show the context state.

atcheson-aws · 9 months ago

Looks like it's fixed (v2.0.32)

github-actions[bot] · 8 months ago

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.

github-actions[bot] · 7 months ago

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.

github-actions[bot] · 7 months ago

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.