Users of Anthropic's Claude Code, particularly those on Pro or Max plans, may inadvertently incur API charges if the ANTHROPIC_API_KEY environment variable is set in their cron jobs. Claude Code prioritizes this API key over subscription credentials when running non-interactively, unlike its interactive mode which prompts the user. To avoid unexpected billing, users should explicitly unset the ANTHROPIC_API_KEY variable within their cron job configurations or utilize the CLAUDE_CODE_OAUTH_TOKEN for browser-based authentication, though this token also ranks below the API key. AI
IMPACT Users of Claude Code should verify their cron job configurations to prevent unintended API billing.
RANK_REASON The item discusses a configuration issue with a specific tool (Claude Code) and its interaction with environment variables, rather than a new release or significant industry event.
Read on dev.to — Claude Code tag →
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →