## 事象 ```console $ claude -p hello API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."}} ``` ### 環境 | 対象 | バージョン | | --------------- | ------------------- | | [[macOS]] | 15.5 | | [[Ghostty]] | 1.1.4-main+3e79c4b7 | | [[Claude Code]] | 1.0.43 | ## 原因 [[OAuth]]の[[アクセストークン (OAuth 2.0)|アクセストークン]]が有効期限を切れているから。 > [!question] リフレッシュされないのか? > 通常は[[リフレッシュトークン (OAuth 2.0)|リフレッシュトークン]]でリフレッシュされそうだけど... ## 解決方法 `claude` で[[Claude Code]]を立ち上げ、`/login` コマンドでログインしなおす。 ## 参考 - [ChatGPT - Claude Code 401 エラー](https://chatgpt.com/share/6869eb10-89e0-800a-8c24-6f2aa0dff431)