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

Status Closed — not planned
Maintainer reply None cached
Activity 12 comments · opened Jul 31, 2025 · closed Jan 5, 2026

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [x] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • 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

View original on GitHub ↗

12 Comments

ZachK543 · 1 year ago

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

kkukshtel · 1 year ago

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.

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5737
  2. https://github.com/anthropics/claude-code/issues/5465
  3. https://github.com/anthropics/claude-code/issues/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

secustor · 1 year ago

The other issues seem to be unrelated.

ire4ever1190 · 1 year ago

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

secustor · 1 year ago

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

ariccio · 12 months ago

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?

ariccio · 12 months ago

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

ariccio · 11 months ago

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------"
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.