API Error: 401 {"type":"error","error":{"type":"authenticati...
Bug Description API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"Invalid OAuth token. The provided token was not found or is malformed."}}
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 1.0.44
- Feedback ID: b5e5486b-26ac-409a-b1c6-b839f8ac9f21
Errors
[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:892:11)\n at execSync (node:child_process:964:15)\n at wD (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:702:3921)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:9350\n at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n at uC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:8496)\n at hC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:7361)\n at wB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:11970)","timestamp":"2025-07-10T00:40:04.277Z"},{"error":"Error: Command failed: security delete-generic-password -a $USER -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:892:11)\n at execSync (node:child_process:964:15)\n at wD (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:702:3921)\n at TpA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:10462)\n at OpA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:10336)\n at k9A (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2125:2567)\n at e01.startOAuthFlow (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2125:3733)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-10T00:40:14.822Z"},{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:892:11)\n at execSync (node:child_process:964:15)\n at wD (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:702:3921)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:9350\n at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n at uC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:8496)\n at hC (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:7361)\n at wB (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:623:11970)","timestamp":"2025-07-10T00:40:14.890Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid OAuth token. The provided token was not found or is malformed.\"}}\n at D6.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n at gq.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n at gq.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:5311)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-10T00:40:29.556Z"},{"error":"SyntaxError: Unexpected token 'A', \"API Error:\"... is not valid JSON\n at JSON.parse (<anonymous>)\n at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:618:9971\n at Q (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:13327)\n at Lw2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1337:10306)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-07-10T00:40:29.567Z"},{"error":"Error: 401 {\"type\":\"error\",\"error\":{\"type\":\"authentication_error\",\"message\":\"Invalid OAuth token. The provided token was not found or is malformed.\"}}\n at D6.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1304:12612)\n at gq.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1321:2100)\n at gq.makeRequest (file:///opt/homebrew/
Note: Error logs were truncated.
Just ran into the same issue.
I tried logout and deleted ~/.claude and ~/.claude.json, then login again. Still the same error.
same error here, confirmed
same here
same here
same here
same here;)
Same here. https://status.anthropic.com/ doesn't show outage.
Good to see we're all here.
can we open an issue for a better error message? I got panic
Same problem。 what happend?
Same here
Same -- logged out/in, ran /doctor, restarted. issue remains
Same here
same here
Same here. https://status.anthropic.com/ doesn't show outage.
Yes. A basic message there would have been helpful, that reduces the panic to be honest. Also a command line switch to see such status in claudecode would be nice. The login issues are horrible, somewhat reduces with proxies sometimes.
same
+1
same here. /logout restarted machine , ran claude update /login
+1