[BUG] awsCredentialRefresh ListInferenceProfiles failed: JSON Parse error
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?
Issue
Claude hangs for a while before processing my prompt in new and existing sessions. After running Claude in debug mode, I find Claude only continues after the ListInferenceProfiles errors out:
2026-07-07T16:36:20.124Z [ERROR] Bedrock ListInferenceProfiles failed: JSON Parse error: Unrecognized token '<'
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.
2026-07-07T16:36:20.126Z [ERROR] Failed to list Bedrock inference profiles, falling back to hardcoded models: JSON Parse error: Unrecognized token '<'
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.
Seeing the issue on various versions of claude, starting around v2.1.196.
Important Considerations
I am behind corporate proxies, corp certs, and use a private AWS VPC for connectivity to Bedrock. My default env is as follows:
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1
AWS_PROFILE=my-profile
AWS_REGION=us-east-1
CLAUDE_CODE_USE_BEDROCK=1
ANTHROPIC_BEDROCK_BASE_URL=https://my-corp-vpc.com
HTTP_PROXY=http://my-corp-proxy.com:port
HTTPS_PROXY=http://my-corp-proxy.com:port
NO_PROXY=https://my-corp-vpc.com
http_proxy=http://my-corp-proxy.com:port
https_proxy=http://my-corp-proxy.com:port
no_proxy=https://my-corp-vpc.com
What Should Happen?
Claude should either fail faster and fallback to hardcoded models or output the hidden error directly.
Error Messages/Logs
2026-07-07T16:32:53.486Z [DEBUG] [API:request] Creating client, ANTHROPIC_CUSTOM_HEADERS present: false, has Authorization header: false
2026-07-07T16:32:53.486Z [DEBUG] [API:auth] OAuth token check starting
2026-07-07T16:32:53.497Z [DEBUG] Started caffeinate to prevent sleep
2026-07-07T16:32:53.556Z [DEBUG] [API:auth] OAuth token check complete
2026-07-07T16:32:53.556Z [DEBUG] [API:auth] OAuth token check complete
2026-07-07T16:34:03.139Z [DEBUG] [skills] idle — switching poll interval to 30000ms
2026-07-07T16:36:19.769Z [DEBUG] Failed to clear AWS credential cache (this is expected if no credentials are configured)
2026-07-07T16:36:19.770Z [DEBUG] [API:auth] AWS credential resolve done in 236742ms
2026-07-07T16:36:19.789Z [DEBUG] [API:timing] dispatching to bedrock model=arn:aws:bedrock:us-east-1:911084782529:inference-profile/us.anthropic.claude-haiku-4-5-20251001-v1:0
2026-07-07T16:36:19.793Z [DEBUG] [API:timing] dispatching to bedrock model=arn:aws:bedrock:us-east-1:911084782529:inference-profile/us.anthropic.claude-opus-4-8
2026-07-07T16:36:19.816Z [DEBUG] [API REQUEST] /model/arn:aws:bedrock:us-east-1:911084782529:inference-profile%2Fus.anthropic.claude-haiku-4-5-20251001-v1:0/invoke-with-response-stream source=generate_session_title
2026-07-07T16:36:19.818Z [DEBUG] [API REQUEST] /model/arn:aws:bedrock:us-east-1:911084782529:inference-profile%2Fus.anthropic.claude-opus-4-8/invoke-with-response-stream source=repl_main_thread
2026-07-07T16:36:20.124Z [ERROR] Bedrock ListInferenceProfiles failed: JSON Parse error: Unrecognized token '<'
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.
2026-07-07T16:36:20.126Z [ERROR] Failed to list Bedrock inference profiles, falling back to hardcoded models: JSON Parse error: Unrecognized token '<'
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.
2026-07-07T16:36:21.041Z [DEBUG] Stream started - received first chunk
2026-07-07T16:36:21.041Z [DEBUG] [API:timing] first byte after 1258ms
2026-07-07T16:36:24.916Z [DEBUG] Stream started - received first chunk
2026-07-07T16:36:24.917Z [DEBUG] [API:timing] first byte after 5124ms
Steps to Reproduce
- Open a new Claude session behind corporate proxies and certs with Bedrock 3P.
- Run a prompt
- Claude hangs for a while, then responds.
Claude Model
Not sure / Multiple models
Is this a regression?
I don't know
Last Working Version
Can't tell which version it previously worked for
Claude Code Version
2.1.202
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Many users across my org are impacted. Is the awsAuthRefresh command able to be run behind corporate proxy?