Skip to content

[BUG] [1.0.64-] authentification to subagents are no longer propagated #4855

Closed as not planned

Description

@secustor

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other:
  • Claude CLI version: 1.0.64 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: iTerm2

Bug Description

When using environment variables to configure Claude Code for AWS Bedrock usage, subagents are no longer seem to receive all informations.

Subagent tasks return API errors while the main context runs without issues.

⏺ I'll use the foo agent to analyze the code duplication across the commands and identify opportunities for refactoring.
  ⎿  API Error (403 {"Message":"User: arn:aws:sts::000000:assumed-role/a-user-role/my-user is not authorized to perform: bedrock:InvokeModel on resource: arn:aws:bedrock:eu-central-1:000000:inference-profile/eu.anthropic.claude-sonnet-4-20250514-v1:0 because no identity-based policy allows the bedrock:InvokeModel action"}) · Retrying in 1 seconds… (attempt 1/10)

A rollback to 1.0.63 fixes the issue.

Steps to Reproduce

  1. AWS_ACCESS_KEY_ID=000000 AWS_CA_BUNDLE=.... claude
  2. Run a subagent

Expected Behavior

Subagents are processing steps successfully

Actual Behavior

Subagents retries until the retry limit is reached than Claude Code starts processing successfully in the main thread.

Additional Context

We are using the Teleport tsh CLI to enable access to AWS Bedrock

Activity

  1. added
    bug
    on Jul 31, 2025
  2. added
    has repro
    api:bedrock
    platform:macos
    on Jul 31, 2025
  3. ZachK543 commented on Jul 31, 2025

    @ZachK543

    I am experiencing the same issue. And rolling back to 1.0.63 fixed it for me.

  4. changed the title [-][BUG] [1.0.64] authentification to subagents are no longer propagated[/-] [+][BUG] [1.0.64-] authentification to subagents are no longer propagated[/+] on Aug 1, 2025
  5. kkukshtel commented on Aug 5, 2025

    @kkukshtel

    I'm also seeing this. Using LiteLLM with set env vars works for the initial response, but subagents then use whatever the claude code default is (not what is set in /model or through env). This means subagents will then often fail with model access errors if the default model isn't supported in your own LiteLLM setup.

  6. github-actions commented on Aug 15, 2025

    @github-actions

    Found 3 possible duplicate issues:

    1. [BUG] Claude Code doesn't inherit refreshed AWS credentials from SAML-to in GitHub Codespaces, causing 403 "security token expired" errors every 30 minutes #5737
    2. [BUG] Task subagents fail to inherit permissions in MCP server mode (affects both WSL and native Windows) #5465
    3. API Error: 403 The security token included in the request is invalid. #4505

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  7. secustor commented on Aug 16, 2025

    @secustor
    Author

    The other issues seem to be unrelated.

  8. ire4ever1190 commented on Aug 25, 2025

    @ire4ever1190

    Ran into similar issue, found the subagent was using a model I didn't have access to.
    Needed to set the CLAUDE_CODE_SUBAGENT_MODEL variable to an ARN I did have access to

  9. secustor commented on Aug 26, 2025

    @secustor
    Author

    Thanks @ire4ever1190 !

    I can confirm that setting CLAUDE_CODE_SUBAGENT_MODEL with the same setting as my ANTHROPIC_MODEL fixes the issue.

    From my perspective this issue can be closed, when this setting is document in the Model configuration section of the AWS Bedrock guide.

    https://docs.anthropic.com/en/docs/claude-code/amazon-bedrock#4-model-configuration

  10. ariccio commented on Sep 2, 2025

    @ariccio

    Heh, I see part of the problem, or maybe all of it.

    The code that inspects the environment variable looks like:

    function NA2(A, B) {
      if (process.env.CLAUDE_CODE_SUBAGENT_MODEL) return process.env.CLAUDE_CODE_SUBAGENT_MODEL;
      if (!A) return VL(m40);
      return A === 'inherit' ? B : VL(A);
    }
    
    // elsewhere
    let M = NA2(N.model, X)
    
    
    // Where `n` appears to be the agent file model config:
    N = L.find((k1) => k1.agentType === B)
    
    // And `X` is a parameter
    mainLoopModel: X

    It needs a line of code in NA2 inserted to say something like:

      if (process.env.CLAUDE_CODE_SUBAGENT_MODEL) {
        if (process.env.CLAUDE_CODE_SUBAGENT_MODEL === 'inherit') {
          return B;
          }
        return process.env.CLAUDE_CODE_SUBAGENT_MODEL;
      }

    @claude can you fix your own source code like a benevolent version of a self-improving skynet? I don't think you can here because this repo contains none... maybe you can send an email to suggest the fix, or do something else to reach the right code owner here?

  11. ariccio commented on Sep 2, 2025

    @ariccio

    I'm mildly disappointed I cannot interact with @claude here
    shakes fist at clouds

  12. ariccio commented on Sep 6, 2025

    @ariccio

    This made me cranky enough again that I just went and added this to my .zshrc:

    alexanderriccio@Alexanders-MacBook-Pro ~ % tail -n 6 ~/.zshrc
    export CLAUDE_CODE_SUBAGENT_MODEL='opus'
    echo \
    "\n------NOTE------\n" \
    ">>>>>   AUTOMATICALLY SET CLAUDE_CODE_SUBAGENT_MODEL='opus' <<<<<\n" \
    " See: https://github.com/anthropics/claude-code/issues/4855\n"\
    "------NOTE------"
    
  13. github-actions commented on Dec 5, 2025

    @github-actions

    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.

  14. added
    autoclose
    on Dec 5, 2025
  15. github-actions commented on Jan 5, 2026

    @github-actions

    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.

  16. github-actions commented on Jan 14, 2026

    @github-actions

    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.

  17. locked as resolved and limited conversation to collaborators on Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api:bedrockarea:autharea:toolsautoclosebughas reproplatform:macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions