Claude Code errors / Auth

API Error: 401 authentication_error: Invalid bearer token

platform: Claude Code / category: Auth / code: 401 / versions: 2.0.28

Cause

A regression in v2.0.28 made the stored bearer token invalid or unable to refresh, persisting across logout/login.

Fix

Run 'claude logout' then 'claude login' to force a new token. If it persists, remove ~/.claude/claude.json and any ANTHROPIC_AUTH_TOKEN/ANTHROPIC_BASE_URL env vars, reinstall with npm install -g @anthropic-ai/claude-code, and authenticate again.

Source thread →

Part of the Automation Error Index — Claude Code errors: browse all.

Hitting an automation error we have not covered?

AutomateLab builds and debugs n8n, Make, and agent workflows as fixed-scope projects. If something is broken in production, tell us what you are seeing.

Describe the problem