[BUG] config set not working (as expected) on windows with native installer
Environment
- Platform (select one):
- [ ] Anthropic API
- [x] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.67 (Claude Code)
- Operating System: Windows 11 24H2
- Terminal: Windows Terminal 1.22.11141.0 (cmd.exe with clink)
Bug Description
setting the configuration requires non native escape sequences
Steps to Reproduce
- start cmd.exe
- install claude following the native (beta) instructions https://docs.anthropic.com/en/docs/claude-code/setup#native-binary-installation-beta
- attempt to configure AWS bedrock
e.g for the JSON string {"CLAUDE_CODE_USE_BEDROCK" : "true" , "AWS_PROFILE" : "cloudbees-bedrock-claude-infra-bedrock-viewer" } note that we need to pass this as a single string and we need to escape the double quotes.
as this is windows you can escape a double quote with ^ or by using 2 double quotes "" (additionally we need to quote the string
Expected Behavior
claude config set --global env "{""CLAUDE_CODE_USE_BEDROCK"": ""true"", ""AWS_PROFILE"": ""cloudbees-bedrock-claude-infra-bedrock-viewer"" }"works
Actual Behavior
> claude config set --global env "{""CLAUDE_CODE_USE_BEDROCK"": ""true"", ""AWS_PROFILE"": ""cloudbees-bedrock-claude-infra-bedrock-viewer"" }"
Error: Failed to parse JSON for 'env': JSON Parse error: Unterminated string
❯ claude config set --global env "{^"CLAUDE_CODE_USE_BEDROCK^": ^"true^", ^"AWS_PROFILE^": ^"cloudbees-bedrock-claude-infra-bedrock-viewer^" }"
Error: Failed to parse JSON for 'env': JSON Parse error: Unrecognized token '^'
Additional Context
<!-- Add any other context about the problem here, such as screenshots, logs, etc. -->
After a lot of frustration I tried falling back to a non native escape of using \ ❯ claude config set --global env "{\"CLAUDE_CODE_USE_BEDROCK\": \"true\", \"AWS_PROFILE\": \"cloudbees-bedrock-claude-infra-bedrock-viewer\" }
This works but is unexpected.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗