PaPoo
cover

authentication_error が出るとき、まず自分の症状かを切り分ける

Claude Code を使っていて 401authentication_error が急に出るなら、少なくとも今回集まっている報告では「認証が壊れた」というより、​セッション中に OAuth token の期限切れや再認証が必要になっているケースが中心でした。
ただし、同じ authentication_error でも issue は 2 系統あります。

ひとつは、#18225 のように、​長く使っていたセッションで突然 401 が出始め、/login を何度も求められるパターンです。報告者は「months 使っていて、today から始まった」と書いています。エラーメッセージは次のとおりです。

API Error: 401 {"type":"error","error":{"type":"authentication_error","message":"OAuth token has expired. Please obtain a new token or refresh your existing token."},"request_id":"req_011CX7zT7Swc35VFkEUZ57Fo"} · Please run /login

もうひとつは、#80179 のように、​Atlassian MCP connector で read は通るのに write が失敗し、再接続中に「no OAuth token」に落ちるという報告です。こちらは Atlassian 側のコネクタと Cloudflare のブロック画面が絡んでいて、症状の見え方がかなり違います。

なので、まず見るべき分岐は次の2つです。
/login を入れても短時間でまた 401 が出るなら #18225 側に近いです。
Atlassian MCP の read/write 差や reconnect 中の token 消失なら #80179 側が疑わしいです。

いま確認できていること

今回の一次情報では、筆者環境は macOS でしたが、claude doctor で少なくともインストール状態の気になる点が 1 つ見えています。
native 版が動いている一方で、npm global の残骸が残っていると出ています。

$ claude doctor
Claude Code doctor

Running: native (2.1.207)
Commit: bc512d563325
Platform: darwin-arm64
Path: ~/.local/share/claude/versions/2.1.207
Config install method: native
Search: OK (bundled)
Auto-updates: enabled
Auto-update channel: latest
Last update attempt: none recorded

Multiple installations found
- npm-global at /usr/local/bin/claude
- native at ~/.local/bin/claude

Remote Control
Control this session from claude.ai/code or the Claude mobile app

1 warning found
- Leftover npm global installation at /usr/local/bin/claude
  Fix: Run: npm -g uninstall @anthropic-ai/claude-code

For a full setup checkup that can also fix issues, run /doctor in a Claude Code session.

この出力だけからは、authentication_error の原因が複数インストールであるとまでは言えません。
ただ、​インストール経路が混在しているのは事実なので、再現がぶれるなら切り分け対象には入れてよさそうです。

CLI のバージョンはこれでした。

$ claude --version
2.1.207 (Claude Code)

この症状でやる順番

まず、/login を求められたらそのまま再認証して、​どのタイミングで再発するかを見ます。
5時間で3回 のように短い間隔で繰り返すなら、#18225 の報告とかなり近いです。

次に、使っているのが Atlassian MCP なら、read と write のどちらで落ちるかを分けて見ます。
#80179 では addCommentToJiraIssue が失敗し、Cloudflare の Sorry, you have been blocked が返るとされています。ここは通常の OAuth 期限切れとは見え方が違います。

最後に、claude doctor の結果で複数インストールが出ていないか確認します。今回の一次情報では、native と npm-global の両方が見つかっています。
現時点では、これが直接の原因だとは断定できませんが、少なくとも環境の不一致を疑う材料にはなります。

いまのところ言えること

この症状は、少なくとも issue 上では未解決です。
OAuth token has expired というメッセージが出るケースと、MCP connector が no OAuth token や Cloudflare ブロックに落ちるケースは、同じ authentication_error でも別物として扱ったほうがよさそうです。

筆者環境で確認できた範囲では、claude doctor に複数インストールの警告がありました。

Multiple installations found
- npm-global at /usr/local/bin/claude
- native at ~/.local/bin/claude

ここから先は、再発の条件を見ながら、どの issue に近いかを絞るのが現実的です。
少なくとも、authentication_error が出たからといってすぐに Atlassian 固有、あるいは CLI の全体障害だと決めつけないほうがいいです。


検証環境

claude --version : 2.1.207 (Claude Code)
OS          : Darwin 25.3.0 (arm64)
Python      : 3.14.2
検証日時    : 2026-08-11T18:14:07+09:00

参照した Issue(anthropics/claude-code): #18225, #80179

同じ著者の記事