claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Deadlock when using custom commands with awsCredentialExport/awsAuthRefresh

Open delicb opened this issue 2 months ago • 1 comments

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?

When custom commands exist in commands/ directory AND awsCredentialExport/awsAuthRefresh are configured, Claude Code hangs in loading state on first prompt. The credential scripts never execute (confirmed via logging).

What Should Happen?

Expected: Credential scripts should execute and request should succeed.

Actual: Credential scripts never run, Claude Code hangs before attempting credential fetch.

Error Messages/Logs


Steps to Reproduce

  1. Configure awsCredentialExport and awsAuthRefresh in settings.json
  2. Add any custom command file (e.g., commands/test.md)
  3. Start Claude Code
  4. Send a prompt
  5. Claude Code hangs in loading state indefinitely

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

1.x branch, not sure exact which exact version

Claude Code Version

2.0.14

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Other

Additional Information

Workaround: Remove awsCredentialExport/awsAuthRefresh and use AWS credential process via ~/.aws/config instead.

Additional Context:

  • Custom commands appear in autocomplete (so they load successfully)
  • Without custom commands, awsCredentialExport/awsAuthRefresh work fine
  • Manual credentials (AWS_ACCESS_KEY_ID env vars) work with custom commands
  • Part of the config:
"awsCredentialExport": "echo '{ \"Credentials\": ' && granted credential-process --profile \"${PROFILE}\" 2> /dev/null && echo '}'",
"awsAuthRefresh": "FORCE_NO_ALIAS=true assume -t ${PROFILE}"

delicb avatar Oct 13 '25 12:10 delicb