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

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

Open djsavvy opened this issue 8 months ago • 4 comments

Environment

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

djsavvy avatar Jul 06 '25 01:07 djsavvy

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.

avelops avatar Aug 01 '25 11:08 avelops

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

iamriajul avatar Aug 17 '25 04:08 iamriajul

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] avatar Dec 05 '25 10:12 github-actions[bot]

Still present in version 2.0.76

shivros avatar Dec 23 '25 18:12 shivros

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] avatar Jan 24 '26 10:01 github-actions[bot]

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.

marcindulak avatar Jan 24 '26 11:01 marcindulak

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.

github-actions[bot] avatar Feb 01 '26 14:02 github-actions[bot]