[BUG] print mode (-p) doesn't seem to be using my claude max subscription, instead pulling an API key from the environment

Status Closed — not planned
Maintainer reply None cached
Activity 7 comments · opened Jul 6, 2025 · closed Jan 24, 2026

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.43 (Claude Code)
  • Operating System: macos 15.3.1
  • Terminal: ghostty

Bug Description

Running a command like: claude -p --output-format stream-json --verbose "hello there" is deducting from my API key despite me being logged into my claude max subscription locally. This should instead authorize via my claude max subscription (which I'm already logged into), instead of pulling from the ambient ANTHROPIC_API_KEY variable.

View original on GitHub ↗

7 Comments

avelops · 1 year ago

I got that too on windows native claude code 1.0.65
node 24.4.1

for now the workaround i use the remove it from environment prior to use.

iamriajul · 1 year ago

+1 I'm facing this too with Coder workspace.

github-actions[bot] · 10 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.

shivros · 9 months ago

Still present in version 2.0.76

github-actions[bot] · 8 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.

marcindulak · 8 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 8 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.