> ## Documentation Index
> Fetch the complete documentation index at: https://code.claude.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# エラーリファレンス

> Claude Code のランタイムエラーメッセージを検索し、各エラーの意味と修正方法を確認できます。

このページでは、Claude Code が表示するランタイムエラーと各エラーからの復旧方法、および応答がエラーなしで問題があるように見える場合に確認すべき内容を一覧表示しています。セットアップ中の `command not found` や TLS エラーなどのインストールエラーについては、[インストールとログインのトラブルシューティング](https://code.claude.com/docs/ja/troubleshoot-install.md)を参照してください。

[ラッパーと IDE エラー](#wrapper-and-ide-errors)は Claude Code 自体ではなく起動元のプログラムが出力するものですが、これを除き、これらのエラーと復旧コマンドは CLI、[Desktop アプリ](https://code.claude.com/docs/ja/desktop.md)、および[クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md)全体に適用されます。これら 3 つはすべて同じ Claude Code CLI をラップしているためです。その他のサーフェス固有の問題については、そのサーフェスのページのトラブルシューティングセクションを参照してください。

> [!NOTE]
>
> Claude Code は Claude API を呼び出してモデルレスポンスを取得するため、ほとんどのランタイムエラーは基盤となる API エラーコードにマップされます。このページでは、Claude Code 内での各エラーの意味と復旧方法について説明しています。生の HTTP ステータスコード定義については、[Claude Platform エラーリファレンス](https://platform.claude.com/docs/en/api/errors)を参照してください。

## エラーを探す

表示されたメッセージに対応するセクションを以下から見つけてください。

| メッセージ | セクション |
| :- | :- |
| `API Error: 500 Internal server error` | [サーバーエラー](#api-error-500-internal-server-error) |
| `API Error: Repeated 529 Overloaded errors` | [サーバーエラー](#api-error-repeated-529-overloaded-errors) |
| `Opus is experiencing high load` / `Fable is experiencing high load` | [サーバーエラー](#api-error-repeated-529-overloaded-errors) |
| `Request timed out` | [サーバーエラー](#request-timed-out)、またはメッセージにインターネット接続への言及がある場合は [ネットワーク](#unable-to-connect-to-api) |
| `API Error: No response from API` | [サーバーエラー](#no-response-from-api) |
| `API Error: Stream idle timeout - no chunks received` | [ストリーミングのアイドルウォッチドッグ](https://code.claude.com/docs/ja/network-config.md#streaming-idle-watchdogs)、または Claude apps gateway 経由の場合は [長い思考がプロキシのタイムアウトで終了する](https://code.claude.com/docs/ja/claude-apps-gateway-deploy.md#long-thinking-ends-in-proxy-timeouts) |
| `Server error mid-response. The response above may be incomplete.` | [サーバーエラー](#the-response-above-may-be-incomplete) |
| `Connection lost mid-response` / `Your computer went to sleep mid-response` / `The response stopped arriving` | [サーバーエラー](#the-response-above-may-be-incomplete) |
| `Connection closed mid-response` / `Response stalled mid-stream` | [サーバーエラー](#the-response-above-may-be-incomplete) |
| `Part of the response never arrived` / `The response stream was malformed` | [サーバーエラー](#the-response-above-may-be-incomplete) |
| `API Error: Content block not found` / `API Error: Content block already closed` / `API Error: Stream event unreadable` | [サーバーエラー](#the-response-above-may-be-incomplete) |
| `Connection lost before a response was produced` / `Your computer went to sleep before a response was produced` / `The response stalled before a response was produced` | [自動再試行](#automatic-retries) |
| `Connection closed while thinking` / `Response stalled while thinking` | [自動再試行](#automatic-retries) |
| `Connection lost while your computer was asleep` | [自動再試行](#automatic-retries) |
| `The model's tool call could not be parsed (retry also failed).` | [自動再試行](#automatic-retries) |
| `<model> is temporarily unavailable, so auto mode cannot determine the safety of...` | [サーバーエラー](#auto-mode-cannot-determine-the-safety-of-an-action) |
| `Auto mode could not evaluate this action and is blocking it for safety` | [サーバーエラー](#auto-mode-cannot-determine-the-safety-of-an-action) |
| `Not run · auto mode's check had no usable answer` | [サーバーエラー](#auto-mode-cannot-determine-the-safety-of-an-action) |
| `Auto mode classifier transcript exceeded context window` | [サーバーエラー](#auto-mode-cannot-determine-the-safety-of-an-action) |
| `Agent aborted: auto mode classifier request refused by the safety safeguard` | [サーバーエラー](#auto-mode-cannot-determine-the-safety-of-an-action) |
| `The server-side auto mode classifier gave no verdict` | [サーバーエラー](#the-server-returned-no-safety-verdict) |
| `<tool> was not reviewed and did not run: the conversation is too long for auto mode's classifier` | [サーバーエラー](#was-not-reviewed-and-did-not-run) |
| `Auto mode is unavailable — the server returned no safety verdict for the last 10 responses` | [サーバーエラー](#the-server-returned-no-safety-verdict) |
| `Agent terminated early due to an API error` | [サーバーエラー](#agent-terminated-early-due-to-an-api-error) |
| `You've hit your session limit` / `You've hit your weekly limit` / `You've hit your Opus limit` / `You've hit your Sonnet limit` | [使用制限](#youve-hit-your-session-limit) |
| `Usage credits required for 1M context` | [使用制限](#usage-credits-required-for-1m-context) |
| `Usage credits ran out before the response was finished.` | [使用クレジットを追加する](https://code.claude.com/docs/ja/costs.md#add-usage-credits-to-your-subscription) |
| `the prompt to confirm went unanswered · nothing was sent`（v2.1.324 以降） | [使用制限](#the-prompt-to-confirm-went-unanswered) |
| `Claude stopped here · send a message to be asked again` | [使用制限](#the-prompt-to-confirm-went-unanswered) |
| `Server is temporarily limiting requests` | [使用制限](#server-is-temporarily-limiting-requests) |
| `Request rejected (429)` | [使用制限](#request-rejected-429) |
| `Credit balance is too low` | [使用制限](#credit-balance-is-too-low) |
| `You've hit your monthly spend limit` / `You've hit your individual spend limit` / `You've hit your org's monthly spend limit` / `You've hit your channel's monthly spend limit` / `You've hit your team's shared budget` / `You've hit your individual usage limit` | [使用制限](#youve-hit-your-monthly-spend-limit) |
| `Could not update your spend limit` / `Could not remove your spend limit` | [使用制限](#could-not-update-your-spend-limit) |
| `spend limit reached` / `spend limit unavailable` / `This request exceeds your group's budget` | [使用制限](#spend-limit-reached) |
| `Not logged in · Please run /login` | [認証](#not-logged-in) |
| `Couldn't save your login` | [認証](#couldnt-save-your-login) |
| `Sign in again to take your previous account or API key off the config file.` | [認証](#sign-in-again-to-take-your-previous-account-or-api-key-off-the-config-file) |
| `Your account or API key may still be in the config file. Run claude auth logout.` | [認証](#your-account-or-api-key-may-still-be-in-the-config-file) |
| `Authentication required · Sign in again to continue` | [認証](#not-logged-in) |
| `Sign in again to continue` の後に `For security, Claude Code needs a recent sign-in.` が続くもの | [ラッパーと IDE のエラー](#claude-code-needs-a-recent-sign-in) |
| `Claude Code needs a recent sign-in. Signing in won’t stop sessions.` | [ラッパーと IDE のエラー](#claude-code-needs-a-recent-sign-in) |
| `Could not resolve authentication method` | [認証](#could-not-resolve-authentication-method) |
| `Invalid API key` | [認証](#invalid-api-key) |
| `Your apiKeyHelper script is failing` | [認証](#your-apikeyhelper-script-is-failing) |
| `Your organization's settings need an update` | [認証](#claude-code-didnt-send-your-claude-ai-login) |
| `Couldn't load your organization's settings. Check your connection` | [認証](#claude-code-didnt-send-your-claude-ai-login) |
| `Restart Claude Code to finish signing in` | [認証](#claude-code-didnt-send-your-claude-ai-login) |
| `Invalid auth token · Fix external auth token` | [認証](#invalid-request-header-value) |
| `Invalid ANTHROPIC_CUSTOM_HEADERS · Fix the environment variable` | [認証](#invalid-request-header-value) |
| `Invalid request header from the environment · Fix the environment variable` | [認証](#invalid-request-header-value) |
| `This organization has been disabled` | [認証](#this-organization-has-been-disabled) |
| `Your organization has disabled API key authentication` | [認証](#your-organization-has-disabled-api-key-authentication) |
| `Your organization has disabled Claude subscription access` | [認証](#your-organization-has-disabled-claude-subscription-access) |
| `Scheduled tasks are off for your organization` | [認証](#routines-are-disabled-by-your-organizations-policy) |
| `Routines are off for your organization` | [認証](#routines-are-disabled-by-your-organizations-policy) |
| `Remote Control is only available when using Claude via api.anthropic.com` | [認証](#remote-control-requires-the-anthropic-api) |
| `OAuth token refresh failed — run /login to re-authenticate` | [認証](#remote-control-couldnt-refresh-your-login) |
| `JWT refresh failed: no OAuth token — run /login` | [認証](#remote-control-couldnt-refresh-your-login) |
| `Claude.ai login expired` | [認証](#remote-control-couldnt-refresh-your-login) |
| `Claude.ai login was rejected — run /login, then /remote-control` | [認証](#remote-control-couldnt-refresh-your-login) |
| `OAuth token unavailable — run /login to restore Remote Control` | [認証](#remote-control-couldnt-refresh-your-login) |
| `Signed out of Claude — run /login, then /remote-control` | [認証](#remote-control-couldnt-refresh-your-login) |
| `Remote Control could not renew this computer's connection` | [認証](#remote-control-could-not-renew-this-computers-connection) |
| `signed-in claude.ai account or organization changed on this machine` | [認証](#remote-control-stopped-because-the-signed-in-account-changed) |
| `Remote Control stopped — the app running this session is now signed in to a different Claude account` | [認証](#remote-control-stopped-because-the-app-running-the-session-signed-out-or-switched-accounts) |
| `Remote Control stopped — the app running this session is signed out of Claude` | [認証](#remote-control-stopped-because-the-app-running-the-session-signed-out-or-switched-accounts) |
| `Couldn't verify your organization's policy for remote control` | [Remote Control のトラブルシューティング](https://code.claude.com/docs/ja/remote-control.md#couldnt-verify-your-organizations-policy-for-remote-control) |
| `Remote Control didn't finish connecting` | [Remote Control セッションを開始する](https://code.claude.com/docs/ja/remote-control.md#start-a-remote-control-session) |
| `Remote Control is disabled by your organization's policy` | [Remote Control のトラブルシューティング](https://code.claude.com/docs/ja/remote-control.md#remote-control-is-disabled-by-your-organizations-policy) |
| `Remote Control was turned off by your organization's policy` | [Remote Control のトラブルシューティング](https://code.claude.com/docs/ja/remote-control.md#remote-control-was-turned-off-by-your-organizations-policy) |
| `Session failed: working folder not found:` | [Remote Control のトラブルシューティング](https://code.claude.com/docs/ja/remote-control.md#working-folder-not-found) |
| `The program file this Remote Control started from is gone` | [Remote Control のトラブルシューティング](https://code.claude.com/docs/ja/remote-control.md#program-file-is-gone) |
| `Session failed: program not found:` | [Remote Control のトラブルシューティング](https://code.claude.com/docs/ja/remote-control.md#program-file-is-gone) |
| `Session failed: spawn error:` の後に `ENOENT` メッセージが続くもの | [Remote Control のトラブルシューティング](https://code.claude.com/docs/ja/remote-control.md#program-file-is-gone) |
| `Remote Control disconnected:` の後に `share link` に言及する理由が続くもの | [Remote Control](https://code.claude.com/docs/ja/remote-control.md#what-connected-devices-see) |
| `OAuth token revoked` / `OAuth token has expired` | [認証](#oauth-token-revoked-or-expired) |
| `Failed to authenticate: OAuth token revoked` | [認証](#oauth-token-revoked-or-expired) |
| `Your account does not have access to Claude. Please login again or contact your administrator.` | [認証](#oauth-token-revoked-or-expired) |
| `API Error: 401 Invalid authentication credentials` | [認証](#api-error-401-invalid-authentication-credentials) |
| `Login expired · Please run /login` | [認証](#login-expired) |
| クラウドセッションでの `Authentication error · This may be a temporary network issue` | メッセージを再送信してください。 |
| エージェントビューでの `login required — run /login` | その後にこの表に記載されたメッセージが続く場合は、その行を参照してください。それ以外の場合は `/login` を実行してください。 |
| `Warning: this sign-in` | [保存されたログインの終了日時を確認する](https://code.claude.com/docs/ja/authentication.md#check-when-a-stored-login-ends) |
| `The browser can't return the sign-in to Claude Code automatically` | [認証](#couldnt-start-the-local-sign-in-listener) |
| `Couldn't start the local listener that receives the browser sign-in. Try again.` | [認証](#couldnt-start-the-local-sign-in-listener) |
| `Failed to start OAuth callback server` | [認証](#failed-to-start-oauth-callback-server) |
| `Claude login not accepted · Run /login, then try again` | [認証](#claude-login-not-accepted) |
| `Artifacts need a claude.ai login` | [認証](#artifacts-need-a-claude-ai-login) |
| `Your authentication token belongs to organization` | [ログインを組織に制限する](https://code.claude.com/docs/ja/authentication.md#restrict-login-to-your-organization) |
| `Not signed in to the Cloud gateway — run /login.` | [認証](#administrator-policy-requires-a-cloud-gateway-sign-in) |
| `Administrator policy requires a Cloud gateway sign-in on this machine` | [認証](#administrator-policy-requires-a-cloud-gateway-sign-in) |
| `Managed settings on this machine configure a Cloud gateway sign-in; run interactive /login to authenticate.` | [`claude auth login`](https://code.claude.com/docs/ja/cli-reference#cli-commands) |
| `You chose an organization that is managed in Anthropic's Enterprise Admin Console` | [Claude Code からのサインインを有効にする](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#turn-on-sign-in-from-claude-code) |
| `The organization's settings won't apply on this computer` | [どの設定が優先されるか](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#which-settings-take-priority) |
| `no usable organization sign-in` / `no readable organization sign-in` | [サインインが終了したとき](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#when-a-sign-in-ends) |
| `the session no longer runs under that sign-in` / `This Claude Code process ran under your organization` / `After a sign-in to your organization, only a new session sends requests` / `Claude Code needs to restart to use it` | [Claude Code にログインする](https://code.claude.com/docs/ja/authentication.md#log-in-to-claude-code) |
| `This conversation ran under organization` / `This conversation ran under more than one organization` | [Claude Code にログインする](https://code.claude.com/docs/ja/authentication.md#log-in-to-claude-code) |
| `Claude Code could not read the managed settings that apply to this computer, which may require a sign-in to Anthropic` | [`enforceAnthropicSignIn`](https://code.claude.com/docs/ja/settings-reference#enforceanthropicsignin) |
| `This computer's managed settings require a sign-in to Anthropic` / `This computer's settings require a sign-in to Anthropic that this app cannot use` | [サインインを必須にする](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code#require-the-sign-in-with-managed-settings) |
| `This computer's managed settings set the Microsoft Foundry key or token in use` / `This computer's managed settings could not be read, so the Microsoft Foundry key or token in use may be theirs` | [コンソールと競合する管理設定](https://claude.com/docs/third-party/claude-desktop/admin-console-claude-code-reference#managed-settings-that-conflict-with-the-console) |
| `Failed to authenticate: OAuth session expired and could not be refreshed` | [認証](#login-expired) |
| `Login reached its time limit · Please run /login` / `Failed to authenticate: this login reached its time limit` | [認証](#login-expired) |
| `Failed to authenticate: your claude.ai login expired` | [ログインの有効期限が切れた後](https://code.claude.com/docs/ja/authentication.md#after-the-login-expires) |
| `claude.ai login ended · usage now billed to` / `Warning: the claude.ai login on this machine has ended` | [ログインの有効期限が切れた後](https://code.claude.com/docs/ja/authentication.md#after-the-login-expires) |
| `The refresh token in CLAUDE_CODE_OAUTH_REFRESH_TOKEN was used for this attempt` | その上に表示された拒否の原因を修正してから、[`CLAUDE_CODE_OAUTH_REFRESH_TOKEN`](https://code.claude.com/docs/ja/env-vars#variables) に新しいトークンを設定します。 |
| `Could not refresh your login because another Claude Code process is refreshing it` | [認証](#could-not-refresh-your-login) |
| `Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh` | [認証](#could-not-refresh-your-login) |
| `Could not refresh your login: the disk that holds the Claude Code config directory (~/.claude by default), or your disk quota on it, is full` | [認証](#could-not-refresh-your-login-disk-full) |
| `Failed to refresh OAuth token: the disk that holds the Claude Code config directory (~/.claude by default), or your disk quota on it, is full` | [認証](#could-not-refresh-your-login-disk-full) |
| `Your account is on hold and can't use Claude Code. View details or appeal: https://claude.ai/restricted` | [認証](#your-account-is-on-hold) |
| `This account is on hold and can't sign in` / `This Claude Design account is on hold` / `The account signed in to Claude Design is on hold` | メッセージ内のリンクを開いて、詳細を確認するか異議を申し立ててください。 |
| `Your account is on hold and can't sign in to Claude Code. View details or appeal: https://claude.ai/restricted` | [認証](#your-account-is-on-hold) |
| `Anthropic profile login expired · Re-authenticate your Anthropic profile` | [認証](#anthropic-profile-login-expired) |
| `Login expired · Run /login to sign in again, or re-authenticate your Anthropic profile` | [認証](#anthropic-profile-login-expired) |
| `Anthropic profile login expired · Run /login to use your claude.ai account instead, or re-authenticate the profile` | [認証](#anthropic-profile-login-expired) |
| `does not meet scope requirement user:profile` | [認証](#oauth-scope-requirement) |
| `claude.ai rejected the session token` / `session token rejected` | [認証](#claude-ai-rejected-the-session-token) |
| `MCP server "<name>" needs you to sign in again (run /mcp to re-authenticate)` | [認証](#mcp-server-needs-you-to-sign-in-again) |
| `rejected the credential from its headersHelper` / `rejected the Authorization header in its config` | [認証](#mcp-server-needs-you-to-sign-in-again) |
| `(check the helper, then start a new task or chat)` / `(update it, then start a new task or chat)` | [認証](#mcp-credential-rejected-in-cowork) |
| `MCP server "<name>" needs additional permissions (scope: "<scope>") — run /mcp to re-authenticate` | [認証](#mcp-server-needs-you-to-sign-in-again) |
| `MCP server "<name>" requires re-authorization (token expired)` | [認証](#mcp-server-needs-you-to-sign-in-again) |
| `Couldn't read the stored credentials for MCP server "<name>", so the request didn't run` | [認証](#couldnt-read-the-stored-credentials-for-mcp-server) |
| `A request to MCP server "<name>" was sent without your stored credentials` | [認証](#couldnt-read-the-stored-credentials-for-mcp-server) |
| `This server's URL is missing or not a valid URL, so sign-in can't start` | [認証](#mcp-server-url-is-missing-or-not-a-valid-url) |
| `Issuer mismatch in authorization response (RFC 9207)` | [認証](#issuer-mismatch-in-authorization-response) |
| `Stopped an OAuth request` | [認証](#stopped-an-oauth-request) |
| `Refusing to send credentials to non-https token endpoint` / `<short-name> from the MCP SDK for <server-url>` | [認証](#refusing-to-send-credentials-to-non-https-token-endpoint) |
| `Cloud gateway session expired — run /login to reconnect.` | [認証](#cloud-gateway-session-expired) |
| `Cloud gateway <url> no longer accepts this session` | [認証](#cloud-gateway-session-expired) |
| `Sign-in timed out while waiting for you to continue. Try again.` | [認証](#sign-in-timed-out-while-waiting-for-you-to-continue) |
| `AWS credentials expired or invalid` | [認証](#aws-credentials-expired-or-invalid) |
| `AWS authentication failed` | [認証](#aws-authentication-failed) |
| `Google Cloud credentials expired or invalid` | [認証](#google-cloud-credentials-expired-or-invalid) |
| `Google Cloud authentication failed` | [認証](#google-cloud-authentication-failed) |
| `Microsoft Foundry authentication failed` | [認証](#microsoft-foundry-authentication-failed) |
| `Gateway refused the request` | [認証](#gateway-refused-the-request) |
| `Could not load AWS credentials` / `Could not load Google Cloud credentials` | [認証](#could-not-load-aws-or-google-cloud-credentials) |
| `AWS default-chain credential resolve timed out` | [認証](#aws-default-chain-credential-resolve-timed-out) |
| `Timed out after 60s waiting for AWS` | [認証](#bedrock-setup-verification-timed-out-waiting-for-aws) |
| `A request to AWS timed out. Check your network and proxy settings, then try again.` | [認証](#bedrock-setup-verification-timed-out-waiting-for-aws) |
| Google Cloud の Agent Platform での `Could not load the default credentials` | [認証](#could-not-load-aws-or-google-cloud-credentials) |
| `Unable to connect to API` | [ネットワーク](#unable-to-connect-to-api) |
| `Connection refused —` / `Can't reach the API server —` / `No internet route —` / `Couldn't connect through your proxy` / `Connection dropped`（いずれも括弧内にエラーコード付き） | [ネットワーク](#unable-to-connect-to-api) |
| セットアップ中の `Unable to connect to Anthropic services` | [ネットワーク](#unable-to-connect-to-anthropic-services) |
| `Unable to fetch your privacy settings at this time` | [claude.ai のプライバシー設定](https://claude.ai/settings/data-privacy-controls) |
| `Socket is closed` | [ネットワーク](#socket-is-closed) |
| `Waiting for API response · will retry in` | [自動再試行](#automatic-retries)、または解消しない場合は [ネットワーク](#unable-to-connect-to-api) |
| `API returned an empty or malformed response` | [ネットワーク](#api-returned-an-empty-or-malformed-response) |
| `Streaming response ended before any complete data was received` | [ネットワーク](#streaming-response-ended-before-any-complete-data-was-received) |
| `Bedrock streaming response has content-type "..."; expected "application/vnd.amazon.eventstream"` | [ネットワーク](#bedrock-streaming-response-has-an-unexpected-content-type) |
| `Claude Code used only the certificates that it could read in full from the NODE_EXTRA_CA_CERTS file` / `Claude Code ignored all of the NODE_EXTRA_CA_CERTS file: it holds no certificate that Claude Code can read` | [カスタム CA 証明書](https://code.claude.com/docs/ja/network-config.md#custom-ca-certificates) |
| `SSL certificate verification failed` | [ネットワーク](#ssl-certificate-errors) |
| ログインまたは起動時の `SSL certificate error (...)` | [ネットワーク](#ssl-certificate-errors) |
| `unable to get local issuer certificate` | [ネットワーク](#ssl-certificate-errors) |
| クラウドセッションまたはクラウドのスケジュールタスクでの `x-deny-reason: host_not_allowed` 付きの `403` | [ネットワーク](#host-not-allowed-in-a-cloud-session) |
| `proxy refused the connection` | [ネットワーク](#the-proxy-refused-the-connection) |
| クラウドセッションでの `GitHub GraphQL is not available from Claude Code sessions` 付きの `403` | [GitHub プロキシ](https://code.claude.com/docs/ja/cloud-environments.md#github-proxy) |
| `In this cloud session a host fails to resolve like this` を伴う `ENOTFOUND` | [ネットワーク](#host-not-allowed-in-a-cloud-session) |
| `The cloud environments service returned an empty response` / `The cloud environments service returned a response in an unexpected format` | [ネットワーク](#the-cloud-environments-service-returned-an-empty-or-unexpected-response) |
| `Failed to fetch session from Sessions API: Failed to fetch session logs` | [ネットワーク](#failed-to-fetch-session-from-sessions-api) |
| `Couldn't load the history of cloud session` | [ネットワーク](#couldnt-load-the-history-of-cloud-session) |
| `Couldn't reconnect to your Remote Control session` | [Remote Control のトラブルシューティング](https://code.claude.com/docs/ja/remote-control.md#couldnt-reconnect-to-your-remote-control-session) |
| `N sessions ended while this machine was offline — the environment was cleaned up on the server and can't be resumed.` | [ネットワーク](#sessions-ended-while-this-machine-was-offline) |
| `Couldn't share the transcript.` | [ネットワーク](#couldnt-share-the-transcript) |
| `Couldn't send feedback` | [ネットワーク](#couldnt-send-feedback) |
| `Feedback payload too large. Try again without the transcript, or shorten the details.` | [ネットワーク](#feedback-payload-too-large) |
| `MCP server "<name>" connection timed out. Your computer went to sleep or its clock changed while connecting.` | [ネットワーク](#mcp-server-connection-timed-out-during-a-sleep-or-clock-change) |
| `Prompt is too long` / `Input is too long for requested model` | [リクエストエラー](#prompt-is-too-long) |
| `Prompt is too long · automatic compaction failed:` | [リクエストエラー](#prompt-is-too-long) |
| `Prompt is too long · this conversation is a single exchange` / `A single-exchange conversation cannot be compacted` | [リクエストエラー](#prompt-is-too-long) |
| `Context limit reached · /compact or /clear to continue` | [リクエストエラー](#prompt-is-too-long) |
| `Context limit reached · /clear to continue` | [リクエストエラー](#prompt-is-too-long) |
| Claude apps gateway セッションでの `capability_rejected: prompt_too_long` | [リクエストエラー](#prompt-is-too-long) |
| Claude apps gateway セッションでの `upstream rejected the request` / `request too large for this upstream` | [アップストリームのエラーメッセージ](https://code.claude.com/docs/ja/claude-apps-gateway-config.md#upstream-error-messages) |
| Claude apps gateway セッションでの `upstream rate limit exceeded` | [アップストリームのエラーメッセージ](https://code.claude.com/docs/ja/claude-apps-gateway-config.md#upstream-error-messages) |
| Claude apps gateway セッションでの `all upstreams failed (N attempted)` | [アップストリームのエラーメッセージ](https://code.claude.com/docs/ja/claude-apps-gateway-config.md#upstream-error-messages) |
| Claude apps gateway へのサインイン後の `Claude Code may not be enabled for your organization` | [Claude apps gateway のトラブルシューティング](https://code.claude.com/docs/ja/claude-apps-gateway-deploy.md#troubleshooting) |
| `/context` の出力内の `Context exceeds the ...-token limit by ... tokens` | [リクエストエラー](#context-exceeds-the-token-limit) |
| `Request too large` | [リクエストエラー](#request-too-large) |
| `Request too large for the API's 32MB request limit` | [リクエストエラー](#request-too-large) |
| `Image was too large` | [リクエストエラー](#image-was-too-large) |
| `API Error: an image in the conversation could not be processed and was removed` | [リクエストエラー](#image-was-too-large) |
| `An image in the conversation exceeds the dimension limit for many-image requests` | [リクエストエラー](#image-was-too-large) |
| `Unable to resize image` | [リクエストエラー](#unable-to-resize-image) |
| `Request rejected as unprocessable by the model` | [リクエストエラー](#request-rejected-as-unprocessable-by-the-model) |
| `PDF too large` / `PDF is password protected` / `pdftoppm is not installed` | [リクエストエラー](#pdf-errors) |
| `Extra inputs are not permitted` | [リクエストエラー](#extra-inputs-are-not-permitted) |
| `API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid` / `Property keys should match pattern` | [リクエストエラー](#tool-input-schema-is-invalid) |
| `/mcp` でサーバーの横に表示される `N tools left out` / `Claude wasn't given N tools because the Anthropic API would reject their input schemas` | [無効な入力スキーマを持つツール](https://code.claude.com/docs/ja/mcp.md#tools-with-invalid-input-schemas) |
| `Tool "mcp__<server>__<tool>" is not sent to Claude: its name has <N> characters and the API accepts at most 128` | [リクエストエラー](#mcp-tool-name-over-128-characters) |
| `tools.N.custom.name: String should have at most 128 characters` | [リクエストエラー](#mcp-tool-name-over-128-characters) |
| `tool_use.name: String should have at most 200 characters` | [リクエストエラー](#tool-use-name-over-200-characters) |
| `There's an issue with the selected model` | [リクエストエラー](#theres-an-issue-with-the-selected-model) |
| `Model ... is not a recognized model id` | [リクエストエラー](#model-is-not-a-recognized-model-id) |
| `Model ... not found` | [リクエストエラー](#model-not-found) |
| `Couldn't confirm model ... with the API` | [リクエストエラー](#couldnt-confirm-model-with-the-api) |
| `API error: ... · model not changed` | [リクエストエラー](#api-error-model-not-changed) |
| `Claude Opus is not available with the Claude Pro plan` | [リクエストエラー](#claude-opus-is-not-available-with-the-claude-pro-plan) |
| `Claude Code ... does not support this model; version ... or newer is required` | [リクエストエラー](#claude-code-does-not-support-this-model) |
| `Claude Code ... is older than the minimum version required by your organization's policy` | [リクエストエラー](#claude-code-does-not-support-this-model) |
| `Model ... is restricted by your organization's settings` | [リクエストエラー](#model-is-restricted-by-your-organizations-settings) |
| `Model ... is not available. Your organization restricts model selection.` | [リクエストエラー](#model-is-restricted-by-your-organizations-settings) |
| `Can't switch to the default model` | [リクエストエラー](#cant-switch-to-the-default-model) |
| `Model switch ... blocked by a PreModelSwitch hook` | [リクエストエラー](#model-switch-was-blocked-by-a-premodelswitch-hook) |
| `couldn't save it as your default` / `couldn't confirm it was saved as your default` | [リクエストエラー](#couldnt-save-it-as-your-default) |
| `is less capable than the current main model` / `Advisor will not activate on the main model` / `cannot advise` | [リクエストエラー](#advisor-is-less-capable-than-the-current-main-model) |
| `thinking.type.enabled is not supported for this model` | [リクエストエラー](#thinking-type-enabled-is-not-supported-for-this-model) |
| `Effort '<level>' isn't available with thinking turned off on this model` | [リクエストエラー](#effort-isnt-available-with-thinking-turned-off) |
| `effort '<level>' is not supported when thinking is disabled` | [リクエストエラー](#effort-isnt-available-with-thinking-turned-off) |
| `API Error: 400 Invalid effort level` / `Your organization limits effort for <model>, so Claude Code is using '<level>' instead of '<level>'` | [組織の effort 制限](https://code.claude.com/docs/ja/model-config.md#organization-effort-limits) |
| `max_tokens must be greater than thinking.budget_tokens` | [リクエストエラー](#thinking-budget-exceeds-output-limit) |
| `Claude's response exceeded the ... output token maximum` | [リクエストエラー](#response-exceeded-the-output-token-maximum) |
| `API Error: 400 due to tool use concurrency issues` | [リクエストエラー](#tool-use-or-thinking-block-mismatch) |
| `API Error: 400 orphaned tool_result in conversation history` | [リクエストエラー](#tool-use-or-thinking-block-mismatch) |
| `API Error: 400 duplicate tool_use ID in conversation history` | [リクエストエラー](#tool-use-or-thinking-block-mismatch) |
| `Invalid data in redacted_thinking block` | [リクエストエラー](#invalid-data-in-redacted-thinking-block) |
| `[Unsupported tool content removed]` | [リクエストエラー](#unsupported-tool-content-removed) |
| `role 'system' must precede an 'assistant' message` | [リクエストエラー](#role-system-must-precede-an-assistant-message) |
| `Invalid encrypted_content in search_result block` / `Invalid encrypted_index in text block` / `Failed to decrypt web search result content` | [リクエストエラー](#invalid-encrypted-content-in-search-result-block) |
| `Invalid encrypted_stdout in encrypted_code_execution_result block` | [リクエストエラー](#invalid-encrypted-content-in-search-result-block) |
| 再開したセッションの毎ターンで表示される `server_tool_use.name: Input should be` | [リクエストエラー](#unsupported-tool-content-removed) |
| `<model> can't help with this. Start a new session to continue` | [リクエストエラー](#usage-policy-refusal) |
| `Claude Code is unable to respond to this request, which appears to violate our Usage Policy` | [リクエストエラー](#usage-policy-refusal) |
| `<model>'s safeguards flagged this message` | [リクエストエラー](#safety-measures-flagged-a-cybersecurity-topic) |
| `<model>'s safeguards flagged this session` | [リクエストエラー](#safety-measures-flagged-a-cybersecurity-topic) |
| `<model> has safety measures that flagged this message for a cybersecurity topic` | [リクエストエラー](#safety-measures-flagged-a-cybersecurity-topic) |
| `` Details: `[reasoning_extraction]` `` | [リクエストエラー](#safeguards-flagged-a-request-for-claudes-reasoning) |
| `API Error: Output blocked by content filtering policy` | [リクエストエラー](#output-blocked-by-content-filtering-policy) |
| `Installation was killed before it could finish (exit code 137)` | [インストールとログインのトラブルシューティング](https://code.claude.com/docs/ja/troubleshoot-install.md#installation-was-killed-before-it-could-finish) |
| `The connection dropped while downloading the update` | [インストールとログインのトラブルシューティング](https://code.claude.com/docs/ja/troubleshoot-install.md#the-connection-dropped-while-downloading-the-update) |
| `Download timed out: exceeded the total deadline` | [インストールとログインのトラブルシューティング](https://code.claude.com/docs/ja/troubleshoot-install.md#the-connection-dropped-while-downloading-the-update) |
| `Release verification failed for Claude Code <version> (<reason>). The update was not installed.` | [インストールとログインのトラブルシューティング](https://code.claude.com/docs/ja/troubleshoot-install.md#release-verification-failed) |
| `Auto-update failed · Run claude doctor` | [インストールとログインのトラブルシューティング](https://code.claude.com/docs/ja/troubleshoot-install.md#auto-update-failed) |
| `--bg and --print conflict` | [コマンドラインエラー](#conflict-between-bg-and-print) |
| `Couldn't tell whether --bg is a flag or text here, so nothing was started` | [コマンドラインエラー](#couldnt-tell-whether-bg-is-a-flag-or-text) |
| `Error: Cannot use both --append-subagent-system-prompt and --append-subagent-system-prompt-file. Please use only one.` | [コマンドラインエラー](#conflict-between-a-system-prompt-flag-and-its-file-form) |
| `Error: bypassPermissions not supported in restricted mode` | [restricted モード](https://code.claude.com/docs/ja/permission-modes.md#restricted-mode-refuses-bypasspermissions) |
| `Session was started with bypass permissions, so plan mode won't ask before most edits or commands` | [plan モード](https://code.claude.com/docs/ja/permission-modes.md#analyze-before-you-edit-with-plan-mode) |
| `Cloud sessions cannot be created from a --restricted session` | [コマンドラインエラー](#cloud-sessions-cannot-be-created-from-a-restricted-session) |
| `--fork-session can't fork a cloud session, so nothing was opened or sent` | [クラウドセッションへの送信時のエラー](https://code.claude.com/docs/ja/claude-code-on-the-web.md#errors-when-sending-to-a-cloud-session) |
| `Cloud sessions are disabled by your organization's policy` | [コマンドラインエラー](#cloud-sessions-are-disabled-by-your-organizations-policy) |
| 認証情報を名指しするポリシー拒否メッセージの末尾にある `Cloud sessions use your claude.ai login` | [コマンドラインエラー](#cloud-sessions-use-your-claude-ai-login) |
| `Couldn't verify your organization's policy for cloud sessions` | [コマンドラインエラー](#couldnt-verify-your-organizations-policy-for-cloud-sessions) |
| `Cloud sessions aren't available:` の後に組織のポリシーを読み込めなかった理由が続くもの | [コマンドラインエラー](#couldnt-verify-your-organizations-policy-for-cloud-sessions) |
| `Branch '<branch>' was not checked out` | [Teleport の要件](https://code.claude.com/docs/ja/claude-code-on-the-web.md#teleport-requirements) |
| `Cloud sessions aren't available with this Console sign-in. They need a claude.ai sign-in.` | [組織 UUID を取得できない](https://code.claude.com/docs/ja/claude-code-on-the-web.md#unable-to-get-organization-uuid) |
| `Cloud sessions need a claude.ai sign-in` | [組織 UUID を取得できない](https://code.claude.com/docs/ja/claude-code-on-the-web.md#unable-to-get-organization-uuid) |
| `Nothing was stashed: "<path>" is now a folder in place of a tracked file or link` / `are now folders in place of tracked files or links` | [コマンドラインエラー](#nothing-was-stashed-because-a-folder-replaced-a-tracked-file) |
| `Error: --json-schema is not a valid JSON Schema` | [コマンドラインエラー](#the-json-schema-value-is-not-a-valid-json-schema) |
| `Error: Invalid --agents configuration:` | [コマンドラインエラー](#invalid-agents-configuration) |
| `Error: --agents takes a JSON object, or a file path only with --print (-p)` | [コマンドラインエラー](#invalid-agents-configuration) |
| `Error: --agents file not found` | [コマンドラインエラー](#invalid-agents-configuration) |
| `Error: Settings file exceeds the 2MiB limit` | [コマンドラインエラー](#settings-file-exceeds-the-2mib-limit) |
| `Configuration error in` | [コマンドラインエラー](#configuration-error-in-claude-json) |
| `Claude configuration file at <path> was empty and no backup holds anything: starting with defaults.` | [コマンドラインエラー](#claude-configuration-file-was-empty) |
| `The current directory no longer exists (it was deleted or moved)` / `Can't read the current directory` | [コマンドラインエラー](#the-current-directory-no-longer-exists) |
| `Temp directory <dir> ... Refusing to use it` / `Claude Code's temporary directory <dir> could not be created` | [コマンドラインエラー](#temp-directory-refused-or-cannot-be-created) |
| `ENOSPC: no space left on device, mkdir '<dir>'` | [コマンドラインエラー](#temp-directory-refused-or-cannot-be-created) |
| `Error: Claude Code could not save ... because the disk is full (ENOSPC)` / `because your disk quota is used up (EDQUOT)` | [コマンドラインエラー](#could-not-save-because-the-disk-is-full) |
| `couldn't be resolved to a real location, so its skills, commands, and agents weren't loaded` | [コマンドラインエラー](#directory-couldnt-be-resolved-to-a-real-location) |
| Remote Control の起動時の `Error: Workspace not trusted` | [コマンドラインエラー](#workspace-not-trusted-when-starting-remote-control) |
| `claude ultrareview` の実行時の `Error: Workspace not trusted` | [コマンドラインエラー](#workspace-not-trusted-when-running-claude-ultrareview) |
| `Ultrareview did not start` | [コマンドラインエラー](#ultrareview-did-not-start) |
| `Remote Control did not start: "<question>" got no answer` | [コマンドラインエラー](#remote-control-did-not-start-got-no-answer) |
| `` `<flag>` before `remote-control` is not carried over to the sessions Remote Control starts `` | [コマンドラインエラー](#not-carried-over-to-the-sessions-remote-control-starts) |
| `Remote Control did not start, because sessions would skip part or all of the --settings file` | [コマンドラインエラー](#remote-control-did-not-start-because-of-the-settings-file) |
| `The settings file <file> has changed since Remote Control started, so this session did not start` | [コマンドラインエラー](#settings-file-changed-since-remote-control-started) |
| `--sandbox is not supported by claude remote-control` / `--no-sandbox is not supported by claude remote-control` | [コマンドラインエラー](#sandbox-is-not-supported-by-claude-remote-control) |
| `` `claude import` is not yet available in this build `` | [コマンドラインエラー](#claude-import-is-not-yet-available-in-this-build) |
| `Could not read Claude Code config` | [コマンドラインエラー](#could-not-read-claude-code-config) |
| `Could not import <server>: <reason>` | [コマンドラインエラー](#could-not-import-a-server-from-claude-desktop) |
| `Cannot add MCP server to scope: managed` | [コマンドラインエラー](#cannot-add-mcp-server-to-the-managed-scope) |
| `Cannot add MCP server: your organization's managed settings allow only MCP servers that plugins provide` | [コマンドラインエラー](#cannot-add-mcp-server-when-managed-settings-allow-only-plugin-servers) |
| `is Anthropic-hosted and doesn't support local OAuth` | [コマンドラインエラー](#anthropic-hosted-and-doesnt-support-local-oauth) |
| `Can't add to .mcp.json: it lists servers at the top level` | [プロジェクトスコープの形式](https://code.claude.com/docs/ja/mcp.md#project-scope) のように、サーバーを `mcpServers` キーの下に移動してください。 |
| `Can't read .mcp.json: it isn't a regular file or is larger than 2097152 bytes` | [コマンドラインエラー](#cant-read-mcp-json) |
| `MCP server "<name>" was not saved to` / `was not removed from` | [コマンドラインエラー](#mcp-server-was-not-saved-or-removed) |
| `MCP server "<name>" may not have been saved` / `may not have been removed` | [コマンドラインエラー](#mcp-server-may-not-have-been-saved-or-removed) |
| `Names that start with "claude.ai " are claude.ai connectors, which Claude Code can't remove` / `is a claude.ai connector, Claude Code can't remove it` | [claude.ai コネクタを無効にする](https://code.claude.com/docs/ja/mcp.md#disable-claude-ai-connectors) |
| `Server rejected the Authorization header minted by the configured headersHelper` | [コマンドラインエラー](#server-rejected-the-authorization-header-minted-by-the-configured-headershelper) |
| `This server (Java MCP SDK 0.17.0 or older) rejected Claude Code's elicitation capability` | [コマンドラインエラー](#mcp-server-rejected-the-elicitation-capability) |
| `Error: MCP tool <name> (passed via --permission-prompt-tool) not found` | [コマンドラインエラー](#mcp-permission-prompt-tool-not-found) |
| `OAuth callback port <port> is already in use — another process may be holding it` | [コマンドラインエラー](#oauth-callback-port-is-already-in-use) |
| `No available ports for OAuth redirect` | [コマンドラインエラー](#no-available-ports-for-oauth-redirect) |
| `Shell command failed for pattern "..."`（`/security-review` または動的コンテキストを挿入するスキルから） | [コマンドラインエラー](#security-review-fails-without-origin-head) |
| `Shell command permission check failed for pattern "..."`（動的コンテキストを挿入するスキルから） | [コマンドラインエラー](#security-review-fails-without-origin-head) |
| ``Couldn't run `<command>` for <name>. A file named HEAD or .git in this folder or one above it may not be yours``（動的コンテキストを挿入するスキルから） | [挿入されたコマンドの権限チェック](https://code.claude.com/docs/ja/skills.md#permission-checks-on-injected-commands) |
| ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found`` | [コマンドラインエラー](#security-review-fails-without-origin-head) |
| `No shell command in <name> was run, because the <tool> tool does not accept one of them` | [コマンドラインエラー](#no-shell-command-was-run) |
| `This skill, command or hook and the arguments filled into it add up to more than 4,000,000 characters` | [コマンドラインエラー](#skill-command-or-hook-over-the-4000000-character-limit) |
| `Input must be provided either through stdin or as a prompt argument when using --print` | [コマンドラインエラー](#input-must-be-provided-when-using-print) |
| `Claude Code can't read the keyboard here: stdin is not a terminal` | [コマンドラインエラー](#claude-code-cant-read-the-keyboard-here) |
| `Error: Input contained only whitespace` | [コマンドラインエラー](#input-contained-only-whitespace) |
| `Blank prompt — the message was only whitespace, so nothing was sent to the model.` | [コマンドラインエラー](#input-contained-only-whitespace) |
| `Error: stream-json input carried over 256M characters with no newline` | [コマンドラインエラー](#stream-json-input-carried-over-256m-characters-with-no-newline) |
| `Unknown command: /<name>`（`Did you mean` の候補の有無を問わない） | [コマンドラインエラー](#unknown-command) |
| `Diff is too large for ultrareview` / `PR #<N> is too large for ultrareview` | [コマンドラインエラー](#diff-is-too-large-for-ultrareview) |
| `Could not find merge-base with <branch>` | [コマンドラインエラー](#could-not-find-merge-base-with-the-base-branch) |
| `Your checkout has no branches (detached HEAD only)` | [コマンドラインエラー](#your-checkout-has-no-branches) |
| `/code-review ultra` または `/ultrareview` からの `but its shell has moved to` | レビュー対象のリポジトリで新しいセッションを開始します。 |
| `Ultrareview clones <owner>/<repo> in the cloud with the GitHub account connected to your Claude account, and none is connected` | [コマンドラインエラー](#no-github-account-is-connected-to-your-claude-account) |
| `Your connected GitHub account can't see <owner>/<repo>` | [コマンドラインエラー](#your-connected-github-account-cant-see-the-repository) |
| `The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead` | [コマンドラインエラー](#the-github-app-preflight-failed-transiently) |
| `the upload cannot follow that setting` を伴う `Not uploading this working tree` | [コマンドラインエラー](#the-repository-upload-cant-follow-a-git-setting) |
| その他の原因による `Not uploading this working tree` / `Git will not work in this checkout because its folder, or the .git in it, belongs to another user` | [GitHub を使わずにローカルリポジトリを送信する](https://code.claude.com/docs/ja/claude-code-on-the-web.md#send-local-repositories-without-github) |
| `GitHub isn't connected to your Claude account, so this repository can't be cloned in the cloud` | [コマンドラインエラー](#github-isnt-connected-to-your-claude-account) |
| `Your GitHub organization has an IP allowlist that is blocking Claude` | [コマンドラインエラー](#a-github-organization-policy-is-blocking-claude) |
| `Your GitHub organization requires single sign-on` | [コマンドラインエラー](#a-github-organization-policy-is-blocking-claude) |
| `Your GitHub organization's identity provider (Microsoft Entra ID) has a Conditional Access policy that is blocking Claude` | [コマンドラインエラー](#a-github-organization-policy-is-blocking-claude) |
| `Single sign-on authorization needed` | [コマンドラインエラー](#single-sign-on-authorization-needed) |
| `Failed to resume the conversation` | [コマンドラインエラー](#failed-to-resume-the-conversation) |
| `No conversation found with session ID: <session-id>` | [コマンドラインエラー](#no-conversation-found-with-the-session-id) |
| `Windows reported an error (EBADF) when Claude Code read this session's transcript file` | [コマンドラインエラー](#windows-reported-an-error-ebadf) |
| `Failed to resolve base branch "HEAD"` / `Failed to resolve HEAD in <folder>` | [worktree で並列セッションを実行する](https://code.claude.com/docs/ja/common-workflows.md#run-parallel-sessions-with-worktrees) |
| `points to a bare repository` | [worktree を手動で管理する](https://code.claude.com/docs/ja/worktrees.md#manage-worktrees-manually) |
| `Cannot use PR/MR #<number>` | メッセージ内の修正方法に従います。 |
| `Cannot switch renderers in this session` | [コマンドラインエラー](#cannot-switch-renderers-in-this-session) |
| `Cannot switch renderers while work is running in the background` | [コマンドラインエラー](#cannot-switch-renderers-in-this-session) |
| `Can't restart while work is running in the background` | [コマンドラインエラー](#cant-restart-while-work-is-running-or-remote-control-is-connected) |
| `Can't restart while Remote Control is connected. To use the installed version, exit and start Claude Code again, then run /resume.` | [コマンドラインエラー](#cant-restart-while-work-is-running-or-remote-control-is-connected) |
| `Claude Code couldn't restart` | [コマンドラインエラー](#claude-code-couldnt-restart) |
| `Couldn't open Claude Desktop` | [コマンドラインエラー](#couldnt-open-claude-desktop) |
| `Failed to open Claude Desktop. Please try opening it manually.` | [コマンドラインエラー](#couldnt-open-claude-desktop) |
| `Couldn't read your Zed keymap` / `Couldn't back up your Zed keymap` / `Couldn't update your Zed keymap` / `Your Zed keymap is a symbolic link` | [コマンドラインエラー](#terminal-setup-left-your-zed-keymap-unchanged) |
| `Your Zed keymap isn't a readable list of keybindings` | [コマンドラインエラー](#terminal-setup-left-your-zed-keymap-unchanged) |
| `Skill usage reports are not available on this connection.` | [コマンドラインエラー](#skill-usage-reports-are-not-available-on-this-connection) |
| `Custom output styles can't be selected over Remote Control or from a relayed message` | [コマンドラインエラー](#custom-output-styles-cant-be-selected-over-remote-control) |
| `Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load` | [コマンドラインエラー](#output-styles-are-saved-to-local-settings-which-this-session-doesnt-load) |
| `/recap only runs when you ask for it yourself in this session` | [コマンドラインエラー](#recap-only-runs-when-you-ask-for-it-yourself) |
| `/feedback is disabled by your organization's policy`、または `/bug` や `/share` に対する同様のメッセージ | [コマンドラインエラー](#feedback-is-disabled-by-your-organizations-policy) |
| `` `plugin eval` is currently in early access `` / `` `plugin eval` is currently unavailable `` | [プラグインエラー](#plugin-eval-is-currently-in-early-access) |
| `credential store on this machine holds a symbolic link inside it` | [ツールを付与する](https://code.claude.com/docs/ja/plugin-evals.md#grant-tools) |
| `claude plugin eval` からの `cannot be disallowed` | 組み込みツールの[正確な名前](https://code.claude.com/docs/ja/plugin-evals.md#disallow-tools)を使用し、[ターゲットを `--disallow-tools` の前に置いてください](https://code.claude.com/docs/ja/plugin-evals#choose-what-to-evaluate) |
| `cannot be evaluated where sessions load it` | [eval でプラグインをテストする](https://code.claude.com/docs/ja/plugin-evals.md#cannot-be-evaluated-where-sessions-load-it) |
| `Marketplace "<name>" is registered from an untrusted source` | [プラグインエラー](#marketplace-is-registered-from-an-untrusted-source) |
| `Claude Code refuses the marketplace name "<name>"` | [プラグインエラー](#claude-code-refuses-the-marketplace-name) |
| `Marketplace name impersonates an official Anthropic/Claude marketplace` | [プラグインエラー](#claude-code-refuses-the-marketplace-name) |
| `Can't use the marketplace name "<name>"` | [予約名](https://code.claude.com/docs/ja/plugins/marketplace-reference.md#reserved-names) |
| `Marketplace "<name>" is already added from a different source` | [プラグインエラー](#marketplace-is-already-added-from-a-different-source) |
| `"<name>" is another spelling of "<reserved>", a reserved marketplace name` | [プラグインエラー](#marketplace-name-is-another-spelling-of-a-reserved-name) |
| `Cannot add marketplace "<name>": Claude Code cannot install plugins from a marketplace with this name` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#cannot-install-plugins-from-a-marketplace-with-this-name) |
| `Cannot add marketplace "<name>": Claude Code reserves this name and cannot register a marketplace under it` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#claude-code-reserves-this-name) |
| `Marketplace "<name>" is added but ignored` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#marketplace-is-added-but-ignored) |
| `Marketplace "<name>", which managed settings declare, stands from another source and cannot be taken back while its declared source is unreachable` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#marketplace-cannot-be-taken-back-while-its-declared-source-is-unreachable) |
| `The list of installed plugins (installed_plugins.json) could not be read, so marketplace "<name>", which managed settings declare, cannot be taken back from another source` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#installed-plugins-could-not-be-read-so-marketplace-cannot-be-taken-back) |
| `Marketplace "<name>" is registered but was refused (see the debug log)` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#marketplace-is-added-but-ignored) |
| `references ${user_config.*} in a shell-form command` | [プラグインエラー](#plugin-command-references-user-config) |
| `Monitor "<name>" from plugin <plugin> references ${user_config.*} in its command` | [プラグインエラー](#plugin-command-references-user-config) |
| `headersHelper for MCP server '<name>' references ${user_config.*}` | [プラグインエラー](#plugin-command-references-user-config) |
| `Plugin archive integrity check failed` | [プラグインエラー](#plugin-archive-integrity-check-failed) |
| `An npm plugin source must name a registry package` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#an-npm-plugin-source-must-name-a-registry-package) |
| `The packages it lists are not installed` / `The packages it lists were not installed, because` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#the-packages-it-lists-are-not-installed) |
| `does not load (...), so Claude Code ignores the whole file` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#does-not-load-so-claude-code-ignores-the-whole-file) |
| `path escapes plugin directory` | [プラグインエラー](#path-escapes-plugin-directory) |
| `path not read: <path> is absolute or has a ".." part` | [プラグインエラー](#server-file-path-not-read) |
| `Plugin path not found: <path>` | セッションの開始時に指定したプラグインのパスを修正します。claude.ai から同期されたプラグインの場合は、Claude Code を再起動します。 |
| `commands path not found: <path>` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#commands-path-not-found) |
| `Plugin not loaded: its manifest <path> was not read` | [プラグインエラー](#plugin-not-loaded-its-manifest-was-not-read) |
| `path couldn't be checked` / `path could not be checked` | [プラグインエラー](#path-could-not-be-checked) |
| `Couldn't load hooks from <path>` / `Failed to load hooks from <path>` / `Hook load failed` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#failed-to-load-hooks-from-and-hooks-that-dont-fire) |
| `hooks.json declares PreToolUse/PermissionRequest` | [プラグインのフックの例](https://code.claude.com/docs/ja/plugins/components.md#hooks)のように、イベントを `hooks` キーの下に置いてください。 |
| `its marketplace entry path does not stay inside the marketplace directory` | [プラグインエラー](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |
| `Plugin source path refused` | [プラグインエラー](#marketplace-entry-path-does-not-stay-inside-the-marketplace-directory) |
| `Failed to load marketplace configuration` | [プラグインエラー](#failed-to-load-marketplace-configuration) |
| `Marketplace configuration file is corrupted` | [プラグインエラー](#failed-to-load-marketplace-configuration) |
| `Plugin "<name>@synced" is required by your organization and can't be disabled here` | [プラグインエラー](#plugin-is-required-by-your-organization) |
| `"<plugin>" was not uninstalled: it is still switched on in <file>` | [プラグインエラー](#plugin-was-not-uninstalled) |
| `"<plugin>" was not uninstalled: <file> is there and could not be read` | [プラグインエラー](#plugin-was-not-uninstalled) |
| `Plugin "<plugin>" was not uninstalled: installed_plugins.json` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#installed-plugins-json-holds-a-record-this-version-cannot-read) |
| `was updated or removed, so this hook did not run` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#plugin-directory-does-not-exist) |
| `Plugin directory does not exist: <path>` | [プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md#plugin-directory-does-not-exist) |
| `Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)` | [プラグインエラー](#skipping-connection-recent-failure-cached) |
| `is not added on this machine, so your organization's marketplace policy keeps its plugins off` | [マーケットプレイスを追加する](https://code.claude.com/docs/ja/plugins/install.md#add-a-marketplace) |
| `A mod's http.fetch hook stopped this request` | [mod をオンまたはオフにする](https://code.claude.com/docs/ja/plugins/mods/overview.md#turn-mods-on-or-off) |
| `hook was skipped. "<mod>" runs first and sent the event on past it.` | 引用符で示された mod をユーザー設定の [`prependPlugins`](https://code.claude.com/docs/ja/settings-reference#prependplugins) に記載している場合は、その mod を変更してください。それ以外の場合は、管理者に問い合わせてください。 |
| `<file>: changed while it was read` | `claude plugin validate` がこれを出力した場合は、再実行してください。それ以外の場合は、セッションを再起動してください。 |
| `installed mods are off for now` | [mod を読み込めるか確認する](https://code.claude.com/docs/ja/plugins/mods/troubleshoot.md#check-whether-mods-can-load) |
| `the hooks worker was lost with <mod>'s <event> hook in flight` | メッセージに名前が示された mod を修正してください。原因の一つについては、[`it crashed the hooks worker`](https://code.claude.com/docs/ja/plugins/mods/troubleshoot#it-crashed-the-hooks-worker) を参照してください。 |
| `dispatches in a row for fills by <mods>` | メッセージに名前が示された mod を、プロンプトボックスへの入力が連続 8 回以内になるよう変更してください。 |
| `Error: No such tool available: <tool name>` | [ツールエラー](#no-such-tool-available) |
| `MCP server "<name>" connection closed before the tool call was answered` | [ツールエラー](#connection-closed-before-the-tool-call-was-answered) |
| `MCP server "<name>" is disabled — re-enable it via /mcp to use its tools` | [ツールエラー](#mcp-server-is-disabled) |
| `MCP server "<name>" tool "<tool>" timed out after <N>s. The server asked the user a question, and no answer came before the time limit.` | [ツールエラー](#mcp-tool-call-timed-out-with-the-servers-question-unanswered) |
| `The server's response is not a valid MCP response, so it was not read` | 再試行する前に、リクエストが実行されたかどうかを確認してください。このエラーを MCP サーバーの作成者に報告してください。 |
| `Permission prompt tool returned an invalid result` | [ツールエラー](#permission-prompt-tool-returned-an-invalid-result) |
| `would be spawned with zero tools — refusing` | [ツールエラー](#agent-would-be-spawned-with-zero-tools) |
| `File is covered by a Read deny rule in your permission settings` | [ツールエラー](#file-is-covered-by-a-read-deny-rule) |
| `<path> is outside <dirs>; the permissions.blockWritesOutsideWorkingDirectories setting blocks writes outside the working directories` | [ツールエラー](#setting-blocks-writes-outside-the-working-directories) |
| `<path>: Writes outside the working directories are blocked (permissions.blockWritesOutsideWorkingDirectories)` | [ツールエラー](#setting-blocks-writes-outside-the-working-directories) |
| `Writes to Claude Code settings files are blocked while permissions.blockWritesOutsideWorkingDirectories is on` | [ツールエラー](#writes-to-claude-code-settings-files-are-blocked) |
| `cannot contain null bytes (\0)` | [ツールエラー](#path-cannot-contain-null-bytes) |
| `Path contains null bytes` | [ツールエラー](#path-cannot-contain-null-bytes) |
| `command contains the invisible character U+FEFF (byte order mark) or U+180E (Mongolian vowel separator), and was not run` | [ツールエラー](#command-contains-an-invisible-character) |
| `This command's variables and substitutions expand to more text than the permission check reads, so it was not run` | 変数や置換の数を減らすか短くするよう Claude に依頼してください。 |
| `This call was not run. Claude Code could not confirm that the shell is back in the directory`（v2.1.323 以降） | [ツールエラー](#command-approved-before-a-restart-was-not-run) |
| `File is too large to read as an image (the limit is 128MB)` | [ツールエラー](#file-is-too-large-to-read-as-an-image) |
| `Cannot read this as an image: <path> is a pipe or a device` | [ツールエラー](#file-is-too-large-to-read-as-an-image) |
| `could not fully check your permission rules` | [どのモードでも自動承認されないアクション](https://code.claude.com/docs/ja/permission-modes.md#actions-no-mode-auto-approves) |
| `subagent_type is required: the general-purpose agent is not available in this session` | [ツールエラー](#subagent-type-is-required) |
| `Error: this write left the memory index at MEMORY.md at ..., over its ... read limit` | [ツールエラー](#memory-index-is-over-its-read-limit) |
| `Sandbox is required but failed to initialize: <reason>` | [サンドボックス化のトラブルシューティング](https://code.claude.com/docs/ja/sandboxing.md#commands-refused-with-sandbox-is-required) |
| `too long for macOS, which limits their total size` / `one path in the sandbox's rules is longer than macOS accepts` | パスリストを短くする、使用していない git worktree を削除するなど、メッセージに示された修正方法に従います。 |
| `Sandbox is required (sandbox.failIfUnavailable) and stopped being available in this session: <reason>` | [サンドボックス化のトラブルシューティング](https://code.claude.com/docs/ja/sandboxing.md#commands-refused-with-sandbox-is-required) |
| `pkill: refusing to run` | [ツールエラー](#pkill-pattern-matches-the-claude-code-process) |
| `Sandbox settings can't be changed here` / `Sandbox settings are overridden by a higher-priority configuration` | [サンドボックス化のトラブルシューティング](https://code.claude.com/docs/ja/sandboxing.md#sandbox-settings-overridden) |
| `GH_HOST names a host other than github.com` / `GH_REPO names a host other than github.com` | `gh api --hostname ghe.example.com repos/my-org/my-repo/pulls` のように、`gh api` コマンドに `--hostname <host>` を渡すよう Claude に依頼します。`GH_REPO` の場合は、コマンドの `{owner}` と `{repo}` を実際の名前に置き換えるようにも Claude に依頼します。 |
| `Failed to write to <name>'s inbox — nothing was sent` | [ツールエラー](#failed-to-write-to-a-teammate-inbox) |
| `Failed to write the plan approval request to the lead's inbox — plan not submitted` | [ツールエラー](#failed-to-write-to-a-teammate-inbox) |
| `Its agent definition was not restored: the folder its definition file came from is not trusted` | [ツールエラー](#teammate-agent-definition-not-restored) |
| `Only a teammate can approve a shutdown request` | [ツールエラー](#only-a-teammate-can-approve-a-shutdown-request) |
| `cannot be handed to a teammate intact` | [ツールエラー](#command-line-deny-rule-cannot-be-handed-to-a-teammate) |
| `Message too large for cross-session delivery` | [ツールエラー](#message-too-large-for-cross-session-delivery) |
| `Too many messages to this session just now` | [ツールエラー](#too-many-messages-to-this-session-just-now) |
| `Held a message from <sender>` / `Dropped the held message from <sender> without delivering it` | [受信メッセージを制御する](https://code.claude.com/docs/ja/cross-session-messaging.md#control-inbound-messages)、または `claude -p` の場合は [非対話型セッション](https://code.claude.com/docs/ja/cross-session-messaging.md#non-interactive-sessions) |
| `Cross-session message was dropped at the recipient session's inbox` | [ツールエラー](#cross-session-message-dropped-at-the-inbox) |
| `Refusing to send: reply target is a symlink` / `Refusing to send: cannot vet reply target` | [ツールエラー](#refusing-to-send-a-cross-session-message) |
| `Refusing to read <path>: its symlink resolution changed after permission was checked (<reason>)` / `Refusing to search <path>: its symlink resolution changed after permission was checked` | [ツールエラー](#refusing-after-a-symlink-changed) |
| `Refusing to write <path>: its parent-directory symlink resolution changed after permission was checked` / `Refusing to write <path>: it is a symbolic link. Write to the link's target path instead` | [ツールエラー](#refusing-after-a-symlink-changed) |
| `Refusing to write through symlink: <path>` / `Refusing to write into symlinked directory: <path>` | [ツールエラー](#refusing-after-a-symlink-changed) |
| `Refusing to write <path>: where it leads on disk could not be determined` / `Refusing to read <path>: where it leads on disk could not be determined` | [ツールエラー](#refusing-after-a-symlink-changed) |
| `Refusing to search <path>: a path one of its Read deny rules is written through changed while the search was being prepared` / `Refusing to search <path>: it could not be opened` | [ツールエラー](#refusing-after-a-symlink-changed) |
| `can't be verified and was not run` / `Claude can't use tools in its working folder` / `Claude couldn't use a tool in its working folder` | 繰り返し発生する場合は、メッセージが示す場所で新しいセッションを開始します。 |
| `its permission check expired before it ran (too many concurrent file operations)` / `ripgrep was found only by name on PATH` | [ツールエラー](#refusing-after-a-symlink-changed) |
| `The search failed, so this is not a "no matches" result: matches may exist` | [ツールエラー](#the-search-failed) |
| `task output swap refused (tasks dir moved or linked)` | [ツールエラー](#task-output-swap-refused) |
| `Command killed: its output file was replaced or could no longer be verified` | [ツールエラー](#task-output-swap-refused) |
| `Disk full: this computer's volume holding <dir> (Claude Code's temporary directory) has <n> MB free` / `Nearly out of inodes: this computer's volume holding <dir>` | [ツールエラー](#disk-quota-or-temp-filesystem-is-full) |
| `Disk full: a test write beside this command's output file` / `Disk quota used up: a test write beside this command's output file` | [ツールエラー](#disk-quota-or-temp-filesystem-is-full) |
| `The command was not started: this computer's disk is full (ENOSPC)` / `the user's disk quota is used up (EDQUOT)` | [ツールエラー](#disk-quota-or-temp-filesystem-is-full) |
| `The sandbox could not create <dir>, a folder it must protect from the command, because the temp disk is full` | 一時ディスクの空き容量を確保するか一時ディスクを修復してから、Claude にコマンドを再度実行させてください。 |
| `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)` / `The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)` | [ツールエラー](#disk-quota-or-temp-filesystem-is-full) |
| `Command output was lost: the temp filesystem at <dir> is full` / `is out of inodes` | [ツールエラー](#disk-quota-or-temp-filesystem-is-full) |
| `File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary` | [ツールエラー](#file-is-not-valid-utf-8) |
| `git is not installed on this Mac. To install it, run xcode-select --install, then try again.` | [ツールエラー](#git-is-not-installed-on-this-mac) |
| `Refusing to apply edits to <path>: a hook is configured for file edits in this session` | [ツールエラー](#a-hook-is-configured-for-file-edits) |
| `blocking because onFailure is "block"` | [フックが失敗したときにアクションをブロックする](https://code.claude.com/docs/ja/hooks.md#block-the-action-when-a-hook-fails) |
| `the source file is not valid UTF-8 text` / `the source file is not valid UTF-16 text` | [ツールエラー](#the-source-file-is-not-valid-utf-8-text) |
| `the source file has the replacement character U+FFFD` | [ツールエラー](#the-source-file-is-not-valid-utf-8-text) |
| `Not published: that file is on a network share` | [ツールエラー](#not-published-that-file-is-on-a-network-share) |
| `Not published: Claude sent the same content again after a newer version of the artifact turned it away` / `Not published: Claude sent its changes again over the same file after a newer version of the artifact turned them away` | [ツールエラー](#not-published-a-newer-version-of-the-artifact-turned-it-away) |
| `Reading a local file from outside this session's connected folders, or through a link, needs the approval card` | [ツールエラー](#reading-a-local-file-from-outside-the-connected-folders) |
| `cannot read file_path (...) — the file could not be examined, and no one can answer the approval card` | [ツールエラー](#reading-a-local-file-from-outside-the-connected-folders) |
| `WebFetch cannot fetch localhost or other hostnames without a dot` | [ツールエラー](#webfetch-cannot-fetch-localhost) |
| `Claude Code is unable to fetch from ...` | [ツールエラー](#claude-code-is-unable-to-fetch-from-a-host) |
| `The safety check for domain ... is rate-limited` | [ツールエラー](#webfetch-domain-safety-check-failed) |
| `The safety check for domain ... is temporarily rate-limited` | [ツールエラー](#webfetch-domain-safety-check-failed) |
| `Unable to verify if domain ... is safe to fetch` | [ツールエラー](#webfetch-domain-safety-check-failed) |
| `MCP tool "<tool>" on server "<server>" gave no answer that could be read` / `answered without its text` | [MCP ツールフックの結果の読み取り方法](https://code.claude.com/docs/ja/hooks.md#how-the-tools-result-is-read) |
| `Can't open MCP settings while no terminal is attached to this background session` | [バックグラウンドセッションのエラー](#commands-refused-in-a-background-session) |
| `Can't open MCP settings in a background session` | [バックグラウンドセッションのエラー](#commands-refused-in-a-background-session) |
| `blocked because the path is spelled in a form that cannot be safely resolved` | [バックグラウンドセッションのエラー](#write-or-command-blocked-because-the-path-cannot-be-safely-resolved) |
| `blocked because the path is network-shaped` | [バックグラウンドセッションのエラー](#write-or-command-blocked-because-the-path-names-a-network-location) |
| `is isolated in the worktree <path>, but this command <reason>. Refusing to run it` | [バックグラウンドセッションのエラー](#command-blocked-by-the-worktree-isolation-checks) |
| `too complex to verify that it stays inside the worktree` | [バックグラウンドセッションのエラー](#command-blocked-by-the-worktree-isolation-checks) |
| `This session has no saved transcript` | [バックグラウンドセッションのエラー](#this-session-has-no-saved-transcript) |
| `Can't open — this session is running in another terminal` | [バックグラウンドセッションのエラー](#this-session-is-running-in-another-terminal) |
| `This conversation is already open in another running Claude session` | [バックグラウンドセッションのエラー](#this-session-is-running-in-another-terminal) |
| `This session's saved conversation is no longer on disk` | [バックグラウンドセッションのエラー](#this-sessions-saved-conversation-is-no-longer-on-disk) |
| `This forked session could not be started. Fork the conversation again to retry.` | [バックグラウンドセッションのエラー](#this-forked-session-could-not-be-started) |
| `Bypass permissions was requested at launch and ignored` | [バックグラウンドセッションで Bypass permissions が無視される](https://code.claude.com/docs/ja/permission-modes.md#bypass-permissions-ignored-in-a-background-session) |
| `kept <id> — its worktree is still at <path>` | メッセージの次の行で未プッシュのコミットに言及している場合は [バックグラウンドセッションのエラー](#worktree-has-commits-that-are-not-pushed-anywhere)、それ以外の場合は [セッションの削除で削除されるもの](https://code.claude.com/docs/ja/agent-view.md#what-deleting-a-session-removes) |
| `kept <id> — <n> unpushed commits on <branch>` | [バックグラウンドセッションのエラー](#worktree-has-commits-that-are-not-pushed-anywhere) |
| `kept <id> — worktree has commits that are not pushed anywhere` | [バックグラウンドセッションのエラー](#worktree-has-commits-that-are-not-pushed-anywhere) |
| `another Claude Code session (...) is running in it` を伴う `Worktree kept at` | [worktree をクリーンアップする](https://code.claude.com/docs/ja/worktrees.md#clean-up-worktrees) |
| `terminal host process died — press Enter to restart` / `This session's terminal host process died` | [バックグラウンドセッションのエラー](#terminal-host-process-died) |
| `Session isn't responding` / `Press enter again to restart this session — it isn't responding` | [バックグラウンドセッションのエラー](#session-isnt-responding) |
| `Session <id> was stopped while the respawn was in flight` | [バックグラウンドセッションのエラー](#session-was-stopped-while-the-respawn-was-in-flight) |
| `This session was running agent '<name>', which is no longer available` | [バックグラウンドセッションのエラー](#session-agent-no-longer-available) |
| `This session restarted <time> after its next /loop wakeup was due, so that wakeup will not fire` | [バックグラウンドセッションのエラー](#restarted-after-its-next-loop-wakeup-was-due) |
| `No LLM gateway: a gateway set in your shell isn't passed to a session opened from another folder` | [バックグラウンドセッションのエラー](#no-llm-gateway-opened-from-another-folder) |
| `No LLM gateway: opened from another folder · respawn from <folder>` | [バックグラウンドセッションのエラー](#no-llm-gateway-opened-from-another-folder) |
| `CLAUDE_CODE_PROCESS_WRAPPER: launcher ...` | [バックグラウンドセッションのエラー](#claude_code_process_wrapper-launcher-errors) |
| `EUNKNOWN: unknown error, uv_spawn` | [バックグラウンドセッションのエラー](#eunknown-when-starting-a-background-session) |
| `EACCES: permission denied, posix_spawn` | [バックグラウンドセッションのエラー](#eacces-when-starting-a-background-session) |
| `exited before it became reachable` | [バックグラウンドセッションのエラー](#background-service-exited-before-it-became-reachable) |
| `Couldn't start a background session (working directory no longer exists or is not accessible: ...)` | [バックグラウンドセッションのエラー](#working-directory-no-longer-exists-when-starting-a-background-session) |
| バックグラウンドセッションの開始時または再起動時の `Workspace not trusted.` | [バックグラウンドセッションのエラー](#workspace-not-trusted-when-dispatching-a-background-session) |
| `Claude Code is being updated by npm on this machine (still not runnable after 2 min, ...)` | [バックグラウンドセッションのエラー](#eacces-when-starting-a-background-session) |
| `Claude Code process exited with code N` | [ラッパーと IDE のエラー](#claude-code-process-exited-with-code-n) |
| `Subprocess initialization did not complete within 60000ms` | [ラッパーと IDE のエラー](#subprocess-initialization-did-not-complete-within-60000ms) |
| `Claude Code did not finish starting` | [ラッパーと IDE のエラー](#subprocess-initialization-did-not-complete-within-60000ms) |
| `The connection to Claude Code ended before this message completed` | [ラッパーと IDE のエラー](#the-connection-to-claude-code-ended-before-this-message-completed) |
| `Dictation error: The speech service refused the connection` / `Dictation error: The connection to the speech service was lost` / `Dictation error: Couldn’t connect to the speech service`（VS Code） | コマンドパレットから **Claude Code: Show Logs** を実行し、`Speech-to-text` を検索してください。 |
| `The last request was refused`（VS Code のサインイン画面） | **Cancel** を選択してから、会話のエラーをこの表で調べてください。 |
| `Plan not copied: The new session starts without a plan file.`（VS Code） | プランが必要な場合は、新しいセッションで Claude にもう一度書くよう依頼してください。 |
| `A message is still queued` / `A /clear is still queued`（VS Code でコードを巻き戻すとき） | Claude を停止してから、メッセージの残りの指示に従ってください。 |
| `Couldn’t load the diff view or code colors`（VS Code） | 差分をクリックして再試行するか、ウィンドウを再読み込みしてください。 |
| `Settings file is empty, and another program may still be writing it: <path>`（VS Code） | 1 分ほど待ってから再試行してください。メッセージが繰り返し表示される場合は、ファイルに `{}` を記述してください。 |
| `Could not locate the Claude CLI on PATH` | [ラッパーと IDE のエラー](#could-not-locate-the-claude-cli-on-path) |
| `Claude Code could not be started from <command>: it is the <system> build, and this computer needs the <build> build` | [`claudeCode.claudeProcessWrapper`](https://code.claude.com/docs/ja/vs-code#extension-settings) を設定している場合は、`<build>` 向けにビルドされたプログラムを指すように設定してください。それ以外の場合は、`<build>` 向けの VS Code 拡張機能パッケージをインストールしてください。 |
| `The Claude Code program for this computer, the <build> build, could not be found` | [ラッパーと IDE のエラー](#the-claude-code-program-for-this-computer-could-not-be-found) |
| `Restored the code, but skipped N files` | [巻き戻しの警告とエラー](#restored-the-code-but-skipped-files) |
| `No files were restored: N files failed (backup missing, or the file could not be updated)` | [巻き戻しの警告とエラー](#no-files-were-restored) |
| `Couldn't restore N files: the backup is missing or the file can't be written` | 失敗したファイルを書き込み可能にしてから、バージョン管理から復元してください。 |
| `Kept N files created since then, because a restore failed` | チェックポイント以降に Claude が作成したファイルが不要な場合は、それらを削除してください。 |
| `The file backups are still being copied. Nothing was changed. Try again in a moment.` | [`/rewind`](https://code.claude.com/docs/ja/checkpointing) で同じポイントをもう一度選択してください。[`/branch`](https://code.claude.com/docs/ja/sessions#branch-a-session) の直後にコードを復元すると、Claude Code がまだファイルバックアップを新しいセッションにコピーしている場合があります。 |
| `Transcript writes are failing (...)` | [セッション保存の警告](#transcript-writes-are-failing) |
| `Transcript saving is off — CLAUDE_CODE_SKIP_PROMPT_HISTORY is set` | [セッション保存の警告](#transcript-saving-is-off-skip-prompt-history) |
| `Transcript saving is off — inherited CLAUDE_CODE_CHILD_SESSION marker` | [セッション保存の警告](#transcript-saving-is-off-child-session-marker) |
| `Claude Code's fullscreen renderer didn't finish starting last time on this machine` / `Claude Code's fullscreen renderer has repeatedly failed to start on this machine` | [フルスクリーンレンダリング](https://code.claude.com/docs/ja/fullscreen.md#fullscreen-renderer-didnt-finish-starting) |
| `Claude Code exited after an unrecoverable interface error (...)` | [設定の警告](#exited-after-an-unrecoverable-interface-error) |
| `Agent descriptions are over the 15.0k-token limit` | [設定の警告](#agent-descriptions-are-over-the-15000-token-limit) |
| `declares type "claudeai-proxy", which only claude.ai connectors use` | MCP 設定からそのエントリを削除してください。[claude.ai の MCP サーバーを使用する](https://code.claude.com/docs/ja/mcp.md#use-mcp-servers-from-claude-ai)を参照してください。 |
| `hook needs quotes around a path with a space` | [設定の警告](#hook-needs-quotes-around-a-path-with-a-space) |
| `Instruction file not loaded` | [設定の警告](#instruction-file-not-loaded) |
| `Not loaded: rename <path>, then restart — its name uses "<name>", a name reserved for the skills synced from your claude.ai account` | [設定の警告](#a-skill-command-or-workflow-wasnt-loaded-because-its-name-is-reserved) |
| `N skill or command names refused: run with --debug to see which ([names]), rename, then restart` | [設定の警告](#skill-or-command-name-refused) |
| `Ignoring N permissions.allow entries from ... this workspace has not been trusted` | [設定の警告](#workspace-has-not-been-trusted) |
| `Two Claude Code config files exist: this run uses <path>, not <path>` | [設定の警告](#two-claude-code-config-files-exist) |
| `a settings change wasn't saved` | `~/.claude/settings.json` とプロジェクトの `.claude/settings.local.json` を書き込み可能にしてから、もう一度変更してください。別のツールがファイルを生成している場合は、[変更が新しいセッションで失われる](https://code.claude.com/docs/ja/settings.md#a-change-you-made-in-claude-code-is-lost-in-new-sessions)を参照してください。ファイルが有効でない場合は、[壊れた設定ファイルを修正する](https://code.claude.com/docs/ja/settings.md#fix-a-broken-settings-file)を参照してください。 |
| `Make this change again later: <path> could not be updated, so it applies to this session only` | [設定の警告](#make-this-change-again-later) |
| `is a network path, which cannot be added as a working directory` | [設定の警告](#working-directory-is-a-network-path) |
| `Remote managed settings failed to load (<cause>)` | [設定の警告](#remote-managed-settings-failed-to-load) |
| `Your organization requires remote managed settings to load, but they could not be loaded` | [フェイルクローズ起動を強制する](https://code.claude.com/docs/ja/server-managed-settings.md#enforce-fail-closed-startup) |
| `Remote managed settings are still loading` | [設定の警告](#remote-managed-settings-failed-to-load) |
| `Remote managed settings did not load` | [設定の警告](#remote-managed-settings-failed-to-load) |
| `Claude Code couldn't load your organization's settings` / `Claude Code couldn't reach Anthropic to load your organization's settings` / `requires them before a session can start` | [設定の警告](#couldnt-load-your-organizations-settings) |
| `Claude Code can't start this session yet` | [設定の警告](#couldnt-load-your-organizations-settings) |
| `Your Claude session has expired. Sign in again to continue (claude auth login).` | [設定の警告](#couldnt-load-your-organizations-settings) |
| `Managed settings were not approved; exiting without applying them.` | [設定の警告](#managed-settings-were-not-approved) |
| `Your organization's managed settings need your approval, which couldn't be asked for here.` | [設定の警告](#managed-settings-need-your-approval) |
| `Claude Code can't start: your organization's managed settings block the default model` / `Claude Code can't start: your organization allows only the models listed in "availableModels"` | [設定の警告](#managed-settings-block-the-default-model) |
| `Your organization's managed settings allow Claude Code to use: <providers>` | [設定の警告](#managed-settings-dont-allow-this-api-provider) |
| `Your organization's managed settings allow Claude Code to use no API provider at all` | [設定の警告](#managed-settings-dont-allow-this-api-provider) |
| `MCP server <name> is blocked by enterprise managed policy` | [設定の警告](#mcp-server-is-blocked-by-enterprise-managed-policy) |
| `"<name>" is a reserved MCP server name and was not loaded` | [設定の警告](#mcp-server-name-is-reserved) |
| `Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.` | [設定の警告](#managed-settings-document-could-not-be-parsed) |
| `Managed settings drop-in directory could not be read` | [設定の警告](#managed-settings-document-could-not-be-parsed) |
| `Unable to read managed policy settings` | [設定の警告](#unable-to-read-managed-policy-settings) |
| `Managed settings contain invalid entries, including PreToolUse/PermissionRequest hooks that are NOT loaded; fix or remove each entry:` | [設定の警告](#managed-settings-hooks-not-loaded) |
| `-p` 実行での `did not load, so nothing in them is in effect` / `These settings entries were skipped` | [`-p` 実行での壊れた設定](https://code.claude.com/docs/ja/settings#broken-settings-in-a-p-run) |
| `otelHeadersHelper failed; telemetry is not being exported. See /status: ...` | [設定の警告](#otelheadershelper-failed) |
| `apply_flag_settings: nothing in this request was applied and earlier settings stay in force. Fix or remove these invalid settings and send it again` | [`applyFlagSettings()`](https://code.claude.com/docs/ja/agent-sdk/typescript#applyflagsettings) |
| `Invalid JSON provided to --settings` / `Invalid JSON provided to the settings option` | [`--settings` フラグ](https://code.claude.com/docs/ja/cli-reference#cli-flags) または [`settings` オプション](https://code.claude.com/docs/ja/agent-sdk/typescript#options) |
| `"crossSessionInbound" must be one of "accept", "hold", "refuse"` | [設定の警告](#crosssessioninbound-must-be-one-of-accept-hold-refuse) |
| `API Error: ANTHROPIC_FOUNDRY_RESOURCE must be a Foundry resource name` | [設定の警告](#anthropic-foundry-resource-must-be-a-foundry-resource-name) |
| `headersHelper not run — this workspace has no persisted trust` | [設定の警告](#headershelper-not-run) |
| `Invalid permission rule "..." was skipped: Malformed Tool(content) rule` | [設定の警告](#malformed-tool-content-rule) |
| `matches no tool · check for typos` / `matches no known tool — check for typos` | [設定の警告](#matches-no-tool) |
| `lets <tool> run without asking only in the working directories` / `adds nothing to <tool>'s default` | [作業ディレクトリ外でファイルツールを許可する](https://code.claude.com/docs/ja/permissions.md#allow-a-file-tool-outside-the-working-directories) |
| `... is not matched by file permission checks` | [設定の警告](#is-not-matched-by-file-permission-checks) |
| `Write(<path>) never matches · use Edit(<path>)` / `Glob(<path>) never matches · use Read(<path>)` | [設定の警告](#is-not-matched-by-file-permission-checks) |
| `... has a wildcard before the rest of the command` | [設定の警告](#has-a-wildcard-before-the-rest-of-the-command) |
| `allows any option at its * · use an exact value` | [設定の警告](#has-a-wildcard-before-the-rest-of-the-command) |
| `Denying Bash also turns off the PowerShell tool, so Claude has neither` | [設定の警告](#denying-bash-also-turns-off-the-powershell-tool) |
| `CLAUDE_CODE_DISABLE_1M_CONTEXT is set, but the 200K limit isn't enforced` | [設定の警告](#the-200k-limit-isnt-enforced) |
| `CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" reads as <N> tokens, so Claude Code treats it as the 100k minimum` | [`CLAUDE_CODE_AUTO_COMPACT_WINDOW` の値と警告](https://code.claude.com/docs/ja/model-config#claude_code_auto_compact_window-values) |
| `CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" is too large, so Claude Code treats it as the 1M maximum` | [`CLAUDE_CODE_AUTO_COMPACT_WINDOW` の値と警告](https://code.claude.com/docs/ja/model-config#claude_code_auto_compact_window-values) |
| `CLAUDE_CODE_AUTO_COMPACT_WINDOW="<value>" isn't a usable size, so Claude Code ignores it` | [`CLAUDE_CODE_AUTO_COMPACT_WINDOW` の値と警告](https://code.claude.com/docs/ja/model-config#claude_code_auto_compact_window-values) |
| `Model "<model>" isn't recognized · context assumed to be <N> tokens` / `Claude Code doesn't recognize the model "<model>", so it assumes a context window of <N> tokens` | [ゲートウェイまたはカスタムモデル ID のウィンドウを修正する](https://code.claude.com/docs/ja/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id) |
| `Model "<model>" isn't recognized · did you mean "<suggestion>"?` / `Claude Code doesn't recognize the model "<model>". Did you mean "<suggestion>"?` | [入力ミスのあるモデル名を修正する](https://code.claude.com/docs/ja/model-config.md#fix-a-mistyped-model-name) |
| `[claude-code:unrecognized_model]` | [設定の警告](#unrecognized-model-id-on-a-request) |
| `is ignored — managed settings set allowManagedReadPathsOnly` / `is ignored — managed settings set allowManagedDomainsOnly` | [設定の警告](#sandbox-allow-entries-are-ignored-under-a-managed-lock) |
| `Sandbox mask files left behind at write-deny paths` | [設定の警告](#stale-sandbox-mask-files-left-by-a-killed-session) |
| `Stale sandbox mask files left by a killed session` | [設定の警告](#stale-sandbox-mask-files-left-by-a-killed-session) |
| `Ubuntu's AppArmor restriction on user namespaces stops bubblewrap here` | [サンドボックス化のトラブルシューティング](https://code.claude.com/docs/ja/sandboxing.md#apparmor-restriction-stops-bubblewrap) |
| `bwrap: setting up uid map: Permission denied` / `bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted` | [サンドボックス化のトラブルシューティング](https://code.claude.com/docs/ja/sandboxing.md#bwrap-uid-map-permission-denied) |
| 応答の品質が通常より低いように見える | [応答の品質](#responses-seem-lower-quality-than-usual) |

## 自動再試行

Claude Code は、一時的な障害に対して指数バックオフを使用して最大 10 回まで再試行してから、エラーを表示します。Claude の応答の途中で発生した障害については、常に再試行するとは限りません。このページに記載されているエラーのいずれかが表示された時点で、Claude Code はその障害に該当する再試行をすでに行っています。

Claude Code は次の障害を再試行します。

* Claude の応答がまったくストリーミングされていない段階で発生したサーバーエラー、過負荷レスポンス、リクエストタイムアウト。
* Claude が思考を終えた後、テキストやツール呼び出しを開始する前に発生したサーバーエラーまたは過負荷レスポンス。その時点でのサーバーエラーについて、Claude Code は最大 2 回まで再試行します。v2.1.284 より前は、Claude Code はその時点でエラーとともにターンを終了していました。
* 切断された接続。Claude が思考を含む応答のいずれの部分も完了する前にリクエストの途中で接続が切断された場合、Claude Code は同じバックオフでリクエストを再発行し、一部のテキストがすでにストリーミングを開始していてもターンは継続します。Claude が思考を終えた後、テキストやツール呼び出しを開始する前に切断された場合は、代わりに Claude Code は短い間隔で最大 2 回までリクエストを再発行し、その時点で接続の切断が続く場合は `Connection lost before a response was produced` でターンを終了します。
* リクエストの途中でコンピューターがスリープ状態になったことで切断されたと Claude Code が検出した接続。Claude Code はこれを上記のルールに従い切断された接続として扱います。再試行ラベルが具体的な理由を示すようになると `Connection lost while your computer was asleep` と表示され、Claude が思考を終えた後、テキストやツール呼び出しの前にターンが終了した場合、メッセージは `Your computer went to sleep before a response was produced` となります。
* 停止した応答ストリーム。レスポンスヘッダーは届いたものの Claude の応答がまったく届いていない場合、または Claude が思考を終えたもののテキストやツール呼び出しを開始していない場合です。Claude Code は停止した接続を中断し、最大 1 回だけリクエストを再度ストリーミングします。Claude が思考を終えた後、テキストやツール呼び出しの前に応答が 2 回目に停止した場合、Claude Code は `The response stalled before a response was produced` でターンを終了します。
* [ファーストバイトの期限が適用される](https://code.claude.com/docs/ja/network-config.md#streaming-idle-watchdogs)接続で、API がレスポンスヘッダーを返さないストリーミングリクエスト。Claude Code は期限の時点でリクエストを中断し、再試行回数の範囲内で再送信します。再送信でも期限に達した場合は、[No response from API](#no-response-from-api) でターンを終了します。`CLAUDE_CODE_RETRY_WATCHDOG` を設定している場合、Claude Code は代わりに再試行回数の範囲内で再送信を続けます。
* Claude が思考を終えるか、テキストやツール呼び出しを開始する前に、API の出力コンテンツフィルターによって停止されたストリーミングレスポンス。Claude Code は再試行回数の範囲内でリクエストを 1 回再送信し、フィルターが 2 回目の応答も停止した場合は [Output blocked by content filtering policy](#output-blocked-by-content-filtering-policy) を表示します。
* 一時的な 429 スロットリング。ただし、ゲートウェイの支出上限による `429` はスロットリングではないため含まれません。[Spend limit reached](#spend-limit-reached) を参照してください。
  * claude.ai サブスクリプションでサインインしている場合、これにはプランのクォータヘッダーを含まない 429 スロットリングも含まれます。v2.1.199 より前は、Claude Code がこれらのスロットリングを再試行するのは API キーおよび Enterprise でのサインインの場合のみでした。
* 入力と `max_tokens` の合計がコンテキスト制限を超えたために拒否されたリクエスト。変更せずに再送信しても同じように失敗するため、Claude Code は `max_tokens` を減らして再試行します。ただし、次の 2 つのケースでは、再試行を停止し、代わりにコンパクト化を行います。
  * どれだけ減らしても収まらない場合。たとえば、会話自体がコンテキストウィンドウをほぼ埋めている場合です。
  * 再試行で `max_tokens` をそれ以上縮小できない場合。v2.1.218 より前は、拡張思考のバジェットが残りのコンテキストを超えている場合など、依然として収まらない縮小済みのリクエストを、再試行回数を使い切るまで再送信することがありました。
* Claude がツールを呼び出していることを示しているにもかかわらず、ツール呼び出しを含まない応答。Claude Code は Claude にツール呼び出しを求めることで、最大 2 回まで再試行します。両方の再試行が同じように失敗した場合、`The model's tool call could not be parsed (retry also failed).` と表示され、ターンが終了します。もう一度試すには、別のメッセージを送信してください。v2.1.307 より前は、Claude Code はターンを終了する前に 1 回だけ再試行していました。
* [Google Cloud の Agent Platform](https://code.claude.com/docs/ja/google-vertex-ai.md) で期限切れまたは欠落している Google Cloud 認証情報、またはマシン上で読み込みに失敗した AWS 認証情報。Claude Code はキャッシュされた認証情報を破棄して最大 2 回まで再試行し、その後 [Could not load AWS or Google Cloud credentials](#could-not-load-aws-or-google-cloud-credentials) で説明しているように、すぐに再認証できるようエラーを報告します。v2.1.228 より前は、Claude Code は失敗した Google Cloud 認証情報について、再試行回数をすべて使い切るまで再試行してからエラーを表示していました。
* [`apiKeyHelper`](https://code.claude.com/docs/ja/settings-reference#apikeyhelper) スクリプトが認証情報を提供している間に、Anthropic API から直接、または [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)経由で返された `401` または `403`。Claude Code はスクリプトを再実行し、その新しい出力を使用して、再試行回数の範囲内で再試行します。再実行時にスクリプト自体が失敗した場合、Claude Code は代わりに [Your apiKeyHelper script is failing](#your-apikeyhelper-script-is-failing) を表示します。

v2.1.227 より前は、`Connection lost before a response was produced` は `Connection closed while thinking, before producing a response`、`The response stalled before a response was produced` は `Response stalled while thinking, before producing a response` と表示されていました。

Claude Code は次の障害を再試行しません。

* TLS を検査するプロキシ、`NODE_EXTRA_CA_CERTS` バンドルの欠落、期限切れの証明書などによる TLS 証明書の検証失敗。Claude Code は最初の試行でエラーを報告するため、すぐに証明書の設定を修正できます。[SSL certificate errors](#ssl-certificate-errors) を参照してください。ハンドシェイクのタイムアウトなど、一時的な TLS の状態については引き続き再試行します。v2.1.199 より前は、Claude Code は証明書の失敗について、再試行回数をすべて使い切るまで再試行してからエラーを表示していました。
* Claude がテキストのブロックまたはツール呼び出しを完了した後、または思考を終えた後にそれらを開始した後、応答を終える前に発生したサーバーエラー、切断された接続、または停止したストリーム。同じツール呼び出しが 2 回実行される可能性があるため、Claude Code はリクエストを再実行しません。Claude が完了した内容を保持し、Claude が完了したツール呼び出しを実行して、その結果からターンを継続します。対話型セッションおよび非対話型セッションで表示される内容については、[The response above may be incomplete](#the-response-above-may-be-incomplete) を参照してください。v2.1.199 より前は、ストリームの途中でサーバーエラーが発生すると、Claude Code は部分的な出力を破棄し、ターン全体をエラーとして報告していました。
* Claude が応答を終えた後に発生した障害。再試行する必要があるものはないため、Claude Code は完全な応答を保持し、ターンを通常どおり終了します。
* [予期しない content-type を持つ Amazon Bedrock のストリーミングレスポンス](#bedrock-streaming-response-has-an-unexpected-content-type)。レスポンスを書き換えているゲートウェイやプロキシは、再試行も同じように書き換えるためです。Claude Code v2.1.208 以降が必要です。
* 失敗したストリーミングリクエストの非ストリーミング再試行で、成功ステータスが返されたものの[本文に Claude API メッセージが含まれていない](#api-returned-an-empty-or-malformed-response)もの。Claude Code はそのエラーでターンを終了します。
* 組織のポリシーチェックによって拒否されたリクエスト。これは拒否メッセージを含む `API Error:` の行として表示されます。組織の管理者は Claude Enterprise の機能である [Inference hooks](https://platform.claude.com/docs/en/manage-claude/inference-hooks) を使用してこのチェックを設定しており、メッセージの末尾には管理者が設定した指示が表示されるか、デフォルトでは管理者に連絡するよう案内が表示されます。拒否はモデルではなくリクエストの内容に関するものであるため、Claude Code は拒否されたリクエストを同じモデルにも[フォールバックモデル](https://code.claude.com/docs/ja/model-config.md#fallback-model-chains)にも再送信しません。v2.1.239 より前は、Claude Code は拒否を表示する前に、ストリーミングなしで、または設定されたフォールバックモデルで、拒否されたリクエストを再送信することがありました。

### Claude Code が再試行または待機している間に表示される内容

再試行中、スピナーにはエラーラベルの後に `Retrying in Ns · attempt x/y` のカウントダウンが表示されます。ネットワークがダウンしている、TLS ハンドシェイクが失敗した、レート制限に達したなど、すぐに対処できる障害については、ラベルは最初の試行から具体的な理由を示します。その他のエラーでは、最初は `API error` と表示されます。v2.1.198 以降では、3 回目の試行から、または `CLAUDE_CODE_MAX_RETRIES` で 3 回未満しか許可されていない場合は最後の試行で、具体的な理由に切り替わります。それ以前のバージョンでは、最後の試行でのみ切り替わります。

v2.1.198 以降では、再試行中は通常のスピナーのヒントが表示されません。エラーの理由が表示された後、障害が 529 の過負荷である場合は、カウントダウンの下の行にサービスステータスを確認できる場所も表示されます。Anthropic API では `status.claude.com`、その他の構成ではメッセージに示されたプロバイダーまたはゲートウェイのホストです。

#### Waiting for API response

`Waiting for API response · will retry in … · check your network` バナーは、Claude Code があるリクエストについて、データを受信しないまま少なくとも 20 秒間待機したことを意味します。リクエストはまだ失敗していません。カウントダウンは、Claude Code が停止した接続を中断する時点までのものです。中断が発生した場合の動作は次のとおりです。

* Claude がテキストのブロックまたはツール呼び出しを完了する前、または思考を終えた後にそれらを開始する前の場合、Claude Code はリクエストを再試行するか、エラーでターンを終了します。どの停止を何回再試行するかについては、[自動再試行](#automatic-retries)を参照してください。
* Claude がテキストのブロックまたはツール呼び出しを完了した後、または思考を終えた後にそれらを開始した後で、Claude が応答を終える前の場合、Claude Code は Claude が完了した内容を保持し、Claude が完了したツール呼び出しからターンを継続して、[The response above may be incomplete](#the-response-above-may-be-incomplete) を表示します。非対話型セッション、およびすべてのセッションにおけるサブエージェントの応答では、Claude Code は最初に Claude に応答を続けるよう促す場合があります。それがいつ行われるか、またその場合でも通知が表示されるのはいつかについては、そのエントリを参照してください。
* Claude が応答を終えた後の場合、Claude Code はターンを通常どおり終了します。

このバナーは、データの受信が再開されるか再試行が成功すると自動的に消えます。すべての試行でバナーが再表示される場合は、[ネットワークの問題](#unable-to-connect-to-api)として扱ってください。ゲートウェイ経由で接続している場合は、[ゲートウェイ経由で待機中のバナーが表示されたり消えたりする](#waiting-banner-behind-a-gateway)を参照してください。v2.1.185 より前は、バナーは 10 秒後に異なる文言で表示されていました。

#### ゲートウェイ経由で待機中のバナーが表示されたり消えたりする

Claude が思考している間に `Waiting for API response` バナーが表示されたり消えたりし、ゲートウェイ経由で接続している場合は、[Claude Code を更新](https://code.claude.com/docs/ja/setup.md#update-claude-code)して v2.1.309 以降にしてください。次の接続では、データのない状態が 45 秒続いた後にバナーが表示されます。

* [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)など、Anthropic API 以外のホストに設定された [`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/ja/env-vars)
* [Claude apps gateway](https://code.claude.com/docs/ja/claude-apps-gateway) のセッション
* `ANTHROPIC_AWS_BASE_URL` が設定された [Claude Platform on AWS](https://code.claude.com/docs/ja/claude-platform-on-aws.md)

v2.1.309 より前は、これらの接続ではバナーは 20 秒後に表示されていました。

### 再試行の動作を調整する

次の環境変数を使用して、再試行の動作を調整できます。

| 変数 | デフォルト | 効果 |
| :- | :- | :- |
| [`CLAUDE_CODE_MAX_RETRIES`](https://code.claude.com/docs/ja/env-vars) | 10 | 再試行の回数。上限は 15 です。スクリプトで障害をより早く表面化させるには、値を下げてください。v2.1.199 以降で `CLAUDE_CODE_RETRY_WATCHDOG` を設定している場合、上限は適用されず、容量エラー以外の一時的なエラーのデフォルトは 300 になります。 |
| [`CLAUDE_CODE_RETRY_WATCHDOG`](https://code.claude.com/docs/ja/env-vars) | 未設定 | CI ジョブなどの無人セッションで `1` に設定すると、`429` および `529` の容量エラーを `CLAUDE_CODE_MAX_RETRIES` を超えて再試行し続けます。例外については、[再試行ウォッチドッグが再試行を停止する場合](#when-the-retry-watchdog-stops-retrying)を参照してください。fast mode のリクエストについては、[Handle rate limits](https://code.claude.com/docs/ja/fast-mode.md#handle-rate-limits) を参照してください。 |
| [`CLAUDE_CODE_RETRY_WATCHDOG_MAX_WAIT_MS`](https://code.claude.com/docs/ja/env-vars) | 未設定 | `CLAUDE_CODE_RETRY_WATCHDOG` が設定されている場合に、各 API リクエストが `429` および `529` エラーの解消を待つのに費やす最大時間。単位はミリ秒です。未設定の場合、待機時間に制限はありません。Claude Code v2.1.295 以降が必要です。 |
| `CLAUDE_CODE_RETRY_WATCHDOG_MAX_USAGE_LIMIT_WAIT_MS` | 上限なし | `CLAUDE_CODE_RETRY_WATCHDOG` が設定されている場合に、1 つのリクエストがプランの[使用制限](#youve-hit-your-session-limit)（セッション制限や週間制限など）のリセットを待つ最長時間。単位はミリ秒です。リセットまでの時間がこの上限より長い場合、リクエストは即座に失敗します。ただし、使用クレジットに余裕がある場合、または API がそれを確認できなかった場合は除きます。それらの場合はリクエストが再試行され、成功する前に上限の時間を過ぎると失敗します。Claude Code v2.1.301 以降が必要です。 |
| [`CLAUDE_CODE_RETRY_WATCHDOG_USAGE_LIMIT_RECHECK_MS`](https://code.claude.com/docs/ja/env-vars) | 未設定 | `CLAUDE_CODE_RETRY_WATCHDOG` が設定された状態でリクエストが[使用制限](#youve-hit-your-session-limit)のリセットを待っている間に、その制限がすでに解除されたかどうかを確認する間隔の最小値 (ミリ秒)。確認で制限の解除が判明した場合、リクエストは即座に送信されます。`60000` から `10800000` までの数字のみで指定してください。未設定の場合、またはその範囲外の場合は、確認は行われません。Claude Code がこれらの確認をスキップする場合については、[環境変数リファレンス](https://code.claude.com/docs/ja/env-vars.md)を参照してください。Claude Code v2.1.305 以降が必要です。 |
| [`CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS`](https://code.claude.com/docs/ja/env-vars) | 500 | API が `529` 過負荷エラーで拒否したリクエストの再試行間のバックオフにおける、開始時の遅延 (ミリ秒)。API が容量の上限に達している場合に、再試行をより長い期間に分散させるには、最大 32000 まで値を引き上げてください。`CLAUDE_CODE_RETRY_WATCHDOG` が `1` に設定されている場合、または拒否されたリクエストが [fast mode](https://code.claude.com/docs/ja/fast-mode.md#handle-rate-limits) で送信された場合は効果がありません。Claude Code v2.1.292 以降が必要です。 |
| [`CLAUDE_CODE_OVERLOADED_RETRY_MAX_DELAY_MS`](https://code.claude.com/docs/ja/env-vars) | 32000 | API が `529` 過負荷エラーで拒否したリクエストの再試行間のバックオフにおける、遅延の上限 (ミリ秒)。API が容量の上限に達している場合に、後の再試行の間隔が引き続き広がるようにするには、最大 300000 まで値を引き上げてください。64000 を超える値には v2.1.323 以降が必要です。`CLAUDE_CODE_OVERLOADED_RETRY_BASE_DELAY_MS` が効果を持たない場合と同じ条件では効果がありません。Claude Code v2.1.296 以降が必要です。 |
| [`API_TIMEOUT_MS`](https://code.claude.com/docs/ja/env-vars) | 600000 | 各リクエストの試行がレスポンスヘッダーを受信するまでの制限時間 (ミリ秒)。その後のストリーミングレスポンスの実行時間は制限しません。低速なネットワークやプロキシを使用する場合は値を引き上げてください。これがファーストバイトの期限の上限となる仕組みについては、[No response from API](#no-response-from-api) を参照してください。 |
| [`CLAUDE_CODE_NONSTREAMING_TIMEOUT_RETRIES`](https://code.claude.com/docs/ja/env-vars) | 未設定 | タイムアウトした[非ストリーミングリクエスト](#streaming-response-ended-before-any-complete-data-was-received)の再送信回数の上限。上限に達すると、リクエストは失敗します。生成にタイムアウトより長い時間がかかる Claude の応答は、再送信のたびに再びタイムアウトするため、より早く失敗させるには `0` などの小さな値を設定してください。各試行のタイムアウトについては、[非ストリーミングの試行が待機する時間](#how-long-a-non-streaming-attempt-waits)を参照してください。Claude Code v2.1.285 以降が必要です。 |
| [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](https://code.claude.com/docs/ja/env-vars) | 未設定 | ストリーミングリクエストの最初のレスポンスバイトの期限 (ミリ秒)。Claude Code v2.1.242 以降が必要です。これが未設定の場合に Claude Code が期限をどのように決定するかについては、[No response from API](#no-response-from-api) を参照してください。 |

#### 再試行ウォッチドッグが再試行を停止する場合

`CLAUDE_CODE_RETRY_WATCHDOG` が設定されている場合、Claude Code は fast mode 以外のリクエストについて、次のようなレスポンスを受け取ると再試行を停止します。

* **支出上限**: [使用クレジットの支出上限](#youve-hit-your-monthly-spend-limit)、またはスケジュールに従ってリセットされる[ゲートウェイの支出上限](#spend-limit-reached)による `429`。
* **[使用クレジット](https://code.claude.com/docs/ja/costs.md#add-usage-credits-to-your-subscription)の枯渇**: `anthropic-ratelimit-unified-overage-status` ヘッダーも `anthropic-ratelimit-unified-representative-claim` ヘッダーも含まない、クレジット不足の `429`。
* **再試行不可とマークされたもの**: [`x-should-retry: false`](https://code.claude.com/docs/ja/llm-gateway-protocol#response-headers) ヘッダーを含む `429` または `529`。API が使用クレジットを確認できなかった場合、Claude Code は引き続きリクエストを再試行します。

支出上限と使用クレジットのケースには Claude Code v2.1.239 以降が必要です。`x-should-retry` のケースには v2.1.311 以降が必要です。

#### 非ストリーミングの試行が待機する時間

非ストリーミングの試行は、リクエストタイムアウトと本文のアイドルタイムアウトのうち、早く到達した方の時点で終了します。

* **リクエストタイムアウト**: 正の値を設定している場合は `API_TIMEOUT_MS`、それ以外の場合はローカルセッションでは 300 秒です。
* **[本文のアイドルタイムアウト](https://code.claude.com/docs/ja/network-config.md#streaming-idle-watchdogs)（動作する環境の場合）**: デフォルトでは、レスポンスがないまま 5～6 分が経過した時点です。`API_TIMEOUT_MS` をどれだけ大きく設定していても変わりません。

## サーバーエラー

これらのエラーのほとんどは推論プロバイダーから発生します。Anthropic API 上の Anthropic のサービス、および Amazon Bedrock、Google Cloud の Agent Platform、Microsoft Foundry、またはカスタムゲートウェイの背後にあるプロバイダーのエンドポイントのサービスです。[Auto mode cannot determine the safety of an action](#auto-mode-cannot-determine-the-safety-of-an-action) と [Agent terminated early due to an API error](#agent-terminated-early-due-to-an-api-error) は、Amazon Bedrock アカウントが分類器モデルを呼び出せない、またはサブエージェントが使用制限に達したなど、ユーザー側の原因もカバーしています。

### API Error: 500 Internal server error

Claude Code は、5xx レスポンスに対して、ステータスコードと API のエラーメッセージを表示します。以下の例は、Anthropic API での 500 レスポンスを示しています。

```text theme={null}
API Error: 500 Internal server error. This is a server-side issue, usually temporary — try again in a moment. If it persists, check https://status.claude.com.
```

末尾の文は、サービスの健全性を確認する場所を示し、プロバイダーによって異なります。Amazon Bedrock、Google Cloud の Agent Platform、および Microsoft Foundry の設定は、そのプロバイダーのサービスステータスを示します。カスタム `ANTHROPIC_BASE_URL` はゲートウェイホストを示します。

API 自体から返される 5xx は、API 内部の予期しない障害を示しています。これはプロンプト、設定、またはアカウントが原因ではありません。

プロキシ、ロードバランサー、またはゲートウェイが HTML エラーページで応答する場合、メッセージはステータスコードとページのタイトル（`API Error: 502 Bad Gateway` など）を表示します。タイトルのないページの場合、メッセージはステータスコードとその標準名を代わりに表示します。v2.1.281 より前では、ページにタイトルがある場合はステータスコードが削除され、タイトルがない場合はページの生のマークアップが出力されていました。

**対応方法：**

* [status.claude.com](https://status.claude.com) またはメッセージに示されているプロバイダーのステータスページで、アクティブなインシデントを確認してください
* 1 分待ってから、メッセージを再度送信してください。元のメッセージはまだ会話に残っているため、長いプロンプトの場合は、全体を貼り付ける代わりに `try again` と入力できます。
* [`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/ja/env-vars) が [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway) を指しており、すべてのリクエストがこの形で失敗する場合は、ゲートウェイとそのアップストリームが [ツール検索](https://code.claude.com/docs/ja/mcp.md#tool-search-through-a-gateway) のフィールドを受け付けることを確認してください。デフォルトでは、Claude Code は `defer_loading` ツールフィールドと `tool_reference` ブロックを、それらを有効にする `anthropic-beta` ヘッダーとともに送信します。v2.1.304 より前では、`ENABLE_TOOL_SEARCH` でオンにしない限り、ゲートウェイの背後ではツール検索はオフになっていました。
* エラーが投稿されたインシデントなしで続く場合は、`/feedback` を実行して、Anthropic がリクエストの詳細で調査できるようにしてください。環境で `/feedback` が利用できない場合は、[Report an error](#report-an-error) を参照してください。

### API Error: Repeated 529 Overloaded errors

API は全ユーザー間で一時的に容量に達しています。Claude Code はこのメッセージを表示する前に既に数回再試行しています。

```text theme={null}
API Error: Repeated 529 Overloaded errors. The API is at capacity — this is usually temporary. Try again in a moment. If it persists, check https://status.claude.com.
```

末尾の文は、上記の 500 エラーと同じ方法でプロバイダーによって異なります。

529 は使用制限ではなく、クォータにもカウントされません。

**対応方法：**

* [status.claude.com](https://status.claude.com) またはメッセージに示されているプロバイダーのステータスページで、容量に関する通知を確認してください
* 数分後に再度試してください
* `/model` を実行して別のモデルに切り替えて、作業を続けてください。容量はモデルごとに追跡されるためです。Claude Code は、1 つのモデルが特に高い負荷を受けている場合、これを行うよう促します。例えば `Opus is experiencing high load, please use /model to switch to Sonnet` のようなメッセージが表示されます。Fable モデルでは、メッセージは Fable を示します。

  Claude Desktop アプリが実行するセッション（Code タブや Cowork など）では、メッセージは `Opus is experiencing high load. Switch to Sonnet.` と読まれ、アプリのモデルピッカーでモデルを切り替えます。

### Request timed out

API は接続期限前に応答しませんでした。

```text theme={null}
Request timed out
```

デフォルトのリクエストタイムアウトは 10 分です。[`API_TIMEOUT_MS`](https://code.claude.com/docs/ja/env-vars) を `0` に設定すると、このリクエストタイムアウトはオフになります。[最初のバイトの期限](#no-response-from-api) とボディのアイドルタイムアウトは `0` を設定してもオフにならないため、ストリーミングリクエストは引き続き [接続に適用されるいずれかの制限](https://code.claude.com/docs/ja/network-config.md#streaming-idle-watchdogs) の下で実行されます。非ストリーミングの試行は、ローカルセッションでは 300 秒の制限を維持し、引き続きこのメッセージで終了する可能性があります。

**対応方法：**

* すべてのリクエストがこのメッセージで失敗し、`API_TIMEOUT_MS` を `0` に設定している場合は、`claude --version` を確認してください。v2.1.305 より前のバージョンでは、Claude Code を更新するか、正の値を設定してください。
* リクエストを再試行してください
* メッセージが `Request timed out` の後にも続き、[環境変数](https://code.claude.com/docs/ja/env-vars.md#set-environment-variables) を示している場合は、メッセージの指示に従ってください。`No data arrived` は、[ボディのアイドルタイムアウト](https://code.claude.com/docs/ja/network-config.md#streaming-idle-watchdogs) がリクエストを終了したことを意味します。
* v2.1.328 より前のバージョンでネットワークまたはプロキシが遅い場合は、[`API_TIMEOUT_MS`](#tune-retry-behavior) を上げてください。それでもリクエストがタイムアウトする場合は、[v2.1.328 以降に更新](https://code.claude.com/docs/ja/setup.md#update-claude-code) し、次のタイムアウトメッセージに示されている変数を設定してください。更新できない場合は、[`API_FORCE_IDLE_TIMEOUT`](https://code.claude.com/docs/ja/env-vars) を `0` に設定してください。
* タイムアウトが頻繁で、ネットワークが正常な場合は、以下の [Network and connection errors](#network-and-connection-errors) を参照してください

### No response from API

Claude Code はストリーミングリクエストを送信しましたが、API は最初のバイトの期限内に応答ヘッダーを返しませんでした。Claude Code はこのようなリクエストを、完全な `API_TIMEOUT_MS` リクエストタイムアウトを待つ代わりに中止し、[retry budget](#tune-retry-behavior) が許可する場合は再度送信します。再試行でも期限が過ぎた場合、ターンはこのメッセージで終了し、各試行が待機した時間を示します。

[`CLAUDE_CODE_RETRY_WATCHDOG`](https://code.claude.com/docs/ja/env-vars) を設定すると、Claude Code はターンを終了する代わりに、[Tune retry behavior](#tune-retry-behavior) で説明されているバジェットの下で再試行を続けます。

```text theme={null}
API Error: No response from API (waited 3m, then 10m on the retry). If a proxy or gateway on your network holds responses until they complete, raise API_TIMEOUT_MS or CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS to wait longer.
```

Claude Code は最初の試行の応答ヘッダーの待機と再試行の待機を個別に設定します。

* **最初の試行**: [`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS`](https://code.claude.com/docs/ja/env-vars) を 1 以上に設定した場合、10 秒から 30 分の間にクランプされます。それ以外の場合、Claude Code は [Streaming idle watchdogs](https://code.claude.com/docs/ja/network-config.md#streaming-idle-watchdogs) に記載されているバイトレベルのウォッチドッグタイムアウトを使用するため、そのタイムアウトを変更する変数はこの待機も変更します。どちらの場合でも、Claude Code はリクエストボディの 32KB ごとに 1 秒を追加します。
* **再試行**: `API_TIMEOUT_MS` より 1 秒少ない、デフォルトではほぼ 10 分。これにより、再試行は応答を生成完了まで保持するプロキシまたはゲートウェイを上回ることができます。Amazon Bedrock では、再試行は最初の試行と同じ期限を使用し、メッセージは 2 つの期間ではなく 1 つの期間を示します。

  Amazon Bedrock を除き、`API_TIMEOUT_MS` を `0` に設定した場合、再試行は 10 分に 32KB ごとに 1 秒を加えた時間、または最初の試行の待機のほうが長い場合はその時間だけ待機します。

どちらの待機も、正の `API_TIMEOUT_MS` より 1 秒少ない値を超えず、11 秒未満の正の `API_TIMEOUT_MS` は期限をオフにします。バイトレベルのウォッチドッグは応答ヘッダーが到着した後にのみ開始されるため、その後バイト送信を停止するレスポンスは、この期限ではなく [stalled-stream rules](#automatic-retries) に従います。

[Claude apps gateway](https://code.claude.com/docs/ja/claude-apps-gateway) セッションでは、この期限は `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` を `1` 以上に設定して [オンにした](https://code.claude.com/docs/ja/claude-apps-gateway-deploy.md#retry-an-unanswered-request-sooner-with-the-first-byte-deadline) 場合にのみ適用されます。

**対応方法：**

* メッセージを再度送信してください。元のメッセージはまだ会話に残っているため、長いプロンプトの場合は、全体を貼り付ける代わりに `try again` と入力できます。
* 繰り返される場合は、[ネットワークまたはプロキシの問題](#unable-to-connect-to-api) として扱ってください。
* ネットワーク上のプロキシまたはゲートウェイが応答を生成完了まで保持する場合は、`API_TIMEOUT_MS` を上げて再試行がより長く待機するようにしてください。Amazon Bedrock では、`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` も上げてください。
* 最初の試行がタイムアウトし続け、再試行が成功する場合は、`CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` を上げて最初の試行も十分に長く待機するようにしてください。

v2.1.242 より前では、Claude Code は応答のないストリーミングリクエストが失敗する前に、完全な `API_TIMEOUT_MS` リクエストタイムアウト（デフォルトは 10 分）を待機していました。v2.1.261 より前では、再試行は最初の試行と同じ期限を待機し、メッセージは期間を示していませんでした。v2.1.307 より前では、Claude Code は Claude apps gateway セッションで `CLAUDE_STREAM_FIRST_BYTE_TIMEOUT_MS` を無視していました。

### The response above may be incomplete

ストリーミングリクエストがレスポンスの進行中に失敗しました。Claude がテキストのブロックまたはツール呼び出しを完了した後、または思考を終了した後に 1 つを開始した後です。リクエストを再送信すると、同じツール呼び出しが 2 回実行される可能性があるため、Claude Code は Claude が完了した出力を保持し、ターンを破棄する代わりにこの通知を追加します。表示されるバリアントは原因を示します。

```text theme={null}
API Error: Server error mid-response. The response above may be incomplete.
API Error: Connection lost mid-response. The response above may be incomplete.
API Error: Your computer went to sleep mid-response. The response above may be incomplete.
API Error: The response stopped arriving. The response above may be incomplete.
API Error: Part of the response never arrived. The response above may be incomplete.
API Error: The response stream was malformed. The response above may be incomplete.
```

* `Server error mid-response`: ストリーム中のオーバーロードまたは 5xx サーバーエラー。このバリアントには Claude Code v2.1.199 以降が必要です。それ以前は、その場合は部分的な出力を破棄し、ターン全体をエラーとして報告していました。
* `Connection lost mid-response`: 接続が切断されました。プロキシまたはゲートウェイがレスポンスボディをレスポンスが完了する前にクリーンに終了する場合にも、このバリアントが表示されます。
* `Your computer went to sleep mid-response`: Claude Code は、レスポンスがストリーミング中にコンピューターがスリープ状態になったことを検出しました。コンピューターが起動すると、Claude Code は接続を破損として扱い、読み取りを停止します。
* `Part of the response never arrived`: ストリームイベントが API と Claude Code の間でドロップされたため、後のイベントが到着しなかったコンテンツを参照していました。v2.1.281 より前では、このケースは `API Error: Content block not found` でターンを終了していました。
* `The response stream was malformed`: 既に完了していたコンテンツブロックのイベントが到着しました。または、イベントが破損した状態で到着しました。破損したイベントとは、データが有効な JSON ではない、コンテンツが欠落している、またはコンテンツがイベントのタイプと一致しないイベントです。v2.1.284 より前では、Claude が思考、テキストのブロック、またはツール呼び出しを完了した後に無効な JSON を持つイベントが到着した場合、パーサーの生のエラー（`API Error: JSON Parse error` で始まるものなど）が代わりに表示されていました。
* `The response stopped arriving`: 接続は開いたままでしたが、データの配信を停止したため、ストリーミングアイドルウォッチドッグがそれを中止しました。v2.1.222 より前では、Claude Code は `ANTHROPIC_BASE_URL` または `ANTHROPIC_AWS_BASE_URL` を通じて到達する [ゲートウェイ](https://code.claude.com/docs/ja/gateways.md) 接続で、サーバーのキープアライブピングがまだ到着している間にもこの障害を報告することがありました。これは、そこでは解析された応答イベントのみをカウントしていたためです。アップグレードすると、これらのルートでの誤ったタイムアウトが発生しなくなります。`ANTHROPIC_BEDROCK_BASE_URL` などのプロバイダーベース URL を通じて到達するゲートウェイは、バイトウォッチドッグでラップされていません。[Streaming idle watchdogs](https://code.claude.com/docs/ja/network-config.md#streaming-idle-watchdogs) を参照してください。

v2.1.227 より前では、`Connection lost mid-response` は `Connection closed mid-response` と読まれ、`The response stopped arriving` は `Response stalled mid-stream` と読まれていました。

Claude がテキストまたはツール呼び出しを開始する前にドロップ、重複、または破損したストリームイベントが到着した場合、この通知は表示されません。

* Claude が思考のみを完了していた場合、Claude Code はリクエストを再発行します。再発行されたストリームが同じ方法で破損する場合、ターンは `Part of the response never arrived and no response was produced. Try again.` または `The response stream was malformed and no response was produced. Try again.` で終了します。
* 何も完了していない場合、Claude Code はストリーミングなしでリクエストを再送信します。[`CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK`](https://code.claude.com/docs/ja/env-vars) でそのフォールバックをオフにした場合、ターンはドロップされたイベントの場合は `API Error: Content block not found` で、または重複したイベントの場合は `API Error: Content block already closed` で終了します。破損したイベントでフォールバックがオフの場合、ターンは `API Error: Stream event unreadable` またはパーサーの生のエラーで終了します。

4 つのケースでは、Claude Code はこの通知をすぐに表示せずに障害を処理します。

* レスポンスの前半で、Claude Code は障害を再試行するか、別のエラーでターンを終了します。[Automatic retries](#automatic-retries) を参照してください。
* これらの障害の 1 つが Claude がレスポンスを完了した後に到着した場合、Claude Code は完全なレスポンスを保持し、この通知なしでターンを正常に終了します。v2.1.222 より前では、Claude Code はレスポンスが完了した後に接続が切断またはストールした場合、この通知を表示し、レスポンスが完全であったにもかかわらずターンをエラーとして報告していました。
* [非対話セッション](https://code.claude.com/docs/ja/headless.md)（`-p` 実行、[Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) 実行、または [クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md) など）では、途中で切れたレスポンスがメイン会話にあり、テキストを含むがツール呼び出しを含まない場合、`continue` を自分で送信する必要はありません。Claude Code は部分的な出力を保持し、Claude に停止した場所から続行するよう促します（最大 3 回連続）。この通知は、Claude Code がこれらの継続を使い果たした後にのみ、そのようなレスポンスに対して表示されます。v2.1.246 より前では、Claude Code は最初の途切れでこの通知とともに非対話ターンを終了していました。
* [サブエージェント](https://code.claude.com/docs/ja/sub-agents.md#api-errors-in-subagents)では（セッションが対話かどうかに関わらず）、途中で切れたレスポンスがテキストを含むがツール呼び出しを含まない場合、Claude Code はサブエージェントに続行するよう促します。通知は、これらの継続が使い果たされた後にのみ、サブエージェントの最後のメッセージになります。v2.1.257 より前では、サブエージェントは最初の途切れでこの通知を表示していました。

**対応方法：**

* 対話セッションでは、画面に残っているレスポンスを読んでください。Claude Code はエラーの前に Claude が完了したすべてのブロックを保持しますが、ターンが終了するときに中断された最終ブロックを破棄するため、最終文またはツール呼び出しが欠落している可能性があります。`continue` で返信して、Claude が最後に完了したブロックから再開するようにしてください。
* [非対話モード](https://code.claude.com/docs/ja/headless.md)（`-p`）では：
  * デフォルトのテキスト出力では、Claude Code は、ターンの前半から保持している最後に完了したテキストのブロックを出力し、その後このメッセージを出力します。何も保持していない場合、Claude Code はこのメッセージのみを出力します。例えば、Claude Code がターン中に会話をコンパクト化し、そのテキストをクリアした場合です。v2.1.219 より前では、Claude Code は `-p` テキスト出力でこのメッセージのみを出力し、既に生成されたレスポンスを削除していました。
  * `--output-format json` または `stream-json` では、Claude Code はこのメッセージを `result` フィールドで報告します。
  * 接続が安定したら、ターンを続行するために、セッションを再開し、[Continue conversations](https://code.claude.com/docs/ja/headless.md#continue-conversations) で説明されているように `continue` を送信してください。

### Auto mode cannot determine the safety of an action

[auto モード](https://code.claude.com/docs/ja/permission-modes.md#eliminate-prompts-with-auto-mode) がアクションを分類するために使用するモデルが決定を生成できなかったため、auto モードはアクションを自動的に承認しませんでした。表示されるメッセージは、分類器が失敗した方法によって異なります。

分類器モデルが利用できない場合：

```text theme={null}
<model> is temporarily unavailable, so auto mode cannot determine the safety of <tool> right now. Wait a moment and then try this action again.
```

対話セッションでは、このメッセージの代わりに、ツール呼び出しの下に薄く表示される `Not run · auto mode's check had no usable answer` 行が現れます。この行は、[サーバーが判定を返さなかった](#the-server-returned-no-safety-verdict)ことを示すメッセージや、リモートセッション以外では `Auto mode could not evaluate` で始まるメッセージの代わりに表示されることもあります。`Ctrl+O` を押すと、[トランスクリプトビューアー](https://code.claude.com/docs/ja/interactive-mode.md#transcript-viewer) でそのメッセージを読むことができます。v2.1.296 より前では、メッセージは赤いエラーとして表示されていました。

Claude Code が障害カテゴリを判定できる場合、`temporarily unavailable` の後の括弧内にカテゴリを示します。例えば `<model> is temporarily unavailable (rate-limited), so auto mode cannot determine the safety of <tool> right now`。カテゴリは `(rate-limited)`、`(overloaded)`、`(server error)`、`(timed out)`、`(connection failed)` です。`(timed out)` または `(connection failed)` が繰り返される場合は、接続を確認してください。[Unable to connect to API](#unable-to-connect-to-api) を参照してください。v2.1.229 より前では、メッセージはカテゴリを示さず、`Wait briefly and then try this action again` と読まれていました。

カテゴリが適合しない場合、メッセージは括弧内にカテゴリなしで表示されます。複数の障害がその形式を生成します。[Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md)（[Mantle endpoint](https://code.claude.com/docs/ja/amazon-bedrock.md#use-the-mantle-endpoint) を含む）では、AWS アカウントがメッセージに示されているモデルを呼び出せない場合にも表示され、その障害はアカウントにモデルへのアクセスが付与されるまで、すべての再試行で繰り返されます。

**対応方法：**

* 数秒後に再試行してください。Claude は同じメッセージを見て、通常は自動的に再試行します。一時的な障害は [auto モードの利用資格](https://code.claude.com/docs/ja/permission-modes.md#eliminate-prompts-with-auto-mode) とは無関係です。設定を変更する必要はありません
* 再試行が失敗し続ける場合は、読み取り専用タスクを続行し、後でブロックされたアクションに戻ってください
* Amazon Bedrock では、メッセージがすべての再試行で返される場合は、アカウントがそれが示すモデルを呼び出せることを確認してください。標準の Amazon Bedrock モデルの場合、[IAM policy](https://code.claude.com/docs/ja/amazon-bedrock.md#iam-configuration) がそれを呼び出すことを許可していることを確認してください。Mantle モデル ID の場合は、[AWS アカウントチームに連絡してください](https://code.claude.com/docs/ja/amazon-bedrock.md#mantle-endpoint-errors)
* メッセージがすべての再試行で返され、[`CLAUDE_CODE_AUTO_MODE_MODEL`](https://code.claude.com/docs/ja/permission-modes#choose-the-classifier-model) で設定したモデルを示している場合は、セッションが実行されている API またはクラウドプロバイダーがそのモデル ID を提供していることを確認してください。提供していない場合は、変数を提供されているモデル ID に設定するか、変数の設定を解除して [デフォルトの分類器モデル](https://code.claude.com/docs/ja/permission-modes.md#default-classifier-model) を使用してください。

OAuth トークンの有効期限が切れたか、別のセッションによってローテーションされたために分類器リクエストが失敗した場合、Claude Code はトークンをリフレッシュし、リクエストを 1 回再試行するため、日常的なトークンの有効期限切れはこのメッセージとして表示されません。v2.1.216 より前では、有効期限が切れたまたはローテーションされたトークンによってすべての分類器リクエストが失敗し、トークンがリフレッシュされるまで auto モードはこのメッセージで確認対象のすべてのアクションを拒否していました。

分類器が解析不可能なレスポンスを返した場合：

```text theme={null}
Auto mode could not evaluate this action and is blocking it for safety — run with --debug for details
```

**対応方法：**

* アクションを再試行してください。これは通常、次の試行で成功します
* `claude --debug` を実行し、アクションを繰り返して、デバッグログで詳細を確認してください

別の API セーフティチェックが、以前の会話コンテンツのために分類器リクエストをブロックした場合：

```text theme={null}
Auto mode could not evaluate this action and is blocking it for safety — a safety check separate from auto mode blocked this request because of earlier conversation content — it isn't about the action itself — run with --debug for details
```

Claude Code はアクションを拒否しますが、Claude にこれはアクションが安全でないという判断ではなく、再試行するのではなく他のタスクを続行するよう伝えます。これらの拒否は [auto モードの一時停止しきい値](https://code.claude.com/docs/ja/permission-modes.md#when-auto-mode-falls-back) にカウントされません。[非対話](https://code.claude.com/docs/ja/headless.md) `-p` 実行では、Claude Code は実行を停止しません。Claude が受け取るものは、アクションを要求した場所によって異なります。

* `--input-format stream-json` なしの `-p` 実行における [バックグラウンドサブエージェント](https://code.claude.com/docs/ja/sub-agents.md#run-subagents-in-foreground-or-background) に対しては、Claude Code は `Agent aborted: auto mode classifier request refused by the safety safeguard in headless mode` を含むエラー結果を返します
* 対話セッションと `-p` 実行のメイン会話を含む、その他すべての場所では、Claude Code はその拒否を Claude に返します

v2.1.225 より前では、Claude Code はこれらの拒否を一時停止しきい値にカウントし、本物の分類器ブロックと同じ拒否メッセージを返していました。

**対応方法：**

* これはアクションに関する決定ではありません。会話に既にあるコンテンツが、auto モードが分類器に会話を送信したときに API のセーフティフィルターをトリガーしました
* 再試行は役に立ちません。同じ会話コンテンツがフィルターを再度トリガーします
* 対話セッションでは、別の [権限モード](https://code.claude.com/docs/ja/permission-modes.md) に切り替えて、プロンプトが表示されたときにアクションを承認できるようにしてください
* トリガーするコンテンツなしで新しい会話を開始してください

会話が Claude Code の分類器リクエストには長すぎ、Claude Code が [自動で圧縮](#was-not-reviewed-and-did-not-run) できない場合：

```text theme={null}
Auto mode classifier transcript exceeded context window — falling back to manual approval (try /compact to reduce conversation size)
```

アクションに何が起こるかは、Claude がそれを要求した場所によって異なります。

* 対話セッションでは、auto モードはそのアクションに対して通常の権限プロンプトにフォールバックするため、手動で承認または拒否できます
* `--input-format stream-json` なしの [非対話](https://code.claude.com/docs/ja/headless.md) `-p` 実行における [バックグラウンドサブエージェント](https://code.claude.com/docs/ja/sub-agents.md#run-subagents-in-foreground-or-background) に対しては、Claude Code は `Agent aborted: auto mode classifier transcript exceeded context window in headless mode` を含むエラー結果を返し、実行は続行されます
* [`--permission-prompt-tool`](https://code.claude.com/docs/ja/cli-reference#cli-flags) なしの `-p` 実行の他の場所では、フォールバックするプロンプトがないため、アクションは実行されず、実行は続行されます

**対応方法：**

* 対話セッションでは、表示されるプロンプトでアクションを承認または拒否してください
* 対話セッションでは、`/compact` を実行して会話サイズを削減し、後続のアクションが分類器ウィンドウ内に再び収まるようにしてください

### The server returned no safety verdict

[サーバー側の分類器レビュー](https://code.claude.com/docs/ja/permission-modes.md#server-side-classifier-review) では、auto モードはサーバーがアクションに対して判定を返さないときにそのアクションを拒否します。拒否は、Claude Code が判定できる場合、括弧内にカテゴリ（`(timed out)` など）を示します。

```text theme={null}
The server-side auto mode classifier gave no verdict (timed out), so auto mode cannot determine the safety of <tool>.
```

メッセージの残りの部分は、1 回の再試行が役に立つかどうかを Claude に伝えます。これらの拒否の一部では、Claude の次の試行がすぐに続かないように、Claude Code は事前に待機します。対話セッションでの待機中、スピナーは `Auto mode check unavailable` とカウントダウンを表示し、`Esc` を押すとターンが中断されます。

10 回連続で判定のないレスポンスが続くと、auto モードはターンを停止します。

```text theme={null}
Auto mode is unavailable — the server returned no safety verdict for the last 10 responses, so Claude stopped. Send a message to try again, or switch out of auto mode.
```

[フックまたは mod による変更に起因する拒否](#hook-changed-input-after-review) を含め、一部の拒否はこの 10 回にカウントされません。

停止メッセージは、セッションの種類ごとに異なる場所に表示されます。

* 対話セッションでは、メッセージはトランスクリプトに警告として表示され、ターンが終了します
* [非対話](https://code.claude.com/docs/ja/headless.md) `-p` 実行では、実行が終了し、実行エラーを報告します。デフォルトのテキスト出力では、メッセージは stderr に出力されます。
* [サブエージェント](https://code.claude.com/docs/ja/sub-agents.md) が制限に達した場合、サブエージェントは完了する前に停止し、Claude は auto モードがそれを停止したことを示すメモ付きで、それまでに生成されたものを受け取ります

**対応方法：**

* 対話セッションでは、`Ctrl+O` を押して [トランスクリプトビューアー](https://code.claude.com/docs/ja/interactive-mode.md#transcript-viewer) で拒否のテキストを読んでください。
* 拒否が `(the conversation is too long for the check)` を示している場合は、Claude Code のプロンプトで `/compact` を実行して会話を短くしてください。会話が短くなるまでは、別のメッセージを送信しても同じ拒否になります。[自動圧縮](https://code.claude.com/docs/ja/settings-reference.md#autocompactenabled) をオフにしている場合は、次回 Claude Code が自動で圧縮するように再度オンにしてください。
* 別のメッセージを送信して、Claude が再度試行するようにしてください。レスポンスのカウントはリセットされます。
* 停止が繰り返され、リクエストが [LLM ゲートウェイまたはプロキシ](https://code.claude.com/docs/ja/llm-gateway) を経由する場合は、それがストリーミングレスポンスを途中で切り詰めたり書き換えたりしていないかを確認してください。[サーバー側の分類器レビュー](https://code.claude.com/docs/ja/permission-modes.md#server-side-classifier-review) にはどのゲートウェイの動作が拒否を引き起こすかが記載され、[ゲートウェイ互換性ガイド](https://code.claude.com/docs/ja/llm-gateway-protocol.md#feature-pass-through) には変更せずにそのまま渡すべきものが記載されています。
* Claude Code を開始する前に `CLAUDE_CODE_AUTO_MODE_SERVER=0` を設定して、代わりに Claude Code 独自の分類器リクエストを使用してください。v2.1.281 より前では、Claude Code は Anthropic API への直接接続でこの変数を読み取りませんでした。
* 代わりにアクションを自分で承認するには、[auto モードから切り替えてください](https://code.claude.com/docs/ja/permission-modes.md#switch-permission-modes)

v2.1.280 より前では、Claude Code は判定のないレスポンスからの各アクションを直ちに拒否し、ターンを停止することはありませんでした。

v2.1.302 より前では、Anthropic API への直接接続において、Claude Code はサーバーのチェックには長くなりすぎた会話を圧縮しませんでした。

#### `a hook changed this call's input after auto mode reviewed it`

この拒否は、サーバーがレビューした後にフックまたは mod が [呼び出しの入力を変更した](https://code.claude.com/docs/ja/hooks.md#pretooluse-updatedinput-in-auto-mode) ため、実際に実行される内容がレビューの対象外になっていることを意味します。アクションが安全でないという判断ではありません。

同じ Claude の応答内の後続の呼び出しも、次の理由で拒否されることがあります。

```text theme={null}
another call in this response was changed after auto mode reviewed it, or could not be confirmed unchanged
```

その後 Claude は、拒否された各呼び出しを再度発行して、サーバーにレビューさせることができます。権限プロンプトが開いた場合は、それに応答してください。Claude が応答の中で auto モードが呼び出しをチェックできなかったと述べない限り、他に何もする必要はありません。そう述べた場合は、変更を止めるか呼び出しを自分で承認してから、Claude にその呼び出しを再試行するよう依頼してください。

* **変更を止める**: その呼び出し、または同じ Claude の応答内のそれより前の呼び出しを変更した [フック](https://code.claude.com/docs/ja/hooks.md#disable-or-remove-hooks) または [mod](https://code.claude.com/docs/ja/plugins/mods/overview.md#turn-mods-on-or-off) をオフにするか、管理者にオフにするよう依頼してください。フックを探すには、Claude Code のプロンプトで [`/hooks`](https://code.claude.com/docs/ja/hooks#the-%2Fhooks-menu) を実行します。ターミナルセッションでは、`/plugin` を実行してアクティブな mod を確認できます。
* **呼び出しを自分で承認する**: [Manual モードに切り替えてください](https://code.claude.com/docs/ja/permission-modes.md#switch-permission-modes)

### Was not reviewed and did not run

`was not reviewed and did not run` 拒否は、会話が長すぎて [auto モード](https://code.claude.com/docs/ja/permission-modes.md#eliminate-prompts-with-auto-mode) の分類器がアクションをチェックできず、アクションが実行されなかったことを意味します。Claude Code は次のメッセージを Claude に返します。

```text theme={null}
<tool> was not reviewed and did not run: the conversation is too long for auto mode's classifier. Claude Code will try to compact the conversation before the next request; if this action is still needed after that, issue it again and it will be reviewed normally.
```

コンテキスト圧縮が失敗した場合、分類器がチェックできない以降のアクションには、次の 2 つの別のメッセージのいずれかが表示されます。

* [`gave no verdict (the conversation is too long for the check)`](#the-server-returned-no-safety-verdict) 拒否
* [`Auto mode classifier transcript exceeded context window`](#auto-mode-cannot-determine-the-safety-of-an-action) メッセージ

**対応方法：**

* メッセージが予告している圧縮が成功した場合は、何もする必要はありません。
* これら 2 つのメッセージのいずれかが表示された場合は、Claude Code のプロンプトで `/compact` を実行して、自分で会話を短くしてください。[自動圧縮](https://code.claude.com/docs/ja/settings-reference.md#autocompactenabled) をオフにしている場合は、次回 Claude Code が自動で圧縮するように再度オンにしてください。

### Agent terminated early due to an API error

[サブエージェント](https://code.claude.com/docs/ja/sub-agents.md) の API リクエストが回復不能な形で失敗しました。例えば、使用制限に達したか、サーバーエラーの再試行を使い果たしたため、サブエージェントはタスクを完了する前に停止しました。このメッセージには Claude Code v2.1.199 以降が必要です。それ以前は、API エラーテキストはサブエージェントの結果であるかのように Claude に返されていました。

```text theme={null}
Agent terminated early due to an API error: <error detail>
```

**対応方法：**

* コロンの後のエラー詳細を、このページの該当するセクション（[Usage limits](#usage-limits) や [Server errors](#server-errors) など）と照合し、そのセクションの手順に従ってください
* 根本のエラーが解消されたら、Claude にタスクを再試行するか、[サブエージェントを再開する](https://code.claude.com/docs/ja/sub-agents.md#resume-subagents) よう依頼してください

レート制限、オーバーロード、またはサーバーエラーが、既にテキスト出力を生成したフォアグラウンドサブエージェントを中断した場合、Claude はこのエラーの代わりに、不完全としてマークされたその部分的な出力を受け取ります。出力がツール呼び出しのみだったサブエージェントもこのエラーを受け取ります。v2.1.199 では、その形の出力は代わりに空の部分的な結果を返していました。[API errors in subagents](https://code.claude.com/docs/ja/sub-agents.md#api-errors-in-subagents) を参照してください。

## 使用制限

このセクションのエラーのほとんどは、アカウントまたはプランに紐づいたクォータに達したことを意味します。ただし、3 つは異なる仕組みで動作します。[`Server is temporarily limiting requests`](#server-is-temporarily-limiting-requests) はプランのクォータとは無関係なサーバー側のスロットリングです。[`Usage credits required for 1M context`](#usage-credits-required-for-1m-context) はクォータの枯渇ではなく利用資格のチェックです。[`The prompt to confirm went unanswered`](#the-prompt-to-confirm-went-unanswered) は、クォータに達したかどうかにかかわらず、使用クレジットの同意プロンプトが応答のないまま閉じられたことを意味します。

### You've hit your session limit

サブスクリプションプランには、ローリング方式の使用量枠が含まれています。これを使い切ると、次のいずれかのメッセージが表示されます。

```text theme={null}
You've hit your session limit · resets 3:45pm
You've hit your weekly limit · resets Mon 12:00am
You've hit your Opus limit · resets 3:45pm
You've hit your Sonnet limit · resets 3:45pm
```

Claude Code は、メッセージに表示されたリセット時刻まで以降のリクエストをブロックします。セッション制限と週間制限はすべてのモデルで共有されるため、モデルを切り替えてもアクセスは回復しません。Opus 制限と Sonnet 制限はそれぞれそのモデルファミリーへのリクエストにのみ適用されるため、`/model` でファミリー外のモデルに切り替えれば作業を続けられます。

claude.ai サブスクリプションでサインインしたインタラクティブセッションでは、Claude Code が開いているセッション内で待機し、リセット直後に中断されたタスクを続行することもできます。表示される内容、待機の開始方法やキャンセル方法、自動続行をオフにする方法については、[使用制限のリセットを待つ](https://code.claude.com/docs/ja/interactive-mode.md#wait-for-a-usage-limit-to-reset)を参照してください。v2.1.234 より前の Claude Code では、この待機機能は提供されていませんでした。

使用量はセッション枠と週間枠の両方に同時に計上されます。大規模なワークフローのファンアウトなど、短時間に集中した大量の処理によって、セッションのウィンドウがリセットされる前に週間枠を使い切ってしまうことがあります。

**対処方法:**

* エラーに表示されたリセット時刻まで待ちます
* [デスクトップアプリ](https://code.claude.com/docs/ja/desktop.md)の Code タブでは、セッション制限のカードに **Auto-continue when limits reset** チェックボックスが表示されます。週間制限のカードには表示されません。チェックを入れると、デスクトップアプリはリセット後に中断されたターンを再試行し、カードに再試行時刻を表示します。デスクトップのチェックボックスと、CLI の `/config` にある **Continue automatically at usage limit** 設定は別々のものなので、それぞれ個別にオフにしてください。
* Opus 制限または Sonnet 制限の場合は、`/model` を実行してそのファミリー外のモデルに切り替えれば作業を続けられます。モデルごとに独自のプロンプトキャッシュがあるため、次のリクエストではキャッシュヒットなしで会話全体が再度読み込まれます。[モデルの切り替え](https://code.claude.com/docs/ja/prompt-caching.md#switching-models)を参照してください
* `/usage` を実行して、プランの制限とリセット時刻を確認します
* `/usage-credits` を実行すると、Pro、Max、Ultra では追加の使用量を購入でき、Team と Enterprise では管理者に追加の使用量を要求できます。課金方法については[有料プランの使用クレジット](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans)を参照してください。
* 基本の制限を引き上げるためにプランをアップグレードするには、[claude.com/pricing](https://claude.com/pricing) を参照してください

ウィンドウを使い切る前に、Claude Code は `You've used 85% of your session limit · resets 3:45pm` のようなメッセージで、大部分を使用したことを警告する場合があります。残りの使用量枠を確認するには、[カスタムステータスライン](https://code.claude.com/docs/ja/statusline.md#rate-limit-usage)に `rate_limits` フィールドを追加するか、デスクトップアプリで[使用量リング](https://code.claude.com/docs/ja/desktop.md#check-usage)をクリックします。

### Usage credits required for 1M context

選択したモデルが 100 万トークンの拡張コンテキストウィンドウを使用しており、ご利用のプランでは使用クレジットを通じてのみこれが利用可能です。

```text theme={null}
API Error: Usage credits required for 1M context · run /usage-credits to turn them on (they take effect after you restart Claude Code), or /model to switch to standard context
```

Claude デスクトップアプリが実行するセッションでは、ヒントにコマンド名は含まれません。claude.ai の使用量設定ページを案内するか、Team および Enterprise プランでは claude.ai/admin-settings/usage で使用クレジットをオンにするか管理者に依頼するよう案内します。

これはクォータの枯渇ではなく、利用資格のチェックです。セッション枠と週間枠に残りがある場合でも発生します。どのプランで 100 万コンテキストが直接含まれ、どのプランで使用クレジットが必要かについては、[拡張コンテキスト](https://code.claude.com/docs/ja/model-config.md#extended-context)を参照してください。

コンテキストが 20 万トークンを超えたために会話の途中でこのエラーが表示された場合、Claude Code は会話を自動的にコンパクト化して標準のコンテキスト制限内に戻し、その後もセッションをその制限内に保つため、対処は不要です。v2.1.172 より前のバージョンでは、`/compact` を含む以降のすべてのリクエストでこのエラーが繰り返し発生していました。それらのバージョンで復旧するには `/clear` を実行してください。以下の手順は、明示的に `[1m]` モデルを選択した場合に適用されます。

**対処方法:**

* `/model` を実行し、`[1m]` サフィックスのないバリアントを選択して標準のコンテキストウィンドウに戻します
* メッセージに `/usage-credits` が示されている場合は、それを実行して、Pro、Max、Ultra では 100 万バリアントの従量課金をオンにし、Team と Enterprise では管理者に使用クレジットを要求します。使用クレジットがオンになったら、メッセージの指示に従って Claude Code を再起動するか、新しいセッションを開始します。それまでは、セッションは標準のコンテキスト制限のままです。
* `/model` の後もエラーが続く場合は、100 万モデルの ID が別の場所で設定されている可能性があります。優先順位順に確認すべき設定場所については、[モデルの設定](https://code.claude.com/docs/ja/model-config.md#setting-your-model)を参照してください。
* モデルピッカーから 100 万バリアントを完全に削除するには、[`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](https://code.claude.com/docs/ja/env-vars) を設定します

v2.1.268 より前では、メッセージの末尾は `run /usage-credits to turn them on, or /model to switch to standard context` で、再起動については触れていませんでした。

### The prompt to confirm went unanswered

[Fable の使用クレジット同意プロンプト](https://code.claude.com/docs/ja/model-config.md#fable-and-usage-credits)が誰にも応答されないまま閉じられると、Claude Code は次のいずれかのメッセージでターンを終了します。

```text theme={null}
Fable limit reached · continuing on Fable 5.1 uses usage credits, and the prompt to confirm went unanswered · nothing was sent · answer it where this session is running, or /model to change
Fable 5.1 now uses usage credits · the prompt to confirm went unanswered · nothing was sent · answer it where this session is running, or /model to change
```

メッセージにはセッションの Fable モデル名が含まれるため、Fable 5.2 では `continuing on Fable 5.2` および `Fable 5.2 now uses usage credits` と表示されます。[Remote Control](https://code.claude.com/docs/ja/remote-control.md) が接続されている場合、各メッセージの末尾は代わりに `Claude stopped here · send a message to be asked again, or switch models` になることがあります。v2.1.257 より前では、最初のメッセージは `Fable 5 limit reached` で始まっていました。

これは、[Remote Control](https://code.claude.com/docs/ja/remote-control.md) セッション、[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)、[エージェントチーム](https://code.claude.com/docs/ja/agent-teams.md)のチームメイトセッション、および別のアプリケーションが Agent SDK を通じてホストするセッションで発生します。Claude Code がプロンプトを閉じるタイミングについては、[Fable と使用クレジット](https://code.claude.com/docs/ja/model-config.md#fable-and-usage-credits)を参照してください。

**対処方法:**

* セッションが実行されている場所（ターミナル、またはセッションをホストしているアプリケーション）で別のプロンプトを送信し、同意プロンプトが再表示されたら応答します。バックグラウンドセッションの場合は、まず[エージェントビュー](https://code.claude.com/docs/ja/agent-view.md)からアタッチします。メッセージに `Claude stopped here` と表示されている場合は、接続しているデバイスから返信して、そこで同意プロンプトに応答することもできます。
* `/model` を実行して、使用クレジットが課金されないモデルに切り替えます
* より長い時間を確保するには、[`dialogExpiry`](https://code.claude.com/docs/ja/settings-reference#dialogexpiry) をより長い値または `"never"` に設定します

v2.1.236 より前では、このメッセージは表示されませんでした。Remote Control クライアントが接続されている間、Claude Code は応答を 60 秒間待機し、その後デフォルトのモデルでターンを続行していました。

### Server is temporarily limiting requests

API が、プランのクォータとは無関係な短期間のスロットリングを適用しました。

```text theme={null}
API Error: Server is temporarily limiting requests (not your usage limit)
```

Claude Code は、実際の制限のレスポンスに含まれる統合クォータヘッダーがないことによって、これをプランの制限と区別します。v2.1.199 以降では、認証方法にかかわらず、表示される前にバックオフ付きで[自動的に再試行](#automatic-retries)されます。それ以前のバージョンでは、claude.ai サブスクリプションでサインインしたセッションは最初の発生時にターンが失敗し、API キーおよび Enterprise のサインインのみが再試行していました。

**対処方法:**

* 少し待ってから再試行します
* 解消しない場合は [status.claude.com](https://status.claude.com) を確認します

### Request rejected (429)

API キー、Amazon Bedrock プロジェクト、または Google Cloud プロジェクトに設定されたレート制限に達しました。

```text theme={null}
API Error: Request rejected (429) · this may be a temporary capacity issue. If it persists, check https://status.claude.com.
```

末尾の文はサービスの稼働状況を確認する場所を示しており、プロバイダーによって異なります。Amazon Bedrock、Google Cloud の Agent Platform、Microsoft Foundry の設定では、Anthropic のステータスページの代わりにそのプロバイダーのサービスステータスが示されます。カスタムの `ANTHROPIC_BASE_URL` の場合は、ゲートウェイのホストが示されます。

Claude Code と API の間にあるプロキシ、ロードバランサー、またはゲートウェイが独自の HTML の 429 ページで応答した場合、`·` の後のテキストは、そのページにタイトルがあればそのタイトル（`Too Many Requests` など）になります。v2.1.281 より前では、ページ全体のマークアップが `·` の後に出力されていました。

**対処方法:**

* `/status` を実行し、有効な認証情報が想定どおりのものであることを確認します。環境内に不要な `ANTHROPIC_API_KEY` が残っていると、サブスクリプションではなく低いティアのキーを経由してリクエストが送信される場合があります。
* プロバイダーのコンソールで有効な制限を確認し、必要に応じてより高いティアをリクエストします
* Anthropic API キーの場合、ティアの仕組みとワークスペースごとの上限の設定方法については、[レート制限のリファレンス](https://platform.claude.com/docs/en/api/rate-limits)を参照してください
* 同時実行数を減らします。多数のサブエージェントを並列で実行するのを避けるか、大量のスクリプト実行では `/model` でより小さなモデルに切り替えます

### You've hit your monthly spend limit

プランに含まれる使用量ではこのリクエストをカバーできず、本来その支払いに充てられる[使用クレジット](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans)が支出上限に達しています。プランの使用量ウィンドウのいずれかを使い切った場合、または使用クレジットのみがそのリクエストの支払いに充てられる場合、プランではリクエストをカバーできません。その一例が、[使用クレジットに課金される](https://code.claude.com/docs/ja/model-config.md#fable-and-usage-credits)モデルへのリクエストです。

`·` の前の語句は、組織の月間支出上限など、ブロックの原因となった上限を示し、その後のテキストはその上限を引き上げてもらう方法を示します。クラウドセッションまたは [Remote Control](https://code.claude.com/docs/ja/remote-control.md) 下では、そのテキストに URL は含まれず、自分自身の `monthly spend limit` に関するメッセージには引き上げ方法が記載されません。その他のセッションでは、次のような形式で表示されます。

```text theme={null}
You've hit your monthly spend limit · raise it at https://claude.ai/settings/usage?from=cc_cli_limit_message
You've hit your individual spend limit · ask your admin for a higher limit
You've hit your org's monthly spend limit · visit https://claude.ai/admin-settings/usage to raise it
You've hit your team's shared budget · ask your admin to raise it at https://claude.ai/admin-settings/usage
You've hit your channel's monthly spend limit · an org owner or channel manager can raise it in the channel's Claude settings
```

`team's shared budget` は、ユーザーが所属するグループに管理者が割り当てた共有予算です。メッセージにはグループ名は示されません。`channel's monthly spend limit` は、セッションが実行されている 1 つの Slack チャンネルの予算であるため、組織にはそれ以外に予算が残っている場合があります。

使い切ったのがプランのウィンドウのいずれかである場合、メッセージにはそのウィンドウのリセット時刻も示されます（例: `· your session limit resets 3:45pm`）。その時刻になれば、誰かが上限を引き上げなくてもアクセスが回復します。使用量ベースの請求を利用している組織では、メッセージに `spend limit` の代わりに `usage limit` と表示されます（例: `You've hit your individual usage limit`）。

Claude apps ゲートウェイ経由で接続していて、小文字の `spend limit reached` が表示される場合、それはゲートウェイ運用者による上限です。[Spend limit reached](#spend-limit-reached) を参照してください。

**対処方法:**

* Pro、Max、Ultra では、claude.ai の [**Settings > Usage**](https://claude.ai/settings/usage) で月間支出上限を引き上げるか、`/usage-credits` を実行します
* Team と Enterprise では、請求を管理している場合は [**Organization settings > Usage**](https://claude.ai/admin-settings/usage) で上限を引き上げるか、管理者に依頼します。`/usage-credits` を使うと、その依頼が管理者に送信されます
* チャンネルの上限の場合は、組織のオーナーまたはチャンネルの管理者に claude.ai で引き上げるよう依頼します。Claude Tag ドキュメントの[チャンネルごとの上限](https://claude.com/docs/claude-tag/admins/set-spend-limit#per-channel-limits)を参照してください
* メッセージにプランのウィンドウのリセット時刻が示されている場合は、代わりにその時刻まで待つこともできます
* `/usage` を実行して、プランのウィンドウとそれぞれのリセット時刻を確認します

### Spend limit reached

[Claude apps ゲートウェイ](https://code.claude.com/docs/ja/claude-apps-gateway)経由で接続しており、ゲートウェイ運用者が設定した[支出上限](https://code.claude.com/docs/ja/claude-apps-gateway-spend-limits.md)に達しました。ゲートウェイは、運用者が上限を引き上げるまで、または上限が \$0 を超えている場合はリセットされるまで、リクエストをブロックします。ブロックされた各 `429` レスポンスには `x-should-retry: false` が付与されるため、ターミナルでは Claude Code が再試行せずにこのメッセージを表示します。

```text theme={null}
spend limit reached · resets Dec 1
```

メッセージに日付があるかどうかを確認します。

* **日付がある場合**: 上限はその日付の 00:00 UTC にリセットされます
* **日付がない場合**: 上限が \$0 であるか、ゲートウェイが v2.1.225 より前のバージョンを実行しています

メッセージ内のそれ以外のテキストは、ゲートウェイ運用者からの注記です。

ゲートウェイサーバーの v2.1.225 から v2.1.319 までは、メッセージに上限の期間とリセット時刻が示されていました（例: `spend limit reached (daily; resets 2026-08-09 00:00 UTC)`）。

**対処方法:**

* メッセージに日付がある場合は、リセットまで待つか、メッセージに運用者の注記があればそれに従います
* メッセージに日付がない場合、日付を過ぎてもブロックされている場合、または日常的に上限に達する場合は、ゲートウェイ運用者に上限の引き上げを依頼します

もう 1 つのゲートウェイメッセージ `This request exceeds your group's budget` は、グループの[共有予算](https://code.claude.com/docs/ja/claude-apps-gateway-config.md#pooled-budget-order)を使い切ったことを意味します。メッセージに示された手順に従ってください。

```text theme={null}
This request exceeds your group's budget. Ask your organization's admins to raise it, or try again after it resets on November 1 at 00:00 UTC.
```

関連するメッセージ `spend limit unavailable` は、ゲートウェイが支出記録を読み取れなかったため、上限超過ではなく予防措置としてリクエストをブロックしたことを意味します。通常は自然に解消されます。解消しない場合は、ゲートウェイ運用者に連絡してください。

### Credit balance is too low

Console の組織のプリペイドクレジットが不足しているか、サブスクリプションを使用するつもりだったのに Claude Code が Console の API キーでリクエストを送信しています。

```text theme={null}
Credit balance is too low
Credit balance too low · Add funds: https://platform.claude.com/settings/billing
```

**対処方法:**

* Pro、Max、Ultra、Team、または Enterprise プランを利用していてこのメッセージが表示される場合は、`/status` を実行して `API key` の行を確認します。環境内に承認済みの `ANTHROPIC_API_KEY` があると、サブスクリプションではなくそのキーを経由してリクエストが送信されます。現在のシェルでその設定を解除してシェルプロファイルから削除し、`claude` を再起動します。まだサブスクリプションでサインインしていない場合は `/login` を実行します。
* [platform.claude.com/settings/billing](https://platform.claude.com/settings/billing) でクレジットを追加します。残高がゼロになる前に補充されるよう、そこで自動チャージを有効にすることも検討してください
* 1 つのプロジェクトが組織の残高を使い果たすのを防ぐため、Console でワークスペースごとの支出上限を設定します。[コストを効果的に管理する](https://code.claude.com/docs/ja/costs.md)を参照してください。

### Could not update your spend limit

支出上限に達したときに表示されるプロンプトから行った支出上限の変更を、サーバーが拒否しました。

```text theme={null}
Could not update your spend limit: <reason from the server>
```

サーバーが拒否の理由を示した場合、メッセージの末尾にその理由が表示され、同じ値で再試行しても再び失敗します。接続の切断など、サーバーから理由が提供されない失敗の場合、メッセージは `Could not update your spend limit. Press Enter to retry.` となり、再試行すると成功する可能性があります。v2.1.216 より前では、Claude Code はすべての失敗に対して汎用の形式を表示していました。

上限を削除した場合、v2.1.327 以降では汎用の形式は `Could not remove your spend limit` で始まります。

**対処方法:**

* メッセージに理由が含まれている場合は、より低い金額など、その理由を満たす上限を選択します
* メッセージに汎用の形式のみが表示されている場合は、再試行します。一時的な失敗である可能性があります
* 変更が何度も失敗する場合は、代わりにブラウザで [claude.ai の請求設定](https://support.claude.com/en/articles/12429409-extra-usage-for-paid-claude-plans)から変更します

## 認証エラー

これらのエラーは、Claude Code が API に対してユーザーの身元を証明できないことを意味します。`/status` をいつでも実行すると、現在どの認証情報が有効かを確認できます。

### Not logged in

このセッションで使用できる有効な認証情報がありません。

```text theme={null}
Not logged in · Please run /login
```

Code タブや Cowork など、Claude Desktop アプリが実行するセッションでは、メッセージは `Authentication required · Sign in again to continue` となり、アプリから再度サインインします。

同じ[設定ディレクトリ](https://code.claude.com/docs/ja/claude-directory.md)を使用する別の Claude Code ウィンドウで claude.ai アカウントを使ってサインインすると、このメッセージを表示している対話セッションは自動的にそのログインを使い始めます。再起動する必要はありません。

macOS の v2.1.286 より前では、別のウィンドウからサインインした後も、セッションがメッセージを表示し続けることがありました。これらのバージョンでは、メッセージを表示しているセッションを再起動してください。

**対処方法：**

* `/login` を実行して、Claude サブスクリプションまたは Console アカウントで認証します
* 環境変数で認証されることを想定していた場合は、`claude` を起動したシェルで `ANTHROPIC_API_KEY` が設定され、エクスポートされていることを確認します
* 対話的なログインができない CI や自動化では、起動時にキーを取得する [`apiKeyHelper`](https://code.claude.com/docs/ja/settings-reference#apikeyhelper) スクリプトを設定します
* 誰かが同じ claude.ai アカウントと組織に再度サインインしたときに `claude -p` ジョブがこのメッセージで終了する場合は、そのサインインを実行している環境の Claude Code を更新します。v2.1.318 より前では、Claude Code はそのサインイン中に、新しいログインを保存する前に保存済みのログインを削除していました。
* 複数の認証情報がある場合に Claude Code がどれを使用するかについては、[認証の優先順位](https://code.claude.com/docs/ja/authentication.md#authentication-precedence)を参照してください

ログインを繰り返し求められる場合は、システムクロックの確認と macOS の認証情報ストレージの復旧手順について、[ログインしていない、またはトークンの有効期限切れ](https://code.claude.com/docs/ja/troubleshoot-install.md#not-logged-in-or-token-expired)を参照してください。

### Could not resolve authentication method

セッションが認証情報なしで API クライアントに到達しました。対話実行、`-p` 実行、または Agent SDK 実行で [Not logged in](#not-logged-in) が表示され、この文字列がそのデバッグログにある場合は、そのエントリの手順に従ってください。

```text theme={null}
Could not resolve authentication method. Expected one of apiKey, authToken, credentials, config, or profile to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted
```

v2.1.174 より前では、アイドル状態の事前初期化済みワーカーに割り当てられたバックグラウンドセッションが、有効な認証情報が設定されていてもこのように失敗することがありました。v2.1.176 より前では、割り当てられる前にアイドル状態だったクラウドセッションでも同様に失敗することがありました。復旧するにはアップグレードしてください。

**対処方法：**

* バックグラウンドセッションまたはクラウドセッションでこれが表示され、認証情報がすでに設定されている場合は、v2.1.176 以降にアップグレードします
* `ANTHROPIC_API_KEY`、`CLAUDE_CODE_OAUTH_TOKEN`、またはクラウドプロバイダーの認証情報が、対話シェルだけでなく、ワーカーを起動する環境で設定されていることを確認します
* Agent SDK については、[クイックスタートの認証設定](https://code.claude.com/docs/ja/agent-sdk/quickstart.md#setup)を参照してください
* 同じ環境の対話セッションで `/status` を実行して、どの認証情報ソースが解決されるかを確認します

### Invalid API key

`ANTHROPIC_API_KEY` 環境変数または `apiKeyHelper` スクリプトが API に拒否されたキーを返したか、Claude Code が `ANTHROPIC_API_KEY` のキーを送信前にブロックしました。

```text theme={null}
Invalid API key · Fix external API key
```

メッセージが `Fix external API key` の後に `Invalid X-Api-Key header value from ANTHROPIC_API_KEY: it contains a line break at character 41 (120 characters on 2 lines).` のような説明で続く場合、キーは API に届いていません。Claude Code が HTTP ヘッダーで扱えない文字を検出し、送信前にリクエストを停止しました。説明の読み方と値の修正方法については、[Invalid request header value](#invalid-request-header-value) を参照してください。

**対処方法：**

* タイプミスがないか確認し、[Console](https://platform.claude.com/settings/keys) でキーが取り消されていないことを確認します
* 同じシェルで `env | grep ANTHROPIC` を実行するか、PowerShell では `Get-ChildItem Env:ANTHROPIC*` を実行します。direnv、dotenv シェルプラグイン、IDE のターミナルなどのツールは、明示的に設定しなくても、プロジェクト内の `.env` ファイルから古いキーを読み込むことがあります。
* `ANTHROPIC_API_KEY` の設定を解除し、`/login` を実行して代わりにサブスクリプション認証を使用します
* キーが [`apiKeyHelper`](https://code.claude.com/docs/ja/settings-reference#apikeyhelper) スクリプトから取得される場合は、スクリプトを直接実行して、有効なキーが stdout に出力されることを確認します
* `/status` を実行して、Claude Code が実際に使用している認証情報ソースを確認します

### Your apiKeyHelper script is failing

Claude Code は [`apiKeyHelper`](https://code.claude.com/docs/ja/settings-reference#apikeyhelper) 設定のコマンドを実行しましたが、キーが返されませんでした。キーがない場合、リクエストはプレースホルダーの認証情報で API に到達し、API はそれを `401` で拒否します。ターミナルのパネルに、次のどれが起きたかが表示されます:

* コマンドがエラーで終了したか、タイムアウトした
* コマンドが stdout に何も出力しなかった
* コマンドが、ログインバナーやログ行など、キー以外のものを出力した。パネルには `returned output that cannot be used as an API key` と表示され、出力を繰り返さずに何が問題かが示されます。v2.1.227 より前では、Claude Code はコマンドが出力した内容を、前後の空白を取り除いた上でそのまま送信していました。

```text theme={null}
Your apiKeyHelper script is failing · This usually means you need to re-authenticate with your provider · Run /status to see the script's error output
```

[非対話モード](https://code.claude.com/docs/ja/headless.md)では、stderr にも `apiKeyHelper failed:` で始まる具体的な理由が出力されます。

Claude Code はこのメッセージを表示する前に、スクリプトを再実行してリクエストを最大 2 回まで再試行するため、失敗は 3 回以内の試行で表面化します。v2.1.208 より前では、Claude Code は[再試行の上限](#automatic-retries)をすべて使い切ってプレースホルダーの認証情報でリクエストを再送信し、その後スクリプトの失敗ではなく一般的な `401` 認証エラーを報告していました。

ここで `/login` を実行しても解決しません。設定が存在する限り、ヘルパーの出力は保存済みのログインより[優先される](https://code.claude.com/docs/ja/authentication.md#authentication-precedence)ためです。

**対処方法：**

* `apiKeyHelper` に設定されたコマンドをシェルで直接実行して、失敗を再現します
* コマンドがセッションの期限切れを報告する場合は、SSO やシークレットボールトに再度サインインするなどして、認証情報プロバイダーで再認証します
* コマンドを修正して、キーのみを最大 16,384 文字の印刷可能な ASCII からなる単一のトークンとして stdout に出力し、終了コード 0 で終了するようにします。動作する設定については、[apiKeyHelper で認証情報をローテーションする](https://code.claude.com/docs/ja/llm-gateway-connect.md#rotate-credentials-with-apikeyhelper)を参照してください。
* `/status` を実行して失敗を確認し、`apiKeyHelper` が有効な認証情報ソースであることを確認します。`apiKeyHelper` の行には `Failing` と、終了コードやコマンドのエラー出力など最後の失敗の詳細が表示され、次に実行が成功すると消えます。v2.1.274 より前では、`/status` には認証情報ソースのみが表示され、失敗は表示されませんでした。

### Claude Code didn't send your claude.ai login

これらのメッセージは、Claude Code がリクエストを拒否し、claude.ai のログインを送信しなかったことを意味します：

```text theme={null}
Your organization's settings need an update. Ask your administrator to fix the API key helper configuration.
Couldn't load your organization's settings. Check your connection, then restart Claude Code.
Restart Claude Code to finish signing in.
```

**対処方法：**

* `Your organization's settings need an update`：管理者に API キーヘルパーの設定を修正するよう依頼します
  * マシンにどの管理ソースがあるかを管理者に伝えるには、Claude Code のプロンプトで `/status` を実行し、[`Setting sources` 行](https://code.claude.com/docs/ja/managed-settings#read-the-source-in-/status)をコピーします。`Skipped sources` 行が表示されている場合は、それもコピーします
  * 設定を管理していて、ヘルパーがマシンの管理設定ファイルまたは MDM ポリシーにある場合は、[マシンの `apiKeyHelper` が有効にならない場合](https://code.claude.com/docs/ja/server-managed-settings#machine-apikeyhelper-not-in-effect)を参照してください
* `Couldn't load your organization's settings`：接続を確認してから、Claude Code を再起動します。再起動後もメッセージが再び表示される場合は、管理者に伝えてください
* `Restart Claude Code to finish signing in`：Claude Code を再起動します

v2.1.315 より前では、拒否されたプロンプトまたはファイルアップロードで、`Claude Code didn't send your claude.ai login` で始まる 1 つのメッセージが出力されていました。

### Invalid request header value

Claude Code がリクエストヘッダーとして送信しようとしていた値に、HTTP ヘッダーで扱えない文字が含まれています。改行、NUL バイト、または曲線引用符やゼロ幅スペースなどの `U+00FF` を超える文字です。Claude Code は何かを送信する前にリクエストを停止し、修正すべき変数または設定を示します。よくある原因は、ドキュメントやチャットから貼り付けた認証情報に、目に見えない文字や余分な改行が含まれていたことです。

Claude Code は、Claude API に直接、または [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)経由でリクエストを送信するときにこのチェックを実行します。[Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md) などのサードパーティのクラウドプロバイダーでは、Claude Code は送信前にこのチェックを実行しません。

```text theme={null}
Invalid auth token · Fix external auth token
Invalid ANTHROPIC_CUSTOM_HEADERS · Fix the environment variable
Invalid request header from the environment · Fix the environment variable
```

メッセージの最初の部分は、不正な値がどこから来たかによって異なります：

* `Invalid auth token`：[`ANTHROPIC_AUTH_TOKEN`](https://code.claude.com/docs/ja/env-vars) または [`CLAUDE_CODE_OAUTH_TOKEN`](https://code.claude.com/docs/ja/env-vars) からのベアラートークン
* `Invalid ANTHROPIC_CUSTOM_HEADERS`：[`ANTHROPIC_CUSTOM_HEADERS`](https://code.claude.com/docs/ja/env-vars) に設定したヘッダー名または値。説明では、どの `Name: Value` ペアに問題があるかを `distinct header 2 of 3 parsed from ANTHROPIC_CUSTOM_HEADERS` のように番号で示し、名前や値は繰り返しません。どちらもユーザー自身が選んだものだからです。
* `Invalid request header from the environment`：`CLAUDE_AGENT_SDK_CLIENT_APP` など、Claude Code が別の環境変数からリクエストヘッダーにコピーする値。説明には修正すべき変数が示されます。

このチェックで検出された不正な `ANTHROPIC_API_KEY` は、同じ末尾の説明付きで [Invalid API key](#invalid-api-key) として報告されます。不正な保存済みの `/login` 認証情報は、代わりに [Not logged in](#not-logged-in) として報告されます。`/login` を実行して新しい認証情報を保存してください。[`apiKeyHelper`](https://code.claude.com/docs/ja/settings-reference#apikeyhelper) スクリプトの出力がこのチェックに到達することはありません。Claude Code はスクリプトの実行時に出力を検証し、HTTP ヘッダーで扱えない出力は [Your apiKeyHelper script is failing](#your-apikeyhelper-script-is-failing) で失敗します。

2 つ目の `·` の後には、次の完全な例のように、メッセージが問題を説明します：

```text theme={null}
Invalid auth token · Fix external auth token · Invalid Authorization header value from ANTHROPIC_AUTH_TOKEN: it contains a line break at character 41 (120 characters on 2 lines).
```

位置は 1 から始まる文字数で数えます。説明は固定の語句と文字数から組み立てられるため、値そのものが含まれることはありません。問題の文字名が示されるのは、バイトオーダーマーク、ゼロ幅スペース、曲線引用符など、よく知られた不可視文字または印刷用の文字である場合のみで、それ以外はすべて `a non-ASCII character` として報告されます。

**対処方法：**

* メッセージが示す変数または設定を再設定します。同じソースから再度貼り付けるのではなく、報告された位置の周辺の文字を入力し直してください
* `ANTHROPIC_CUSTOM_HEADERS` の場合は、1 行に 1 つの `Name: Value` ペアを記述し、メッセージが番号で示したペアを書き直します
* `/status` を実行して、有効な認証情報ソースを確認します

### This organization has been disabled

Claude Code が、無効化された Console 組織の古い `ANTHROPIC_API_KEY` を使用しています。保存済みのサブスクリプションログインがある場合は、キーがそれを上書きします。

```text theme={null}
Your ANTHROPIC_API_KEY belongs to a disabled organization · Unset the environment variable to use your subscription instead
Your ANTHROPIC_API_KEY belongs to a disabled organization · Update or unset the environment variable
API Error: 400 ... This organization has been disabled.
```

`·` の後のヒントは、保存済みの認証情報によって異なります。1 つ目の形式は、キーの設定を解除した後に保存済みの `/login` が引き継げる場合に表示され、2 つ目の形式は、キーが唯一の認証情報である場合に表示されます。

シェルプロファイルでキーをエクスポートしているか、`.env` からキーを読み込んでいる場合、Pro、Max、Ultra のサブスクリプションが有効であっても、Claude Code は `/login` の代わりにそのキーを使用します。非対話モード（`-p`）では、キーが存在すれば常に使用されます。

**対処方法：**

* 現在のシェルで `ANTHROPIC_API_KEY` の設定を解除してシェルプロファイルから削除し、`claude` を再起動します
* メッセージに `Update or unset` とある場合、フォールバック先となる保存済みのログインはありません。キーの設定を解除して `/login` を実行するか、キーを有効な Console 組織のキーに置き換えます。
* その後 `/status` を実行して、有効な認証情報がサブスクリプションであることを確認します
* 環境変数が設定されていないのにエラーが続く場合は、サポートに連絡するか、別のアカウントでサインインしてください。

### Your organization has disabled API key authentication

このメッセージには Claude Code v2.1.169 以降が必要です。Console 組織の管理者が API キー認証をオフにしているため、API は Claude Code が送信しているキーを拒否します。`·` の後の復旧のヒントは、キーの取得元によって異なります：

```text theme={null}
Your organization has disabled API key authentication · Run /login to sign in with your claude.ai account
Your organization has disabled API key authentication · Unset ANTHROPIC_API_KEY to use your claude.ai account instead
Your organization has disabled API key authentication · Unset ANTHROPIC_API_KEY and run /login to sign in with your claude.ai account
Your organization has disabled API key authentication · Unset the apiKeyHelper setting and run /login to sign in with your claude.ai account
Your organization has disabled API key authentication · Sign in again with your claude.ai account
```

最後の形式は、Code タブや Cowork など Claude Desktop アプリが実行するセッションで表示され、その場合はアプリから再度サインインします。

環境変数と `apiKeyHelper` は `/login` より優先されるため、どちらかがまだキーを提供している間は、`/login` を実行するだけでは解決しません。[認証の優先順位](https://code.claude.com/docs/ja/authentication.md#authentication-precedence)を参照してください。

**対処方法：**

* メッセージに `ANTHROPIC_API_KEY` が示されている場合は、現在のシェルで設定を解除し、シェルプロファイルまたは `.env` ファイルから削除してから、`claude` を再起動します
* メッセージに `apiKeyHelper` が示されている場合は、`settings.json` から [`apiKeyHelper`](https://code.claude.com/docs/ja/settings-reference#apikeyhelper) 設定を削除します
* `/login` を実行して claude.ai アカウントでサインインします
* その後 `/status` を実行して、有効な認証情報が API キーではなくサブスクリプションであることを確認します
* 自動化のために API キー認証が必要な場合は、組織の管理者に Console で再度有効にするよう依頼します

### Your organization has disabled Claude subscription access

Claude 組織では、サブスクリプションログインによる Claude Code へのサインインが許可されていません。同じアカウントで `/login` を再度実行しても、同じエラーが返されます。

```text theme={null}
Your organization has disabled Claude subscription access for Claude Code · Use an Anthropic API key instead, or ask your admin to enable access
```

これはサーバー側の組織設定であるため、ローカル設定、環境変数、CLI フラグで上書きすることはできません。

Agent SDK と `-p` 非対話モードでは、これは `oauth_org_not_allowed` エラーコードとして表示されます。

**対処方法：**

* 組織で Claude Code へのアクセスを有効にするよう管理者に依頼します
* サブスクリプションの代わりに Console API キーで認証します。設定については [Claude Console 認証](https://code.claude.com/docs/ja/authentication.md#claude-console-authentication)を参照してください。
* 管理者であるにもかかわらずアクセスを有効にするオプションが見つからない場合は、[Anthropic サポート](https://support.claude.com)に連絡してください

### Scheduled tasks are off for your organization

組織で[クラウドスケジュールタスク](https://code.claude.com/docs/ja/routines.md)がオフになっているため、作成も実行もできません。claude.ai からのメッセージではスケジュールタスクまたはルーティンと呼ばれ、その後に管理者に関する文が続きます：

```text theme={null}
Scheduled tasks are off for your organization. …
Routines are off for your organization. …
```

ローカル設定、環境変数、CLI フラグでオンにすることはできません。

**対処方法：**

* Team または Enterprise の Owner に、[**Organization settings > Capabilities > Remote sessions**](https://claude.ai/admin-settings/capabilities) にある **Scheduled tasks (Was Routines)** または **Routines** というラベルのトグルをオンにできるか確認します

### Remote Control requires the Anthropic API

セッションが Anthropic API と直接通信していません。[Remote Control](https://code.claude.com/docs/ja/remote-control.md) にはこれが必要です。

```text theme={null}
Remote Control is only available when using Claude via api.anthropic.com. CLAUDE_CODE_USE_BEDROCK is set, so this session is using Amazon Bedrock — unset it (or run in a shell without it) to use Remote Control.
```

2 つ目の文では、セッションが Anthropic API 以外にルーティングされた原因が説明されます。v2.1.219 より前では、メッセージは 1 つ目の文のみでした。原因に応じて、メッセージには次のものが示されます：

* `CLAUDE_CODE_USE_*` プロバイダー変数（[Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md) の場合は `CLAUDE_CODE_USE_BEDROCK`、[Google Cloud の Agent Platform](https://code.claude.com/docs/ja/google-vertex-ai.md) の場合は `CLAUDE_CODE_USE_VERTEX` など）
* `api.anthropic.com` 以外のホスト（[LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)やプロキシなど）を指す [`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/ja/env-vars)。claude.ai でサインインしている場合も含みます。v2.1.196 より前では、カスタムベース URL は Remote Control をブロックしませんでした
* `ANTHROPIC_UNIX_SOCKET` が設定されているため、セッションが `api.anthropic.com` ではなくローカルソケット経由でリクエストを送信している
* `/login` で行ったエンタープライズの[クラウドゲートウェイ](https://code.claude.com/docs/ja/claude-apps-gateway)へのサインイン。これは Remote Control をサポートしておらず、設定を解除する変数もありません

**対処方法：**

* `CLAUDE_CODE_USE_BEDROCK` や `ANTHROPIC_BASE_URL` など、メッセージが示す変数の設定を解除してセッションを再起動するか、Anthropic API と直接通信するセッションから Remote Control を開始します
* 変数がシェルで設定されていない場合は、[設定ファイル](https://code.claude.com/docs/ja/settings.md#where-settings-live)の `env` キーを確認します。これはすべてのセッションに環境変数を適用します
* これとその他の Remote Control 起動時のメッセージについては、[Remote Control のトラブルシューティング](https://code.claude.com/docs/ja/remote-control.md#troubleshooting)を参照してください

### Remote Control がログインを更新できなかった

Claude Code は、保存済みの claude.ai ログインを使用して取得・更新する有効期間の短い認証情報で、ライブの [Remote Control](https://code.claude.com/docs/ja/remote-control.md) 接続を実行します。claude.ai がそのログインを受け付けなくなった場合、または Claude Code に保存済みのログインが残っていない場合、Claude Code は Remote Control を停止し、再度サインインする必要があります。どちらの失敗も、Claude Code がまだ接続中のときにも、後で認証情報を更新するときにも発生する可能性があります。

Claude Code がログインサービスに保存済みログインの更新を求めて応答がない場合、Remote Control を実行し続け、接続の現在の認証情報がまだ有効な間に更新を再試行します。Claude Code がログインサービスに到達できない場合、リクエストがタイムアウトした場合、またはサービスがログインを拒否せずに失敗した場合に、更新への応答がない状態になります。その認証情報の有効期限が切れてもログインサービスが応答しない場合、Claude Code は Remote Control を停止し、`OAuth token refresh failed` を報告します。

Claude Code が Remote Control を停止すると、警告と、`Remote Control disconnected` で始まるトランスクリプトの行に理由が表示されます。ローカルセッションは Remote Control なしで実行され続けます。このセクションでは次の行を扱います：

```text theme={null}
Remote Control disconnected — Claude.ai login expired — run /login to restore Remote Control
Remote Control disconnected — Claude.ai login expired — run /login, then /remote-control
Remote Control disconnected — Claude.ai login was rejected — run /login, then /remote-control
Remote Control disconnected — OAuth token unavailable — run /login to restore Remote Control
Remote Control disconnected — OAuth token refresh failed — run /login to re-authenticate
Remote Control disconnected — JWT refresh failed: no OAuth token — run /login
Remote Control disconnected — Signed out of Claude — run /login, then /remote-control
```

Claude Code はメッセージの中央に原因を示します：

* `Claude.ai login expired` と `Claude.ai login was rejected`：保存済みのログイントークンの有効期限が切れたか取り消されたため、claude.ai がそれを受け付けなくなりました
* `OAuth token unavailable`：接続の認証情報の更新時期が来たときに、Claude Code に保存済みのログイントークンがありませんでした
* `OAuth token refresh failed`：Claude Code の再接続中に claude.ai が保存済みのログイントークンを拒否し、トークンを更新しても新しいトークンが得られませんでした
* `JWT refresh failed: no OAuth token`：Claude Code が更新に使用する保存済みのログイントークンを見つけられませんでした
* `Signed out of Claude`：別のターミナルで `/logout` を実行するなどしてこのマシンでサインアウトしたため、Claude Code には接続の更新に使用する保存済みのログインが残っていません

**対処方法：**

* `/login` を実行して再度サインインします
* `/remote-control` を実行してセッションを再接続します。`run /login to restore Remote Control` で終わるメッセージではこの手順は不要です。サインインすると Claude Code が自動的に再接続します。

v2.1.224 より前では、`OAuth token refresh failed — run /login to re-authenticate` は `OAuth token refresh failed — re-authenticate, then re-enable Remote Control` と表示され、`JWT refresh failed: no OAuth token — run /login` は `no OAuth token available for recovery (code <N>)` と表示されていました。`Claude.ai login expired`、`Claude.ai login was rejected`、`OAuth token unavailable` のメッセージは v2.1.225 で追加されました。

v2.1.238 より前では、Claude Code は現在 `Signed out of Claude` と表示されるケースを `JWT refresh failed: no OAuth token — run /login` として報告し、ログインの更新に一度でも応答がないとすぐに `Claude.ai login expired — run /login to restore Remote Control` で Remote Control を停止していました。

### Remote Control could not renew this computer's connection

この警告は、サーバーが claude.ai ログインを使用して接続の認証情報を有効期限前に更新できない場合に、[`claude remote-control`](https://code.claude.com/docs/ja/remote-control#start-a-remote-control-session) を実行しているターミナルに表示されます。警告の最後の文には、現在の認証情報があとどれくらい有効か、またはすでに有効期限が切れていることが示されます：

```text theme={null}
Remote Control could not renew this computer's connection: claude.ai did not accept the sign-in it uses. Run `claude /login` to sign in again. The connection keeps working for about 26 hours; if it still cannot sign in then, it stops.
```

**対処方法：**

* 警告で `claude /login` を実行するよう指示されている場合は、サーバーを実行しているマシンで別のターミナルを開き、そこで `claude /login` を実行して claude.ai アカウントでサインインします
* 接続の認証情報の有効期限が切れた後もサーバーがサインインできない場合、サーバーは `Poll: Authentication failed (401)` を含むエラーを出力して停止します。警告の 2 つ目の文の指示に従って再度サインインしてから、サーバーが停止したターミナルで `claude remote-control` を再度実行します。

### サインイン中のアカウントが変更されたため Remote Control が停止した

このマシンで別の claude.ai アカウントまたは組織にサインインすると、[Remote Control](https://code.claude.com/docs/ja/remote-control.md) セッション中に Claude Code はこの行を表示します。この切り替えは、別のターミナルで `/login` を実行するなど、Claude Code セッションの外で行われたものです。

`/login` でサインインした状態で開始した Remote Control セッションは、その時点でサインインしていた claude.ai アカウントと組織に属します。

```text theme={null}
Remote Control disconnected — signed-in claude.ai account or organization changed on this machine — run /remote-control to start a session for the current account, or /login to switch back, then /remote-control
```

アカウントまたは組織が変更されたことを claude.ai が確認するとすぐに、Claude Code は Remote Control セッションを停止します。ローカルセッションは Remote Control なしで実行され続けます。

**対処方法：**

* `/remote-control` を実行して、現在のアカウントまたは組織で新しい Remote Control セッションを開始します
* 元に戻すには、`/login` を実行して以前のアカウントまたは組織に再度サインインします。その後 `/remote-control` を実行します。

v2.1.234 より前では、Claude Code セッションの外で別のアカウントや組織に切り替えても、Claude Code はそれを検知しませんでした。Claude Code は、後で Remote Control サーバーへのリクエストが `Remote Control server rejected the request (HTTP 404)` で失敗するまで、Remote Control セッションの接続を維持していました。この失敗は切り替えから数時間後に発生することもありました。

### セッションを実行しているアプリがサインアウトまたはアカウントを切り替えたため Remote Control が停止した

Claude デスクトップアプリまたは IDE がセッションをホストしている場合、Claude Code は `/login` ではなくそのアプリからログイントークンを取得します。claude.ai がそのトークンを拒否すると、Claude Code はアプリに新しいトークンを求めます。アプリがサインアウトしている、または別の Claude アカウントにサインインしていると応答した場合、Claude Code は [Remote Control](https://code.claude.com/docs/ja/remote-control.md) セッションを終了し、アプリに次のいずれかの行を送信します：

```text theme={null}
Remote Control stopped — the app running this session is now signed in to a different Claude account
Remote Control stopped — the app running this session is signed out of Claude. Sign in there, then turn Remote Control back on
```

ローカルセッションは Remote Control なしで実行され続けます。

**対処方法：**

* アプリがサインアウトしている場合は、アプリに再度サインインしてから、アプリで Remote Control をオンに戻します
* アプリがアカウントを切り替えた場合、Claude Code は終了したセッションを新しいアカウントで続行できません。そのアカウントで新しい Remote Control セッションを開始します。

v2.1.238 より前では、どちらの場合も、Claude Code は [Remote Control がログインを更新できなかった](#remote-control-couldnt-refresh-your-login)に記載されている `run /login` メッセージをアプリに送信していました。

### OAuth token revoked or expired

保存済みのログインが無効になっています。トークンが取り消された場合は、すべての場所からサインアウトしたか、管理者がアクセスを削除したことを意味します。トークンの有効期限が切れた場合は、セッション中に自動更新が失敗したことを意味します。

どちらのメッセージも、Claude Code が送信したリクエストに対して API が返した拒否を報告するものです。更新の失敗後に保存済みのログインがすでに消去されている場合は、代わりに [Login expired](#login-expired) を参照してください。[`CLAUDE_CODE_OAUTH_TOKEN`](https://code.claude.com/docs/ja/env-vars) の長期間有効なトークンで認証している場合、そのトークンが期限切れになるか取り消されると、同じメッセージが表示されます。

```text theme={null}
OAuth token revoked · Please run /login
Please run /login · API Error: 401 OAuth token has expired ...
```

[非対話モード](https://code.claude.com/docs/ja/headless.md)（`-p`）と [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) では、メッセージは次のようになり、構造化エラーコードは `authentication_failed` です：

```text theme={null}
Failed to authenticate: OAuth token revoked. Please log in again or contact your administrator.
Failed to authenticate. API Error: 401 OAuth token has expired ...
```

v2.1.287 より前では、非対話モードと Agent SDK で、取り消しのメッセージは `Your account does not have access to Claude. Please login again or contact your administrator.` と表示されていました。

**対処方法：**

* Claude Code のプロンプトで `/login` を実行して再度サインインします
* `-p` コマンドまたは Agent SDK プログラムが保存済みのログインを使用している場合は、同じ環境で `claude` を実行して `/login` を完了してから、コマンドまたはプログラムを再度実行します。対話的にサインインできない自動化では、[`ANTHROPIC_API_KEY`](https://code.claude.com/docs/ja/env-vars) で認証するか、[`claude setup-token` で長期間有効なトークンを生成](https://code.claude.com/docs/ja/authentication#generate-a-long-lived-token)します。
* `CLAUDE_CODE_OAUTH_TOKEN` 環境変数で認証している場合、リクエストが 401 で失敗した後も、Claude Code は保存済みログインのトークンに切り替えず、設定した値を送信し続けます。[`/status`](https://code.claude.com/docs/ja/commands) では、この認証情報は `CLAUDE_CODE_OAUTH_TOKEN` と表示される `Auth token` 行として示されます。[`claude setup-token`](https://code.claude.com/docs/ja/authentication#generate-a-long-lived-token) で新しいトークンを生成してそれを使って再起動するか、変数の設定を解除して `/login` を実行します。v2.1.225 より前では、Claude Code がセッション中に変数の値を保存済みログインの短期間有効なアクセストークンに置き換えることがあり、そのトークンの有効期限が切れるとセッションが再び 401 エラーで失敗していました。
* 起動のたびにログインを繰り返し求められる場合は、[トラブルシューティング](https://code.claude.com/docs/ja/troubleshoot-install.md#not-logged-in-or-token-expired)のシステムクロックの確認と macOS の認証情報ストレージの復旧手順を参照してください
* `403 Forbidden` や OAuth のブラウザの問題など、その他の失敗については、[ログインと認証](https://code.claude.com/docs/ja/troubleshoot-install.md#login-and-authentication)を参照してください

### API Error: 401 Invalid authentication credentials

API は認証情報の形式を認識しましたが、その背後にあるアカウントまたは組織を拒否しました。Anthropic がこのメッセージを返すのは、認証情報が最近取り消された場合、組織が無効化されたか組織がアクセスを削除した場合、またはアカウント自体が無効化された場合であり、トークンの有効期限切れが原因ではありません。認証情報は保存済みのログインか承認済みの `ANTHROPIC_API_KEY` のいずれかで、それぞれ対処方法が異なるため、まず `/status` を実行してどちらが有効かを確認してください。

```text theme={null}
Please run /login · API Error: 401 Invalid authentication credentials
```

**対処方法：**

* `/status` に、使用されていないとマークされていない `API key` 行が表示される場合は、承認済みの [`ANTHROPIC_API_KEY`](https://code.claude.com/docs/ja/authentication#authentication-precedence) が有効な認証情報であり、ログインより優先されるため、`/login` では置き換えられません。Claude Console でキーをローテーションするか、`unset ANTHROPIC_API_KEY`（PowerShell では `Remove-Item Env:ANTHROPIC_API_KEY`）を実行してサブスクリプションにフォールバックします。
* `/status` にログインのみが表示される場合は、`/login` を 1 回実行します。認証情報が取り消されていた場合は、新しいログインで置き換えられます。
* 同じログインアカウントで同じメッセージが再び表示される場合、そのアカウントまたは組織はもう有効ではありません。`/status` が報告するアカウントと組織を確認し、組織の管理者にアクセスの復元を依頼します。
* [`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/ja/env-vars) が [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)を指している場合、`401` の後のテキストは Anthropic ではなくゲートウェイのメッセージであり、`/login` では変わりません。代わりに、ゲートウェイが想定する認証情報を修正します。
* ゲートウェイが想定する認証情報を受け取った後もすべてのリクエストが `401` で失敗する場合は、ゲートウェイとそのアップストリームが[ツール検索](https://code.claude.com/docs/ja/mcp.md#tool-search-through-a-gateway)のフィールドを受け付けることを確認します。デフォルトでは、Claude Code は `defer_loading` ツールフィールドと `tool_reference` ブロックを、それらを有効にする `anthropic-beta` ヘッダーとともに送信します。v2.1.304 より前では、`ENABLE_TOOL_SEARCH` でオンにしない限り、ゲートウェイの背後ではツール検索はオフでした。

### Login expired

Claude Code が保存済みの claude.ai ログインを更新しようとしたところ、OAuth サービスが保存されているリフレッシュトークンを拒否したため、Claude Code は保存済みの認証情報を消去しました。[ほかに保存済みの認証情報](https://code.claude.com/docs/ja/authentication.md#after-the-login-expires)がない場合、その後のモデルへのリクエストはこのメッセージで停止します：

```text theme={null}
Login expired · Please run /login
```

[非対話モード](https://code.claude.com/docs/ja/headless.md)（`-p`）と [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) では、メッセージは次のようになり、構造化エラーコードは `authentication_failed` です：

```text theme={null}
Failed to authenticate: OAuth session expired and could not be refreshed
```

ログインが時間制限に達した場合、Claude Code v2.1.318 以降では、どちらのメッセージも代わりに `reached its time limit` と表示されます。`or re-authenticate your Anthropic profile` で終わる `Login expired` メッセージについては、[Anthropic profile login expired](#anthropic-profile-login-expired) を参照してください。

アカウント自体が停止されているために更新が失敗した場合、Claude Code は代わりに [Your account is on hold](#your-account-is-on-hold) を表示します。

**対処方法：**

* `/login` を実行して再度サインインします。
* 別の Claude Code ウィンドウで claude.ai アカウントを使ってサインインする場合、このセッションが自動的にそのログインを使い始める条件については [Not logged in](#not-logged-in) を参照してください。
* 非対話モードでは、同じ環境で `claude` を実行して `/login` を完了してから、コマンドを再実行します。対話的にサインインできない自動化では、`ANTHROPIC_API_KEY` で認証するか、[`claude setup-token` で長期間有効なトークンを生成](https://code.claude.com/docs/ja/authentication#generate-a-long-lived-token)します。
* サインインが失敗し続ける場合は、[ログインと認証](https://code.claude.com/docs/ja/troubleshoot-install.md#login-and-authentication)を参照してください

### Could not refresh your login because another Claude Code process is refreshing it

このメッセージは、ログインが拒否されたことを意味するものではありません。保存済みの claude.ai ログインの有効期限が切れていて、更新が必要でした。同じマシン上の別の Claude Code プロセスが共有のリフレッシュロックを保持していたか、ロックを残したまま終了していたため、このセッションが待機している間に更新が進みませんでした。Claude Code は送信前にリクエストを停止します：

```text theme={null}
Could not refresh your login because another Claude Code process is refreshing it (or exited mid-refresh) · Try again in a minute; if it keeps happening, close other Claude Code windows or sign in again with /login
```

[非対話モード](https://code.claude.com/docs/ja/headless.md)（`-p`）と [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) では、メッセージは次のようになり、構造化エラーコードは `server_error` です：

```text theme={null}
Failed to refresh OAuth token: another Claude Code process is refreshing it or exited mid-refresh. This is usually transient; retry in a minute, and if it persists close other Claude Code processes or sign in again
```

**対処方法：**

* 1 分後に再試行します。別のプロセスが先に更新を完了した場合、このセッションは更新されたログインを使用します。
* メッセージが繰り返し表示される場合は、他の Claude Code ウィンドウとプロセスを閉じてから再試行します。
* 他の Claude Code プロセスが実行されていないのにメッセージが表示される場合は、`/login` を実行します。再度サインインする場合は、リフレッシュロックを待機しません。

### Could not refresh your login: the disk that holds the Claude Code config directory is full

Claude Code の設定ディレクトリがあるディスクの空き容量を確保してから、メッセージを再度送信してください。ディスクがいっぱいの間は新しいログインを保存できないため、サインインしても解決しません。[`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/ja/env-vars) を設定していない限り、設定ディレクトリはホームディレクトリ内の `~/.claude` です。

```text wrap theme={null}
Could not refresh your login: the disk that holds the Claude Code config directory (~/.claude by default), or your disk quota on it, is full · Delete files you no longer need on that disk, then try again · Signing in again won't help
```

[非対話モード](https://code.claude.com/docs/ja/headless.md)（`-p`）と [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) では、メッセージは次のようになります：

```text wrap theme={null}
Failed to refresh OAuth token: the disk that holds the Claude Code config directory (~/.claude by default), or your disk quota on it, is full. Delete files you no longer need on that disk and retry; signing in again won't help
```

**対処方法：**

* スクリプトの場合は、その `claude -p` コマンドを再実行します
* ディスクにすでに空き容量がある場合でも、ディスククォータや inode が不足していると同じメッセージが表示されます。そのディスク上の自分のファイルを削除してください。メッセージが再び表示される場合は、サイズに関係なく各ファイルが inode を 1 つ使用するため、少数の大きなファイルではなく多数の小さなファイルを削除します。

### Couldn't save your login

claude.ai でサインインしましたが、Claude Code がログインを認証情報ストアに保存できなかったため、ログインは完了しませんでした。macOS では、同じセッション中に Claude Code がすでにログインキーチェーンの認証情報を読み取ったり保存したりした後に、スリープやアイドルなどでキーチェーンがロックされると、これが発生することがあります。

```text theme={null}
Couldn't save your login. If your Mac's keychain is locked, unlock it and log in again.
Couldn't save your login. Try logging in again.
```

1 つ目の形式は macOS で、2 つ目の形式はそれ以外の環境で表示されます。タイムアウトやストアを読み取れないなど、一時的な認証情報ストアの障害でも同じメッセージが表示されます。

**対処方法：**

* macOS では、ログインキーチェーンのロックを解除してから、`/login` を再度実行します
* その他のプラットフォームでは、`/login` を再度実行します
* それでもログインが保存されない場合は、キーチェーンのロック解除コマンドやその他の認証情報ストレージの復旧手順について、[ログインしていない、またはトークンの有効期限切れ](https://code.claude.com/docs/ja/troubleshoot-install.md#not-logged-in-or-token-expired)を参照してください

### Sign in again to take your previous account or API key off the config file

サインイン後にこの警告が表示された場合、以前にサインインしていたアカウントが [`~/.claude.json`](https://code.claude.com/docs/ja/claude-directory#ce-claude-json) にまだ保存されている可能性があります：

```text theme={null}
Sign in again to take your previous account or API key off the config file.
```

Linux または Windows で Console ログインによって API キーが作成された場合は、API キーも `~/.claude.json` にまだ残っている可能性があります。

**対処方法：**

* シェルで `claude auth login` を実行して再度サインインします。その後 Claude Code は、置き換えられたアカウントまたは API キーをファイルから削除する保存処理を再試行します。

### Your account or API key may still be in the config file

`/logout` または `claude auth logout` を実行し、Claude Code はこのプロセスをサインアウトしましたが、[`~/.claude.json`](https://code.claude.com/docs/ja/claude-directory#ce-claude-json) にアカウントが保持されていないことを確認できませんでした。保存が反映されなかったか、確認のためにファイルを読み戻せなかったかのいずれかです。

```text theme={null}
Your account or API key may still be in the config file. Run claude auth logout.
```

Linux または Windows で Console ログインによって API キーが作成された場合は、API キーも `~/.claude.json` にまだ残っている可能性があります。

**対処方法：**

* シェルで `claude auth logout` を実行して保存を再試行します

### Couldn't start the local listener that receives the browser sign-in

`/login`、`claude auth login`、`claude setup-token` からのこれらのメッセージはいずれも、ブラウザがサインイン結果を返す `127.0.0.1` 上のポートを Claude Code が開けなかったことを意味します。

`The browser can't return the sign-in to Claude Code automatically` で始まる通知の場合、サインインはそのポートなしで続行されます。ブラウザは開かず、通知の下にサインイン用の URL が表示されます：

```text wrap theme={null}
The browser can't return the sign-in to Claude Code automatically. After you sign in, paste the code shown.
```

`Couldn't start the local listener` を含むメッセージの場合、サインインは停止しています。これは、たとえば `claude auth login` に入力をパイプした場合に発生します：

```text theme={null}
Couldn't start the local listener that receives the browser sign-in. Try again.
```

**対処方法：**

* **`The browser can't return the sign-in to Claude Code automatically`**：事前に何かを修正する必要はありません。通知の下に表示された URL をブラウザで開いてサインインします。ブラウザにコードが表示されるので、Claude Code の `Paste code here >` プロンプトに貼り付けると、そこからサインインが続行されます。
* **`Couldn't start the local listener that receives the browser sign-in`**：同じコマンドを再度実行します。同じように停止する場合は、ブラウザの代わりにトークンまたは API キーでサインインします。または、`claude auth login` に入力をパイプしていた場合は、貼り付けたコードを受け取れるようにターミナルで実行します。
* **ブラウザの代わりにトークンまたは API キーでサインインするには**：claude.ai サブスクリプションを使用している場合は、サインインが機能するマシンで [`claude setup-token`](https://code.claude.com/docs/ja/authentication#generate-a-long-lived-token) を実行します。次に、出力されたトークンをこのマシンの [`CLAUDE_CODE_OAUTH_TOKEN`](https://code.claude.com/docs/ja/env-vars) 環境変数に設定します。それ以外の場合は、`ANTHROPIC_API_KEY` 環境変数に [Claude Console](https://platform.claude.com/settings/keys) のキーを設定します。Claude Code が認証情報をどのように選択するかについては、[認証の優先順位](https://code.claude.com/docs/ja/authentication.md#authentication-precedence)で説明しています。
* **ブラウザからの自動的な戻りを復活させるには**：Claude Code が `127.0.0.1` でリッスンできる必要があります。サンドボックス内で実行している場合は、サンドボックスのポリシーでローカルポートでのリッスンが許可されていることを確認してから、再度サインインします。そこでリッスンが機能するはずなのに通知が表示される場合は、レポートに環境の詳細が含まれるように `/feedback` を実行します。

v2.1.305 より前では、ポートを開けなかった時点でサインインが停止し、サインイン用の URL は表示されませんでした。メッセージは、たとえば `Failed to start OAuth callback server: Failed to start server. Is port 0 in use?` のようになりました。これらのバージョンでは、Claude Code を更新して再度サインインするか、ブラウザの代わりにトークンまたは API キーでサインインします。

### Claude login not accepted

[クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md)を開始しようとしましたが、サーバーが 401 でその作成を拒否しました。このマシンが送信した Claude ログインをサーバーが受け付けなかったためで、通常はログインの有効期限が切れたか取り消されたことが原因です。

行の最初の部分は、サーバーが理由を示した場合はその理由です。それ以外の場合、行は次のようになります：

```text theme={null}
Claude login not accepted · Run /login, then try again
```

**対処方法：**

* `/login` を実行してサインインを完了してから、セッションを再度開始します

### Artifacts need a claude.ai login

セッションにアーティファクトに使用できる claude.ai ログインがないため、Claude Code は[アーティファクト](https://code.claude.com/docs/ja/artifacts.md)の公開または読み取りを拒否しました。

どの形式のメッセージも同じ文言で始まり、その後にセッションの認証方法に応じた対処方法が続きます。競合する認証情報がない場合は、次のようになります：

```text theme={null}
Artifacts need a claude.ai login. Run /login and select "Claude account with subscription", then retry — the "Anthropic Console account" option does not provide claude.ai credentials.
```

**対処方法：**

* `/login` を実行し、**Claude account with subscription** を選択します。**Anthropic Console account** オプションでは claude.ai の認証情報は提供されません。
* `ANTHROPIC_API_KEY`、`apiKeyHelper` 設定、以前の `/login` で保存された Console キーなど、優先される認証情報がメッセージに示されている場合は、メッセージの指示に従ってそれを削除してから、`/login` を実行します
* このリモートセッションが起動元のマシンを通じて認証しているとメッセージに示されている場合は、そのマシンで claude.ai にサインインしてから、セッションを再接続します
* 認証情報がセッションのホスト環境によって注入されているとメッセージに示されている場合、そのセッションでは変更できません。claude.ai にサインインしているセッションを開始します
* プラン、モデルプロバイダー、組織ポリシーなど、アーティファクトのその他の要件については、[利用可能性](https://code.claude.com/docs/ja/artifacts.md#availability)を参照してください

### Administrator policy requires a Cloud gateway sign-in

このマシンの管理者の[管理設定](https://code.claude.com/docs/ja/managed-settings.md)で、[`forceLoginMethod`](https://code.claude.com/docs/ja/settings-reference#forceloginmethod) が `"gateway"` に設定されているか、[`forceLoginGatewayUrl`](https://code.claude.com/docs/ja/settings-reference#forcelogingatewayurl) が設定されています。`CLAUDE_CODE_USE_BEDROCK` などの変数でクラウドプロバイダーを選択していない限り、Claude Code は [Claude apps ゲートウェイ](https://code.claude.com/docs/ja/claude-apps-gateway)のサインインのみを受け付けます。次の 2 つのメッセージのいずれかが表示されます：

```text theme={null}
Not signed in to the Cloud gateway — run /login.
```

セッションにゲートウェイのサインインがない場合（たとえば、ポリシーがマシンに適用されてから `/login` を実行していない場合）、モデルリクエストはこのメッセージで失敗します。

マシンに Anthropic が発行した認証情報もあり、管理設定で `forceLoginMethod` または `forceLoginOrgUUID` が設定されている場合、Claude Code は代わりに起動時に終了します。その認証情報は、`ANTHROPIC_API_KEY` または `ANTHROPIC_AUTH_TOKEN` 変数、`apiKeyHelper` 設定、以前の Claude Console ログインで保存された API キーのいずれかです。

起動時のメッセージには、セッションに設定されている認証情報、その設定場所、およびそれを削除する手順が示されます。たとえば、シェルで `ANTHROPIC_API_KEY` 変数が設定されている場合は、次のようになります：

```text theme={null}
Administrator policy requires a Cloud gateway sign-in on this machine, but this session is configured with an API key from ANTHROPIC_API_KEY, which a gateway machine does not accept.

To continue: unset ANTHROPIC_API_KEY (or run in a shell without it), then run claude and sign in with /login.
```

**対処方法：**

* `Not signed in to the Cloud gateway` の場合は、`/login` を実行し、**Cloud gateway** 画面でサインインを完了します
* 起動時のメッセージの場合は、メッセージの末尾の手順に従って認証情報を削除します
* マシンでゲートウェイが必要とされるべきではないと思われる場合は、マシンを管理している管理者に、その管理設定から `forceLoginMethod` と `forceLoginGatewayUrl` を削除するよう依頼します

v2.1.284 より前では、起動時のメッセージは設定されている認証情報を示すのではなく、考えられる認証情報を列挙していました。メッセージは `Administrator policy requires a Cloud gateway sign-in on this machine; the Anthropic-issued credential configured here (ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, or apiKeyHelper) is not used.` で始まっていました。この文言が表示され、どの認証情報を削除すべきかわからない場合は、v2.1.284 以降に更新して `claude` を再度起動します。

v2.1.265 では、リグレッションにより、マシンに管理者の要件がない場合でも、API キー、`apiKeyHelper`、カスタムヘッダーで認証する一部の LLM ゲートウェイおよびプロキシの構成で 1 つ目のメッセージが表示されていました。v2.1.266 以降に更新してください。設定を変更する必要はありません。

v2.1.261 より前では、`forceLoginMethod` を `"gateway"` に設定しているマシンで、Claude Code はモデルリクエストを失敗させる代わりに残っていた保存済みのログインを使用し、設定された環境の認証情報について、起動時のメッセージではなく `This machine's managed settings require a first-party login` を報告していました。

### Your account is on hold

ログインの背後にある Claude アカウントが停止されています。Claude Code は、保存済みのログインを更新しようとして保留を知った場合は 1 つ目のメッセージを、ブラウザで完了したサインインが保留を報告した場合は 2 つ目のメッセージを表示します：

```text theme={null}
Your account is on hold and can't use Claude Code. View details or appeal: https://claude.ai/restricted
Your account is on hold and can't sign in to Claude Code. View details or appeal: https://claude.ai/restricted
```

保留はログインではなくアカウントにかかっているため、同じアカウントで再度サインインしてもメッセージは解消されません。[非対話モード](https://code.claude.com/docs/ja/headless.md)（`-p`）と [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) では、構造化エラーコードは `account_on_hold` です。v2.1.235 より前では、Claude Code は保留中のアカウントを [Login expired · Please run /login](#login-expired) として報告しており、その復旧手順では保留を解除できませんでした。

**対処方法：**

* メッセージ内のリンクを開いて、保留の詳細を確認するか異議を申し立てます
* 保留の影響を受けない別の Claude アカウントまたは API キーがある場合は、保留が解決されるまでの間も作業を続けられます。そのアカウントで `/login` を実行するか、`ANTHROPIC_API_KEY` でキーを設定します

### Anthropic profile login expired

Claude Code は Anthropic 認証情報プロファイルを通じて認証していますが、そのプロファイルの保存済みログイン認証情報の有効期限が切れており、プロファイルには Claude Code が更新に使用できるリフレッシュ認証情報がありません。Claude Code は再試行せずに、各リクエストをローカルで停止します。

```text theme={null}
Anthropic profile login expired · Re-authenticate your Anthropic profile
Login expired · Run /login to sign in again, or re-authenticate your Anthropic profile
```

**対処方法：**

* メッセージが `Login expired` で始まる場合は、`/login` を実行して再度サインインします
* キーレスの Console サインインまたは Claude Platform CLI の `ant auth login` が書き込んだプロファイルを更新するには、[キーレスのサインインを提供している](https://code.claude.com/docs/ja/authentication.md#sign-in-without-an-api-key)マシンで `/login` を実行します。Anthropic Console アカウントを選択してから、**Sign in with your Console account** を選択します。Claude Code がそのプロファイル内の期限切れの認証情報を置き換えます
* 別のツールが作成したプロファイルを更新するには、そのツールで再度サインインします。代わりに `/login` で **Sign in with your Console account** を選択した場合、Claude Code はプロファイルをそのままにして API キーを作成します
* 管理者がプロファイルの認証情報をプロビジョニングした場合は、新しい認証情報の発行を依頼します
* `/status` を実行して、有効な認証情報ソースとプロファイル名を確認します
* プロファイルの使用をやめるには、`ANTHROPIC_PROFILE` を設定している場合はその設定を解除してから、`/login` や `ANTHROPIC_API_KEY` など別の方法で認証します

メッセージの始まり方から、Claude Code がプロファイルをどのように見つけたかがわかります：

* Claude Code が設定ディレクトリからプロファイルを検出し、その認証モードが `user_oauth` の場合、メッセージは `Login expired` で始まり、最初に `/login` が提示されます。Claude Code は、検出されたプロファイルより機能している `/login` を優先し、代わりに claude.ai アカウントで認証します。v2.1.234 から v2.1.277 までは、この形式は `Anthropic profile login expired · Run /login to use your claude.ai account instead, or re-authenticate the profile` と表示されていました。v2.1.234 より前では、この場合も Claude Code は `Re-authenticate your Anthropic profile` の形式を表示していました。
* `ANTHROPIC_PROFILE` でプロファイルを選択した場合、メッセージは `Anthropic profile login expired` で始まります。

これが表示されるのは、有効な認証情報が Anthropic 認証情報プロファイルから取得されている場合のみです。該当するのは、`ANTHROPIC_PROFILE` 環境変数で選択したプロファイル、Anthropic 設定ディレクトリ内の有効なプロファイルとして Claude Code が検出したプロファイル、または [API キーなしでサインイン](https://code.claude.com/docs/ja/authentication.md#sign-in-without-an-api-key)したときに Claude Code が書き込んだプロファイルです。API キー、`ANTHROPIC_AUTH_TOKEN` などのベアラートークン、またはサードパーティのプロバイダーで認証するセッションでは、このメッセージは表示されません。

### OAuth scope requirement

保存されているトークンは、新しい機能が必要とする権限スコープが導入される前のものです：

```text theme={null}
OAuth token does not meet scope requirement: user:profile
```

**対処方法：**

* `/login` を実行して、現在のスコープを持つ新しいトークンを取得します。事前にログアウトする必要はありません。

### claude.ai rejected the session token

claude.ai が Claude Code ログインのトークンを拒否したため、[claude.ai コネクタ](https://code.claude.com/docs/ja/mcp.md#use-mcp-servers-from-claude-ai)のリクエストが失敗しました。拒否されたトークンは claude.ai でのコネクタ自体の認可ではなくログインのものであるため、コネクタを再度認可しても解決しません。`/mcp` では、コネクタは `session token rejected` と表示され、その詳細ビューには次のように表示されます：

```text theme={null}
claude.ai rejected the session token. Run /login, then reconnect.
```

**対処方法：**

* `/login` を実行して再度サインインします
* `/mcp` からコネクタを再接続するか、`/mcp reconnect <server>` を実行します。再度サインインする前に再接続しても、コネクタは同じ状態のままです。`/mcp` パネルの **Reconnect** オプションは `your claude.ai session token was rejected` を報告しますが、入力した `/mcp reconnect <server>` 形式では、トークンがまだ拒否されていても再接続成功と報告されます。

v2.1.222 より前では、Claude Code は代わりにコネクタを認証が必要とマークしていたため、コネクタの認可フローを完了してもこの状態は解決しないにもかかわらず、そのフローに誘導されていました。

### MCP server needs you to sign in again

リモートの [MCP サーバー](https://code.claude.com/docs/ja/mcp.md)がセッション中のツール呼び出しで認証情報を拒否しました。通常は、サインインまたはトークンの有効期限が切れたか、トークンにツールが必要とする権限がないことが原因です。ツール呼び出しは失敗し、`/mcp` はサーバーを[認証が必要](https://code.claude.com/docs/ja/mcp.md#authenticate-with-remote-mcp-servers)とマークします。

claude.ai コネクタを含め、Claude Code からサインインするサーバーの場合は、サインインの有効期限が切れたか取り消されています：

```text theme={null}
MCP server "<name>" needs you to sign in again (run /mcp to re-authenticate)
```

`/mcp` を実行してサーバーを選択し、そのメニューから再度サインインします。

[`headersHelper`](https://code.claude.com/docs/ja/mcp#use-dynamic-headers-for-custom-authentication) スクリプトで設定されたサーバーの場合、Claude Code はこのメッセージを表示する前に、すでにヘルパーを再実行して呼び出しを 1 回再試行しています：

```text theme={null}
MCP server "<name>" rejected the credential from its headersHelper (check the helper and run /mcp to reconnect, or to authenticate if the server also uses OAuth)
```

ヘルパーがサーバーに受け付けられる認証情報を返すことを確認してから、`/mcp` から再接続します。再接続するとヘルパーが再度実行されます。

設定に静的な `Authorization` ヘッダーがあるサーバーの場合：

```text theme={null}
MCP server "<name>" rejected the Authorization header in its config (update it, then run /mcp to reconnect)
```

サーバーが設定されている場所でヘッダーの値を更新してから、`/mcp` から再接続します。

Claude Desktop アプリのマシン上の [Cowork](https://claude.com/docs/cowork/overview) セッションでは、これらのメッセージは MCP サーバーが渡された認証情報を拒否したことを意味します。メッセージが示すものを修正してから、Cowork で新しいタスクまたはチャットを開始します：

```text theme={null}
MCP server "<name>" rejected the credential from its headersHelper (check the helper, then start a new task or chat)
MCP server "<name>" rejected the Authorization header in its config (update it, then start a new task or chat)
```

* **`headersHelper` の認証情報が拒否された場合**：ヘルパーがサーバーに受け付けられる認証情報を返すことを確認してから、Cowork で新しいタスクまたはチャットを開始します
* **`Authorization` ヘッダーが拒否された場合**：そのサーバーの設定の `headers` にある `Authorization` の値を更新してから、Cowork で新しいタスクまたはチャットを開始します

v2.1.302 より前では、Cowork セッションでは `/mcp` を使用できないにもかかわらず、代わりに `run /mcp to reconnect` の末尾が表示されていました。Cowork でこのような末尾が表示された場合でも、ヘルパーを確認するかヘッダーを更新してから、新しいタスクまたはチャットを開始します。v2.1.273 より前では、サインインの期限切れ、`headersHelper`、`Authorization` ヘッダーのいずれの場合も、`MCP server "<name>" requires re-authorization (token expired)` と表示されていました。

サーバーは、スコープの認可を求めるために HTTP 403 `insufficient_scope` でツール呼び出しを拒否することもあります。そのスコープがすでにトークンに含まれている場合もあります。メッセージにはそのスコープが示されます：

```text theme={null}
MCP server "<name>" needs additional permissions (scope: "<scope>") — run /mcp to re-authenticate
```

`/mcp` を実行してサーバーを選択し、そのメニューから再度認証します。

サーバーの設定で [`oauth.scopes`](https://code.claude.com/docs/ja/mcp#restrict-oauth-scopes) も [`authServerMetadataUrl`](https://code.claude.com/docs/ja/mcp#override-oauth-metadata-discovery) も設定されていない場合、Claude Code はサーバーが示したスコープを要求します。どちらかの設定がある場合、Claude Code は代わりにその設定のスコープを要求します。`oauth.scopes` を固定している場合は、再度認証する前に、不足しているスコープをそのリストに追加します。

v2.1.274 より前では、このケースでは `needs you to sign in again` メッセージが表示され、v2.1.273 より前では他のケースと同様に `requires re-authorization (token expired)` が表示されていました。

### Couldn't read the stored credentials for MCP server

Claude Code は、OAuth [MCP サーバー](https://code.claude.com/docs/ja/mcp.md)のサインインを認証情報ストアに保持しています。このメッセージは、Claude Code がそのストアを読み取れなかったため、サーバーへのリクエストが実行されなかったことを意味します：

```text theme={null}
Couldn't read the stored credentials for MCP server "<name>", so the request didn't run. If your Mac's keychain is locked, unlock it, then try again.
Couldn't read the stored credentials for MCP server "<name>", so the request didn't run. Try again.
```

保存されているサインインは変更されていません。ストアを読み取れるようになったら再試行し、その後サーバーから求められた場合にのみ再度サインインしてください。

macOS での [`claude -p`](https://code.claude.com/docs/ja/headless) または [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) の実行では、保存済みのサインインなしでリクエストがすでに送信された後に、キーチェーンが読み取り可能になることがあります。そのリクエストは次のように失敗します：

```text theme={null}
A request to MCP server "<name>" was sent without your stored credentials, so the server rejected it. The credentials are available now. Try again.
```

**対処方法：**

* メッセージで Mac のキーチェーンのロック解除を求められた場合は、Claude Code を実行するシェルセッションで [`claude doctor`](https://code.claude.com/docs/ja/cli-reference#cli-commands) を実行し、そのレポートにキーチェーンの警告がないか確認します：
  * レポートに `macOS Keychain is not writable` で始まる警告がある場合、またはシェルに `claude` コマンドがない場合は、そのシェルセッションで次のロック解除コマンドを実行します：

    ```bash theme={null}
    security unlock-keychain ~/Library/Keychains/login.keychain-db
    ```

  * レポートにキーチェーンの警告がない場合は、ロック解除コマンドをスキップします

* メッセージが表示された場所で再試行します：
  * `claude -p` の場合は、コマンドを再度実行します
  * 対話セッションでは、サーバーが `/mcp` で失敗と表示されている場合はそこから再接続し、Claude に再試行を依頼します
  * 実行し続ける Agent SDK アプリケーションでは、TypeScript の [`reconnectMcpServer()`](https://code.claude.com/docs/ja/agent-sdk/typescript#methods) または Python の [`ClaudeSDKClient.reconnect_mcp_server()`](https://code.claude.com/docs/ja/agent-sdk/python#methods) を呼び出すか、新しいセッションを開始します

* その後サーバーが認証が必要と報告した場合、Claude Code はそのサーバーに使用できるサインインを見つけられませんでした。対話的にサインインします。Claude Code セッションで `/mcp` を実行するか、シェルで [`claude mcp login <name>`](https://code.claude.com/docs/ja/mcp#authenticate-from-the-command-line) を実行します。Agent SDK アプリケーションでは、[Agent SDK での OAuth2 認証](https://code.claude.com/docs/ja/agent-sdk/mcp.md#oauth2-authentication)を参照してください。

v2.1.307 より前では、ログインキーチェーンがロックされた Mac での `claude -p` または Agent SDK の実行では、どちらのメッセージも表示されず、代わりにサーバーが認証を必要としていると報告されていました。

### MCP server URL is missing or not a valid URL

リモート MCP サーバーに設定された `url` が URL として解析できないため、Claude Code はそのサーバーの OAuth サインインの開始を拒否しました。Claude Code がそのサーバーについてより具体的な設定の問題を報告する場合を除き、シェルで [`claude mcp login <name>`](https://code.claude.com/docs/ja/mcp#authenticate-from-the-command-line) を実行すると、拒否は次のように出力されます。

```text theme={null}
Couldn't complete authentication for "<name>": This server's URL is missing or not a valid URL, so sign-in can't start. Fix the URL in its MCP config (or set the environment variable it uses) and try again.
```

**対処方法：**

* サーバーが設定されている場所で、そのエントリの `url` をサーバーの実際のエンドポイントに設定するか、その [`${VAR}` 参照](https://code.claude.com/docs/ja/mcp#environment-variable-expansion-in-mcp-json)が指定する環境変数を設定してから、サインインを再度実行します。

### Issuer mismatch in authorization response

[MCP OAuth サインイン](https://code.claude.com/docs/ja/mcp.md#authenticate-with-remote-mcp-servers)中に、認可サーバーが Claude Code にリダイレクトで戻した `iss` パラメータが、Claude Code がサーバーの OAuth メタデータから想定していた発行者（issuer）を示していませんでした。この段階での誤った発行者は、認可サーバー混同攻撃（mix-up attack）が現れる形そのものであるため、Claude Code は認可コードを交換せずにサインインを失敗させます。Claude Code は、ブラウザでのサインイン後に `/mcp` サーバーメニューにエラーを表示します。

```text theme={null}
Issuer mismatch in authorization response (RFC 9207): expected "https://auth.example.com", received "https://other.example.com"
```

`expected` はサーバーの OAuth メタデータにある発行者で、`received` はリダイレクトに含まれていた `iss` の値です。リダイレクトに `iss` パラメータが含まれていないサインインはチェックを通過します。ただし、サーバーのメタデータで `authorization_response_iss_parameter_supported` が設定されている場合は例外で、その場合 Claude Code はサインインを失敗させます。

**対処方法：**

* `/mcp` からサインインを再試行します
* エラーが繰り返される場合は、サーバーの運営者に報告してください。修正はサーバー側で行う必要があります。認可サーバーは、メタデータで公開しているものと同じ発行者を `iss` パラメータで返す必要があります
* サーバーの修正中に接続するには、[`MCP_SDK_GENERATION=v1`](https://code.claude.com/docs/ja/env-vars) を指定して Claude Code を起動します。その[ランタイム](https://code.claude.com/docs/ja/mcp.md#mcp-client-runtimes)ではこのチェックが実行されません。これにより混同攻撃に対する保護が失われるため、サーバー側での修正を優先してください

v2.1.232 より前は、Claude Code は段階的なロールアウトの場合、または `MCP_SDK_GENERATION=v2` を設定した場合にのみ v2 ランタイムを使用していました。

### Stopped an OAuth request

このメッセージは、OAuth エンドポイントがリダイレクトしたために、Claude Code が [MCP サーバーの OAuth リクエスト](https://code.claude.com/docs/ja/mcp.md#authenticate-with-remote-mcp-servers)を停止したことを意味します。どちらの形式のメッセージでも、最初のアドレスがリダイレクトを送信したアドレスです。

```text theme={null}
Stopped an OAuth request, which can hold secrets: https://auth.example.com redirected it to https://other.example.com. Ask the owner of https://auth.example.com to remove that redirect.
Stopped an OAuth request: https://auth.example.com redirected it more than 5 times. Ask the owner of https://auth.example.com to fix those redirects.
```

**対処方法：**

* 最初のアドレスを運営している人（MCP サーバーの運営者など）に、リダイレクトを削除または修正するよう依頼してください。その後、`/mcp` から再試行します。

### Refusing to send credentials to non-https token endpoint

[v2 ランタイム](https://code.claude.com/docs/ja/mcp.md#mcp-client-runtimes)では、Claude Code は [MCP OAuth](https://code.claude.com/docs/ja/mcp.md#authenticate-with-remote-mcp-servers) のトークンリクエストを、HTTPS で提供されているトークンエンドポイント、または `localhost`、`127.0.0.1`、`::1` にあるトークンエンドポイントにのみ送信します。このメッセージは、サーバーのトークンエンドポイントがそのどちらでもないため、Claude Code がリクエストを送信する前に停止したことを意味します。これはブラウザでのサインインの後に発生するため、ブラウザでのステップはまず成功し、その後 Claude Code がサーバーのトークンを更新するたびに再び発生します。

完全な形式では、このメッセージは MCP SDK から出力され、拒否したトークンエンドポイントを引用します。デバッグログでは、サインインの場合は `Error during auth completion:`、更新の場合は `Token refresh failed:` の後に続きます。シェルでは `claude mcp login <name>` が `Couldn't complete authentication for "<name>":` の後にこれを出力し、セッション内では `/mcp` がサーバーのメニューの下に表示します。

```text theme={null}
Refusing to send credentials to non-https token endpoint 'http://192.168.1.50:8123/oauth/token'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).
```

Claude Code は、クエリ文字列や長いランダムに見えるパスセグメントを含むサーバー URL を、機密情報である可能性があるものとして扱います。そのようなサーバーについては、MCP SDK が発生させたサインインエラーを表示またはログに記録する前に秘匿化します。その場合、このエラーは `io` のようなリリース間で変わる可能性のある短い名前の後に、`from the MCP SDK for` と秘匿化されたサーバー URL が続く形で表示されます。MCP SDK からのその他のエラーも、そこでは同じ形になります。秘匿化されたメッセージがこのエラーでありうるのは、サーバーのトークンエンドポイントが `localhost`、`127.0.0.1`、`::1` 以外のアドレスにあるプレーンな `http://` である場合のみです。

**対処方法：**

* そのトークンエンドポイントを HTTPS で提供します。たとえば、TLS を終端するリバースプロキシやトンネルの背後にサーバーを配置し、`https://` アドレスを公開するようにサーバーを設定します
* サーバーを変更せずに接続するには、[`MCP_SDK_GENERATION=v1`](https://code.claude.com/docs/ja/env-vars) を指定して Claude Code を起動します。その[ランタイム](https://code.claude.com/docs/ja/mcp.md#mcp-client-runtimes)はこのルールを適用せず、トークンリクエストをプレーンな HTTP で送信します。この選択は終了するまで有効で、すべてのサーバーに適用されます。v1 ランタイムは[発行者チェック](#issuer-mismatch-in-authorization-response)もスキップするため、エンドポイントを HTTPS で提供する方法を優先してください

### AWS credentials expired or invalid

AWS セッショントークンの有効期限が切れたか、拒否されました。このメッセージは、[Claude Platform on AWS](https://code.claude.com/docs/ja/claude-platform-on-aws.md) または [Mantle エンドポイント](https://code.claude.com/docs/ja/amazon-bedrock.md#use-the-mantle-endpoint)から 401 が返されたときに表示されます。これらのプロバイダーは、期限切れのセキュリティトークンをこの方法で報告します。

中央のアクションヒントはセットアップによって異なります。変わらない部分は先頭の `AWS credentials expired or invalid` です。

```text theme={null}
AWS credentials expired or invalid · run /login and select "Claude Platform on AWS · refresh credentials", or run `aws sso login --profile myprofile` in another terminal · API Error: 401 ...
```

v2.1.273 より前は、このメッセージは `awsAuthRefresh` が設定されている場合にのみ表示されていました。

**対処方法：**

* ヒントに認証情報がこの環境によって管理されていると示されている場合、Claude Code を起動したアプリが認証情報を所有しており、ここにあるほかの手順は適用されません。再試行するか、管理者に問い合わせてください
* [`awsAuthRefresh`](https://code.claude.com/docs/ja/amazon-bedrock#advanced-credential-configuration) が設定されている場合は、メッセージに示されているコマンド（`aws sso login --profile myprofile` など）を別のターミナルで実行し、ブラウザでのサインインを完了してから再試行します。設定されていない場合は、使用している AWS 認証情報（SSO サインイン、アクセスキー、API キー、またはプロキシトークン）を自分で更新します
* 対話セッションで `awsAuthRefresh` が設定されている場合は、代わりに `/login` を実行し、**3rd-party platform** を選択してから、**Using 3rd-party platforms** の下にある **Claude Platform on AWS · refresh credentials** を選択すると、Claude Code を再起動せずに同じコマンドを実行できます。[AWS 認証情報を設定する](https://code.claude.com/docs/ja/claude-platform-on-aws.md#1-configure-aws-credentials)を参照してください
* 更新コマンドが成功した後もエラーが繰り返される場合は、同じシェルとプロファイルで `aws sts get-caller-identity` を実行し、Claude Code の外部でその ID が有効であることを確認します

### AWS authentication failed

AWS プロバイダーが 403 を返したか、[Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md) が 401 を返しました。

Amazon Bedrock は期限切れのセキュリティトークンを 403 として報告しますが、403 は認可の拒否（IAM 権限の不足による `AccessDeniedException` など）を報告する方法でもあります。Claude Code はこの 2 つの原因を区別できません。

Amazon Bedrock からの 401 も、[AWS credentials expired or invalid](#aws-credentials-expired-or-invalid) ではなくここに該当します。Amazon Bedrock は期限切れのトークンを 401 として報告しないためです。そのエンドポイントからの 401 は通常、企業プロキシなど、リクエスト経路上の別の何かから発生します。

認証情報の更新は期限切れのトークンを修正できますが、その他の原因は修正できないため、メッセージには両方が示されます。

```text theme={null}
AWS authentication failed · run /login and select "Claude Platform on AWS · refresh credentials", or run `aws sso login --profile myprofile` in another terminal · if credentials are current, check AWS permissions and model access · API Error: 403 ...
```

中央のアクションヒントはセットアップによって異なります。変わらない部分は先頭の `AWS authentication failed` です。

403 が、指定したモデル ID のモデルへのアクセス権がないという Amazon Bedrock の応答である場合、ヒントは代わりに、Amazon Bedrock コンソールでアカウントとリージョンに対してモデルを有効にするよう案内します。

v2.1.273 より前は、このメッセージは `awsAuthRefresh` が設定されている場合にのみ表示されていました。

**対処方法：**

* ヒントに認証情報がこの環境によって管理されていると示されている場合、Claude Code を起動したアプリが認証情報を所有しており、ここにあるほかの手順は適用されません。再試行するか、管理者に問い合わせてください
* 期限切れの認証情報が原因である場合に備えて、AWS 認証情報を更新します。[`awsAuthRefresh`](https://code.claude.com/docs/ja/amazon-bedrock#advanced-credential-configuration) が設定されている場合はメッセージに示されているそのコマンドを実行し、そうでない場合は SSO サインイン、アクセスキー、API キー、またはプロキシトークンを自分で更新します
* 認証情報が最新である場合は、[IAM 設定](https://code.claude.com/docs/ja/amazon-bedrock.md#iam-configuration)にある IAM 権限が使用している ID にアタッチされていること、および選択したモデルがアカウントとリージョンで有効になっていることを確認します
* `aws sts get-caller-identity` を実行して、リクエストがどの ID を使用しているかを確認します

### Google Cloud credentials expired or invalid

[Google Cloud の Agent Platform](https://code.claude.com/docs/ja/google-vertex-ai.md) 用の Google Cloud 認証情報の有効期限が切れたか、拒否されました。リクエストは 401 を返しました。これは Agent Platform が認証情報の期限切れを報告する方法です。

中央のアクションヒントはセットアップによって異なります。変わらない部分は先頭の `Google Cloud credentials expired or invalid` です。

```text theme={null}
Google Cloud credentials expired or invalid · refresh your Google Cloud credentials (application default sign-in, or the key file in GOOGLE_APPLICATION_CREDENTIALS) and retry · API Error: 401 ...
```

**対処方法：**

* ヒントに認証情報がこの環境によって管理されていると示されている場合、Claude Code を起動したアプリが認証情報を所有しており、ここにあるほかの手順は適用されません。再試行するか、管理者に問い合わせてください
* `CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD` を設定している場合は、代わりに [Claude Models on Google Cloud（Anthropic managed）](https://code.claude.com/docs/ja/claude-models-on-google-cloud-anthropic-managed.md#google-cloud-credentials-expired-or-invalid)の手順に従ってください
* アプリケーションのデフォルト認証情報で認証している場合は、メッセージに示されている [`gcpAuthRefresh`](https://code.claude.com/docs/ja/google-vertex-ai#advanced-credential-configuration) コマンド、または `gcloud auth application-default login` を実行してサインインを完了し、再試行します
* `CLAUDE_CODE_SKIP_VERTEX_AUTH` を設定して [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)経由でルーティングしている場合は、`ANTHROPIC_AUTH_TOKEN` または `ANTHROPIC_CUSTOM_HEADERS` 内のゲートウェイトークンを更新してから再試行します
* サービスアカウントのキーファイルで認証している場合は、`GOOGLE_APPLICATION_CREDENTIALS` が有効なキーを指していることを確認します。[GCP 認証情報を設定する](https://code.claude.com/docs/ja/google-vertex-ai.md#3-configure-gcp-credentials)を参照してください
* 更新後もエラーが繰り返される場合は、同じシェルで `gcloud auth application-default print-access-token` を実行し、Claude Code の外部でその ID が機能することを確認します

v2.1.273 より前は、Agent Platform からの 401 に対して汎用的な `Please run /login` または `Failed to authenticate` メッセージが代わりに表示されていましたが、これでは Google Cloud 認証情報を更新できません。

### Google Cloud authentication failed

[Google Cloud の Agent Platform](https://code.claude.com/docs/ja/google-vertex-ai.md) が 403 を返しました。Agent Platform は 403 を、期限切れの認証情報ではなく認可の拒否に使用します。通常は、認証に使用している ID に IAM 権限が不足しているか、プロジェクトでモデルが有効になっていません。

中央のアクションヒントはセットアップによって異なります。変わらない部分は先頭の `Google Cloud authentication failed` です。

```text theme={null}
Google Cloud authentication failed · refresh your Google Cloud credentials (application default sign-in, or the key file in GOOGLE_APPLICATION_CREDENTIALS) and retry · if credentials are current, check GCP IAM permissions and Vertex AI model access · API Error: 403 ...
```

**対処方法：**

* ヒントに認証情報がこの環境によって管理されていると示されている場合、Claude Code を起動したアプリが認証情報を所有しており、ここにあるほかの手順は適用されません。再試行するか、管理者に問い合わせてください
* `CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD` を設定している場合は、代わりに [Claude Models on Google Cloud（Anthropic managed）](https://code.claude.com/docs/ja/claude-models-on-google-cloud-anthropic-managed.md#google-cloud-authentication-failed)の手順に従ってください
* [IAM 設定](https://code.claude.com/docs/ja/google-vertex-ai.md#iam-configuration)にあるロールが、認証に使用している ID に付与されていることを確認します
* プロジェクトでモデルが有効になっていることを確認します。[モデルへのアクセスをリクエストする](https://code.claude.com/docs/ja/google-vertex-ai.md#2-request-model-access)を参照してください

v2.1.273 より前は、Agent Platform からの 403 に対して汎用的な `Please run /login` または `Failed to authenticate` メッセージが代わりに表示されていましたが、これでは Google Cloud 認証情報を更新できません。

### Microsoft Foundry authentication failed

[Microsoft Foundry](https://code.claude.com/docs/ja/microsoft-foundry.md) が 401 または 403 を返しました。リクエストの Azure 認証情報が拒否されたか、その背後にある ID が Foundry リソースへのアクセス権を持っていません。`/login` では Azure 認証情報を発行できません。中央のアクションヒントはセットアップによって異なります。変わらない部分は先頭の `Microsoft Foundry authentication failed` です。

```text theme={null}
Microsoft Foundry authentication failed · refresh your Foundry credential (ANTHROPIC_FOUNDRY_AUTH_TOKEN, ANTHROPIC_FOUNDRY_API_KEY, Azure sign-in for Entra, or your proxy token) and retry · if credentials are current, check access to the Foundry resource · API Error: 401 ...
```

**対処方法：**

* ヒントに認証情報がこの環境によって管理されていると示されている場合、Claude Code を起動したアプリが認証情報を所有しており、ここにあるほかの手順は適用されません。再試行するか、管理者に問い合わせてください
* [Azure 認証情報を設定する](https://code.claude.com/docs/ja/microsoft-foundry.md#2-configure-azure-credentials)で設定した認証情報を更新します。`ANTHROPIC_FOUNDRY_API_KEY` をローテーションするか、新しい `ANTHROPIC_FOUNDRY_AUTH_TOKEN` を発行するか、`az login` を実行してデフォルトの Microsoft Entra 認証情報チェーンが再度サインインできるようにします
* 認証情報が最新である場合は、その ID が Foundry リソースへのアクセス権を持っていることを確認します。[Azure RBAC 設定](https://code.claude.com/docs/ja/microsoft-foundry.md#azure-rbac-configuration)を参照してください

v2.1.273 より前は、Microsoft Foundry からの 401 または 403 に対して汎用的な `Please run /login` または `Failed to authenticate` メッセージが代わりに表示されていましたが、これでは Azure 認証情報を更新できません。

### Could not load AWS or Google Cloud credentials

Claude Code は、実行されているマシン上で AWS 認証情報プロバイダーチェーンまたは Google のアプリケーションのデフォルト認証情報から使用可能な認証情報を取得できなかったため、リクエストはクラウドプロバイダーに到達しませんでした。`·` の後の詳細には具体的な原因が示されます。たとえば、期限切れの SSO セッション、`Could not load the default credentials` として報告されるアプリケーションのデフォルト認証情報の欠如、`invalid_grant` として報告される取り消されたサインインなどです。

```text theme={null}
API Error: Could not load AWS credentials · Could not load credentials from any providers. Check or refresh your AWS credentials and try again.
API Error: Could not load Google Cloud credentials · invalid_grant. Check or refresh your Google Cloud credentials and try again.
```

`-p` を使用した[非対話モード](https://code.claude.com/docs/ja/headless.md)および [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) では、構造化エラーコードは `cloud_credential_error` です。v2.1.267 より前は、メッセージには `API Error:` の後の詳細テキストのみが表示され、構造化コードは `server_error` または `unknown` でした。

**対処方法：**

* `aws sso login --profile myprofile` や `gcloud auth application-default login` など、プロバイダーのサインインコマンドを実行してから再試行します。Claude Code の外部で認証情報を確認する方法については、[Bedrock、Agent Platform、または Foundry の認証情報が読み込まれない](https://code.claude.com/docs/ja/troubleshoot-install.md#bedrock-agent-platform-or-foundry-credentials-not-loading)を参照してください
* 詳細が `AWS default-chain credential resolve timed out` となっている場合は、チェーンが失敗したのではなくハングしているため、代わりに [AWS default-chain credential resolve timed out](#aws-default-chain-credential-resolve-timed-out) の手順に従ってください

### AWS default-chain credential resolve timed out

AWS のデフォルト認証情報プロバイダーチェーンが 60 秒以内に認証情報を生成しなかったため、Claude Code は解決を停止し、リクエストを失敗させました。このタイムアウトは [Could not load AWS or Google Cloud credentials](#could-not-load-aws-or-google-cloud-credentials) の原因の 1 つです。この失敗はローカルでの認証情報の解決によるもので、リクエストは [Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md)、[Claude Platform on AWS](https://code.claude.com/docs/ja/claude-platform-on-aws.md)、または [Mantle エンドポイント](https://code.claude.com/docs/ja/amazon-bedrock.md#use-the-mantle-endpoint)には一度も到達していません。Claude Code はこのエラーを表示する前に[認証情報キャッシュ](https://code.claude.com/docs/ja/amazon-bedrock.md#credential-caching-and-resolution-timeout)をクリアして再試行するため、このエラーが表示された時点で、チェーンは繰り返しの試行でも停止しています。

```text theme={null}
API Error: Could not load AWS credentials · AWS default-chain credential resolve timed out. Check or refresh your AWS credentials and try again.
```

一般的な原因は、受け取ることのできない入力を待機する AWS プロファイル内の `credential_process` コマンドと、インスタンスメタデータサービス（IMDS）がチェーンのプローブに応答しないコンテナまたは VM です。

v2.1.267 より前は、メッセージは `API Error: AWS default-chain credential resolve timed out` でした。
v2.1.207 より前は、チェーンが停止するとリクエストは失敗せずに無期限に待機したままになっていました。

**対処方法：**

* 同じ `AWS_PROFILE` を使用して、同じシェルで `aws sts get-caller-identity` を実行します。これもハングする場合は、プロファイルを修正してください。対話的にプロンプトを表示する `credential_process` コマンドが一般的な原因です。
* Claude Code を起動する前に、サインインの手順（例：`aws sso login --profile myprofile`）を完了します
* チェーンが実行する対話的なサインインに正当に 60 秒を超える時間が必要な場合（`aws-vault` のようなラッパーを介した MFA 付きの SSO など）は、[`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`](https://code.claude.com/docs/ja/env-vars) でミリ秒単位の上限を引き上げます

### Bedrock setup verification timed out waiting for AWS

[Bedrock セットアップウィザード](https://code.claude.com/docs/ja/amazon-bedrock.md#sign-in-with-bedrock)の認証情報検証中の AWS への呼び出し（認証情報の検索や ID チェックなど）が、60 秒の制限内に完了しませんでした。ウィザードは待機を停止し、検証ステップを失敗させます。

```text theme={null}
Timed out after 60s waiting for AWS. Check your network and proxy settings; if a credential helper needs longer to prompt you, raise CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS.
```

この数値は設定されている上限を反映しています。デフォルトは 60 秒で、[`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`](https://code.claude.com/docs/ja/env-vars) を設定した場合はその値になります。

一般的な原因は、AWS へのリクエスト（SSO トークンの更新を含む）を停滞させるネットワークやプロキシと、画面に表示されない入力をまだ待機している認証情報ヘルパーです。上限を引き上げるのは、ヘルパーが正当により長い時間を必要とする場合のみにしてください。

AWS への単一のリクエストが停滞した場合、そのリクエスト自体のタイムアウトによって失敗することもあり、その場合は同じステップでより短いメッセージが表示されます。

```text theme={null}
A request to AWS timed out. Check your network and proxy settings, then try again.
```

モデル固定ステップで同じタイムアウトが発生した場合、ウィザードはどちらのメッセージも表示せず、代わりにモデルを `unreachable` としてマークします。

**対処方法：**

* 同じシェルで `aws sts get-caller-identity` を実行します。これもハングする場合、停滞は Claude Code の外部（ネットワーク、プロキシ、または AWS プロファイル内の認証情報ヘルパー）にあります。まずそれを修正してください。
* ウィザードを開く前に、対話的なサインイン（例：`aws sso login --profile myprofile`）を完了します
* AWS プロファイル内の認証情報ヘルパーがプロンプトを表示するのに正当に 60 秒を超える時間が必要な場合は、[`CLAUDE_CODE_AWS_CHAIN_RESOLVE_TIMEOUT_MS`](https://code.claude.com/docs/ja/env-vars) でミリ秒単位の上限を引き上げます

### Cloud gateway session expired

[Claude apps gateway](https://code.claude.com/docs/ja/claude-apps-gateway) 経由でサインインしており、このマシンに保存されているゲートウェイセッションの有効期限が切れて更新できなかったか、ゲートウェイがそのセッションを受け付けなくなっています（たとえば、ゲートウェイの [JWT シークレットが置き換えられた](https://code.claude.com/docs/ja/claude-apps-gateway-deploy.md#jwt-secret-rotation)後など）。`claude` を対話的に起動したときにこの行が表示される場合、セッションはゲートウェイからサインアウトした状態で開かれています。

```text theme={null}
Cloud gateway session expired — run /login to reconnect.
```

同じ行は、ゲートウェイの認証情報の有効期限が切れ、Claude Code がそれを更新できない場合に、セッションの途中で表示されることもあります。

[非対話](https://code.claude.com/docs/ja/headless.md)実行、バックグラウンドセッションやその他の無人セッション、または `claude auth` 以外の `claude` サブコマンドでは、ゲートウェイがセッションを受け付けなくなった場合、Claude Code は代わりに次のメッセージを表示して終了します。

```text theme={null}
Cloud gateway <url> no longer accepts this session. Start `claude` and sign in again with /login.
```

**対処方法：**

* セッションで `/login` を実行し、ブラウザでのサインインを完了します
* 非対話で起動している場合は、同じ環境で `claude` を起動して `/login` を実行してから、コマンドを再実行します

### Sign-in timed out while waiting for you to continue

[Claude apps gateway](https://code.claude.com/docs/ja/claude-apps-gateway) でのサインイン中に、ゲートウェイがサインインしたアカウントを示し、Claude Code は認証情報を保存する前にその確認を求めました。サインイン自体の有効期限を過ぎても確認画面を開いたままにしており、ゲートウェイはそれを更新できるリフレッシュトークンを発行していなかったため、続行した時点で Claude Code は何も保存しませんでした。

```text theme={null}
Sign-in timed out while waiting for you to continue. Try again.
```

**対処方法：**

* もう一度 `/login` を実行し、サインインの有効期限が切れる前にアカウントを確認します

### Gateway refused the request

[Claude apps gateway](https://code.claude.com/docs/ja/claude-apps-gateway) 経由でサインインしており、リクエストが 403 を返しました。ゲートウェイ、またはその背後にあるアップストリームがリクエストを拒否しました。再度サインインしても拒否は変わらないため、メッセージはゲートウェイ管理者への確認を案内します。

```text theme={null}
Gateway refused the request · signing in again won't change this — check with your gateway administrator · API Error: 403 ...
```

**対処方法：**

* ゲートウェイ管理者にリクエストの調査を依頼してください。`API Error:` 以降の末尾部分には、ゲートウェイが返した拒否内容が含まれています
* 管理者向け：ゲートウェイの[アクセス制御ルール](https://code.claude.com/docs/ja/claude-apps-gateway-config.md#http-tuning)は 403 を返し、[監査ログ](https://code.claude.com/docs/ja/claude-apps-gateway-deploy.md#logs)にその理由が記録されます。アップストリームによる認可の拒否は、[アップストリームのエラーメッセージ](https://code.claude.com/docs/ja/claude-apps-gateway-config.md#upstream-error-messages)に従ってそのまま渡されます

v2.1.273 より前は、ゲートウェイセッションでの 403 に対して汎用的な `Please run /login` または `Failed to authenticate` メッセージが代わりに表示され、再度サインインしても拒否は解消されませんでした。

## ネットワークと接続のエラー

これらのエラーの多くは、Claude Code からのネットワークリクエストが宛先に届かなかったか、Claude Code と API の間にある何かが戻りのレスポンスを改変したことを意味します。アーカイブの書き込み失敗など、ローカルの原因もある項目では、その本文で説明しています。通常、原因はローカルネットワーク、プロキシ、ファイアウォール、またはクラウド環境のネットワークポリシーにあります。

### Unable to connect to API

API への TCP 接続が失敗したか、完了しませんでした。一般的な接続エラーコードの場合、メッセージは失敗の種類を示し、コードを括弧内に残します。

```text theme={null}
Unable to connect to API. Check your internet connection
Connection refused — a firewall or proxy may be blocking it (ConnectionRefused)
Can't reach the API server — check your internet or DNS (ENOTFOUND)
No internet route — check your connection or VPN (EHOSTUNREACH)
Couldn't connect through your proxy (ERR_PROXY_TUNNEL) — the proxy refused the tunnel: check its credentials and that it allows this host
Connection dropped (ECONNRESET)
Request timed out. Check your internet connection and proxy settings
```

Claude Code が認識しないコードは、`Unable to connect to API` の後に括弧内のコードが続く形で表示されます。これらのメッセージの中には、複数のコードを表示し得るものがあります。たとえば、`Connection refused` は `ConnectionRefused` または `ECONNREFUSED` を、`Can't reach the API server` は `ENOTFOUND` または `FailedToOpenSocket` を表示することがあります。

v2.1.227 より前は、これらのコード付きメッセージはいずれも `Unable to connect to API` の後にコードが続く形式でした（例: `Unable to connect to API (ECONNREFUSED)`）。

一般的な原因としては、インターネットにアクセスできない、VPN が `api.anthropic.com` をブロックしている、必要な企業プロキシが設定されていない、などがあります。

**対処方法:**

* 同じシェルから `curl -I https://api.anthropic.com` を実行して、API ホストに到達できることを確認します。Windows PowerShell では、組み込みの `Invoke-WebRequest` エイリアスが使われないよう `curl.exe -I https://api.anthropic.com` を使用します。
* 企業プロキシの内側にいる場合は、Claude Code を起動する前に `HTTPS_PROXY` を設定し、[ネットワーク設定](https://code.claude.com/docs/ja/network-config.md)を参照してください
* LLM ゲートウェイやリレーを経由する場合は、[`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/ja/env-vars) にそのアドレスを設定します。セットアップについては [Claude Code を LLM ゲートウェイに接続する](https://code.claude.com/docs/ja/llm-gateway-connect.md)を参照してください。
* `ANTHROPIC_BASE_URL` がすでにゲートウェイを指しているのに、すべてのリクエストが `Connection dropped` で終わる場合は、ゲートウェイとその上流が [tool search](https://code.claude.com/docs/ja/mcp.md#tool-search-through-a-gateway) のフィールドを受け付けることを確認してください。デフォルトでは、Claude Code は `defer_loading` ツールフィールドと `tool_reference` ブロックを、それらを有効にする `anthropic-beta` ヘッダーとともに送信します。v2.1.304 より前は、`ENABLE_TOOL_SEARCH` でオンにしない限り、ゲートウェイの背後では tool search はオフでした。
* ファイアウォールが[ネットワークアクセス要件](https://code.claude.com/docs/ja/network-config.md#network-access-requirements)に記載されたホストを許可していることを確認します
* 断続的な失敗は[自動的に再試行されます](#automatic-retries)

`curl` は成功するのに Claude Code が失敗する場合、原因は通常ネットワークそのものではなく、ランタイムとネットワークの間にあるものです。

* `echo $ANTHROPIC_BASE_URL`（PowerShell では `echo $env:ANTHROPIC_BASE_URL`）を実行して `ANTHROPIC_BASE_URL` が設定されているかどうかを確認し、[設定ファイル](https://code.claude.com/docs/ja/settings.md)の `env` ブロックにも含まれていないか確認します。これが設定されていると、Claude Code はモデルリクエストを `api.anthropic.com` ではなくそのアドレスに送信します。そのため、すでに動作していないローカルのプロキシやゲートウェイを指す値が残っていると、`curl` は API に到達できても `Connection refused` が発生します。シェルプロファイルや設定からこれを削除し、新しいターミナルから Claude Code を起動してください。
* Linux と WSL では、`/etc/resolv.conf` に到達できないネームサーバーがないか確認します。特に WSL は、ホストから壊れたリゾルバーを引き継ぐことがあります。
* macOS では、切断またはアンインストールされた VPN クライアントがトンネルインターフェイスやルーティングルールを残していることがあります。`ifconfig` で古い `utun` インターフェイスがないか確認し、システム設定で VPN のネットワーク拡張機能を削除してください。
* Docker Desktop や同様のコンテナランタイムは、送信トラフィックを横取りすることがあります。これを原因から除外するには、それらを終了してから再試行してください。

### Unable to connect to Anthropic services

初回セットアップ時、Claude Code はサインイン手順を表示する前に、`api.anthropic.com` と `platform.claude.com` に到達できることを確認します。いずれかの確認が失敗すると、Claude Code は理由を出力して終了します。

```text theme={null}
Unable to connect to Anthropic services
Failed to connect to api.anthropic.com: ECONNREFUSED
Connection to api.anthropic.com timed out after 10 seconds
A proxy is configured via HTTPS_PROXY. Check that it allows connections to the host above.
```

Claude Code はこの確認を API リクエストと同じ[プロキシ設定](https://code.claude.com/docs/ja/network-config.md)経由で送信し、各プローブに 10 秒を与えます。失敗したプローブがプロキシを経由していた場合、メッセージにはそれを設定した環境変数（`HTTPS_PROXY` など）が示されます。v2.1.222 より前は、この確認はタイムアウトのない別のプロキシトランスポートを使用していました。そのため、`https://` スキームのプロキシ URL の背後では、同じプロキシ経由の API リクエストが成功するにもかかわらず、`Checking connectivity...` で無期限に停止した後に失敗することがありました。

[管理設定ファイル、MDM ポリシー、またはポリシーヘルパー](https://code.claude.com/docs/ja/managed-settings.md)が [`forceLoginMethod`](https://code.claude.com/docs/ja/settings-reference#forceloginmethod) を `"gateway"` に設定している場合、または `forceLoginMethod` なしで [`forceLoginGatewayUrl`](https://code.claude.com/docs/ja/settings-reference#forcelogingatewayurl) を設定している場合、Claude Code はこの確認をスキップします。いずれの設定でも、Claude Code は Anthropic のサインイン方法ではなく **Cloud gateway** 画面でサインイン手順を開きます。また、マシン上に管理設定のソースが存在するものの読み取れない場合も、そのソースがゲートウェイ設定を保持している可能性があるため、Claude Code は確認をスキップします。v2.1.247 より前は、この設定でも Claude Code は確認を実行し、Anthropic のエンドポイントに到達できない場合にこのエラーで終了していました。

管理設定のないマシンで、ユーザー自身の `~/.claude/settings.json` が `forceLoginMethod` と `forceLoginGatewayUrl` で[ゲートウェイを指定している](https://code.claude.com/docs/ja/claude-apps-gateway#set-the-gateway-url-in-user-settings)場合も、Claude Code は確認をスキップします。v2.1.295 より前は、その場合も Claude Code は確認を実行していました。

**対処方法:**

* メッセージがプロキシ変数を示している場合は、その値が正しいプロキシを指していることを確認し、メッセージに示されたホストへの HTTPS 接続をそのプロキシ経由で許可するようネットワークチームに依頼してください。[ネットワーク設定](https://code.claude.com/docs/ja/network-config.md)を参照してください。
* [Unable to connect to API](#unable-to-connect-to-api) の確認事項を順に実施します。そこにある `curl` テストとファイアウォールに関するガイダンスは、この確認にも当てはまります。
* ネットワークが開放されているのに失敗が続く場合は、Claude Code が[お住まいの国で利用できない](https://www.anthropic.com/supported-countries)可能性があります

### Socket is closed

`Socket is closed` は、ストリーミングレスポンスを運んでいた接続が、レスポンスの到着中に閉じられたことを意味します。最も一般的な原因は、Windows 上の企業プロキシが確立済みのトンネルをレスポンスの途中で切断することです。

レスポンスがどこまで進んでいたかに応じて、Claude Code はリクエストを再試行するか、Claude が生成した内容を保持するか、ターンを終了します。[自動再試行](#automatic-retries)を参照してください。

v2.1.214 より前は、Claude Code はこの失敗を再試行せず、ターンは `Socket is closed` を含むエラーで停止していました。

**対処方法:**

* このエラーが表示された場合は、`claude update` で v2.1.214 以降に更新してから、メッセージを再送信してください
* 更新後も同じプロキシの背後でターンが失敗し続ける場合は、[Unable to connect to API](#unable-to-connect-to-api) の確認事項を実施し、[ネットワーク設定](https://code.claude.com/docs/ja/network-config.md)でプロキシの設定を確認してください

### API returned an empty or malformed response

失敗したストリーミングリクエストに対する非ストリーミングでの再試行が HTTP の成功ステータスを受け取ったものの、本文が Claude API のメッセージではなかった場合に、Claude Code はこのエラーを表示します。よくあるのは、HTML のエラーページやサインインページ、空の本文、または別の形式の JSON です。通常の発生源は、API の代わりに応答したプロキシ、ゲートウェイ、またはネットワークのサインインページです。Claude Code はリクエストを再試行せず、ターンはこのエラーで終了します。

```text theme={null}
API returned an empty or malformed response (HTTP 200) — check for a proxy or gateway intercepting the request.
```

この冒頭部分に続いて、メッセージは何が返ってきたか、どのリクエストが失敗したかを報告します。

* コンテンツタイプ、本文の種類（`body is an HTML page` や `empty body` など）、バイト単位のサイズ、レスポンスに Anthropic のリクエスト ID が含まれていたかどうかを示す `Response:` 句。レスポンスが `nginx` や `cloudflare` など識別可能なサーバーを示している場合、または `cf-ray` や `via` などの中継ヘッダーを含む場合は、それらも句に列挙されます。
* 失敗したストリーミングリクエストの ID と、再試行のきっかけとなった失敗を示す文。失敗の前にストリームが開いていた場合は、届いたストリームイベントの数と、1 つでも届いていれば、試行が失敗した時点でストリームが沈黙していた時間も報告されます。

v2.1.234 より前は、メッセージは `intercepting the request` の後で終わっていました。

v2.1.271 より前は、`text/plain` など JSON 以外のコンテンツタイプで有効な API メッセージを返した応答でも、ターンはこのエラーで終了していました。一部の LLM ゲートウェイは、非ストリーミングの応答にそのコンテンツタイプを使用します。

**対処方法:**

* `Response:` 句を読んで、どのシステムが応答したかを確認します。HTML の本文、Anthropic のリクエスト ID がない、または `nginx` や `cloudflare` などのサーバー名が示されている場合は、Claude Code と API の間にある何かが API の代わりに応答したことを意味します
* [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway-connect.md#troubleshoot-gateway-errors)を経由している場合は、直接リクエストでルートをテストし、API 以外のレスポンスを返しているホップを修正します
* ゲスト Wi-Fi などサインインページのあるネットワークでは、ブラウザーでサインインを完了してから再試行します
* ゲートウェイ経由の非ストリーミングのルートだけが壊れている場合は、[`CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1`](https://code.claude.com/docs/ja/env-vars#variables) を設定してこのフォールバックをオフにします。ただし、ストリーミングのエンドポイント自体が `404` を返す場合は、Claude Code は引き続きフォールバックします

### Streaming response ended before any complete data was received

モデルプロバイダーからのストリーミングレスポンスが、使用可能なデータを何も届けずに完了したため、Claude Code はターンを完了するためにストリーミングなしでリクエストを再送信しました。Claude Code はこの警告を、対話型セッションでのみ、セッションごとに 1 回表示します。v2.1.239 より前は、Claude Code は何も表示せずにストリーミングなしで再試行していました。

```text theme={null}
Streaming response ended before any complete data was received. Retrying without streaming. If this keeps happening, check any proxy or gateway between Claude Code and your model provider.
```

Claude Code は影響を受けた各リクエストを 2 回送信します。空のストリーミング試行と再試行です。通常の原因は、戻りのストリーミングレスポンス本文を消費または変換するプロキシやゲートウェイです。

**対処方法:**

* Claude Code とモデルプロバイダーの間にあるプロキシやゲートウェイを、ストリーミングレスポンスの本文とそのヘッダーを変更せずに通過させるよう設定します
* [Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md) では、ヘッダーと本文の要件について[ゲートウェイまたはプロキシの背後でのストリーミングエラー](https://code.claude.com/docs/ja/amazon-bedrock.md#streaming-errors-behind-a-gateway-or-proxy)を参照してください

### Bedrock streaming response has an unexpected content-type

Claude Code と [Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md) の間にあるゲートウェイまたはプロキシが、ストリーミングレスポンスの本文またはその `Content-Type` ヘッダーを変換しています。Amazon Bedrock はレスポンスを `application/vnd.amazon.eventstream` としてストリーミングします。Claude Code は、読み取れない本文をデコードする代わりに、異なる content-type を報告する成功したストリーミングレスポンスを拒否します。Claude Code はリクエストを再試行しません。

```text theme={null}
Bedrock streaming response has content-type "text/event-stream"; expected "application/vnd.amazon.eventstream". A gateway or proxy between Claude Code and Bedrock is likely transforming the response body — Bedrock's binary event-stream format must be passed through unmodified. Set CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD=1 to suppress this check while the gateway is being fixed.
```

v2.1.208 より前は、同じ設定ミスは、レスポンス全体がバッファリングされた後に `API Error: Truncated event message received` として表面化していました。

**対処方法:**

* `InvokeModelWithResponseStream` のレスポンス本文とその `Content-Type` ヘッダーを変更せずに通過させるようゲートウェイを設定します。ストリームを server-sent events として再送出する中継装置がよくある原因です。
* [`CLAUDE_CODE_DISABLE_BEDROCK_CONTENT_TYPE_GUARD=1`](https://code.claude.com/docs/ja/env-vars) を設定するとこのエラーは表示されなくなりますが、Claude Code は書き換えられたヘッダーの下にあるバイナリ本文をデコードしないため、それらのリクエストは低速な非ストリーミングの経路にフォールバックします。[ゲートウェイまたはプロキシの背後でのストリーミングエラー](https://code.claude.com/docs/ja/amazon-bedrock.md#streaming-errors-behind-a-gateway-or-proxy)を参照してください。

### SSL 証明書エラー

ネットワーク上のプロキシまたはセキュリティアプライアンスが独自の証明書で TLS トラフィックを傍受しており、Claude Code がそれを信頼していません。

```text theme={null}
Unable to connect to API: SSL certificate verification failed (UNABLE_TO_GET_ISSUER_CERT_LOCALLY). The certificate comes from an authority Claude Code doesn't trust, usually a TLS-inspecting corporate proxy or a gateway signed by a private CA: set NODE_EXTRA_CA_CERTS to that CA bundle, or add it to the system certificate store · see https://code.claude.com/docs/en/network-config
Unable to connect to API: Self-signed certificate detected (SELF_SIGNED_CERT_IN_CHAIN). The certificate comes from an authority Claude Code doesn't trust, usually a TLS-inspecting corporate proxy or a gateway signed by a private CA: set NODE_EXTRA_CA_CERTS to that CA bundle, or add it to the system certificate store · see https://code.claude.com/docs/en/network-config
```

v2.1.273 より前は、どちらのメッセージも `Check your proxy or corporate SSL certificates` で終わっており、OpenSSL のコードや `NODE_EXTRA_CA_CERTS` のヒントは含まれていませんでした。

v2.1.199 以降、証明書の検証失敗は再試行されないため、このエラーは[再試行の上限](#automatic-retries)をすべて使い切った後ではなく、最初の試行で表示されます。以前のバージョンでは、表示するまでに数分間再試行していました。ハンドシェイクのタイムアウトなど、一時的な TLS の状態は引き続き再試行されます。

`/login` と起動時の接続確認では、同じ失敗で別のメッセージが表示されます。

```text theme={null}
SSL certificate error (UNABLE_TO_GET_ISSUER_CERT_LOCALLY). If you are behind a corporate proxy or TLS-intercepting firewall, set NODE_EXTRA_CA_CERTS to your CA bundle path, or ask IT to allowlist *.anthropic.com. Run `claude doctor` for details.
```

[Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md) では、STS や SSO のロール認証情報の呼び出し、モデルの検出、セットアップウィザードの確認など、Claude Code 自身が AWS に送信するリクエストも同じ証明書設定に依存します。[TLS を検査するプロキシの背後での証明書エラー](https://code.claude.com/docs/ja/amazon-bedrock.md#certificate-errors-behind-a-tls-inspecting-proxy)を参照してください。

**対処方法:**

* 組織の CA バンドルをエクスポートし、`NODE_EXTRA_CA_CERTS=/path/to/ca-bundle.pem` で Claude Code にそれを指定します
* 詳しいセットアップ手順については[ネットワーク設定](https://code.claude.com/docs/ja/network-config.md#custom-ca-certificates)を参照してください
* 証明書の検証を完全に無効にする `NODE_TLS_REJECT_UNAUTHORIZED=0` は設定しないでください

### クラウドセッションでホストが許可されていない

クラウドセッションまたはクラウドのスケジュールタスクでは、`403` や `ENOTFOUND` などの DNS エラーは、要求したホストが[クラウド環境の許可リスト](https://code.claude.com/docs/ja/cloud-environments.md#access-levels)に含まれていないことを意味する場合があります。確認するには、そのリストとホストを照合してください。このヘッダー付きの `403` はブロックを裏付けますが、ブロックされたリクエストの `403` すべてにこのヘッダーが付くわけではありません。

```text theme={null}
HTTP 403
x-deny-reason: host_not_allowed
```

宛先の実際の証明書と一致しない TLS 証明書が表示されることもあります。クラウドセッションは送信トラフィックをネットワークポリシーを適用するプロキシ経由でルーティングするため、証明書が一致しない場合は、宛先ではなくプロキシが接続を終端したことを意味します。

このエラーはクライアント側のネットワークの問題ではありません。クラウドセッションと[クラウドのスケジュールタスク](https://code.claude.com/docs/ja/routines.md)はサンドボックス化された VM 内で実行され、セッションのネットワークを通る送信トラフィックは[クラウド環境](https://code.claude.com/docs/ja/cloud-environments.md)の許可リストでフィルタリングされます。

* **GitHub とコネクタのトラフィック**: [GitHub の操作](https://code.claude.com/docs/ja/cloud-environments.md#github-proxy)と MCP コネクタのトラフィックは別のチャネルを使用するため、他のホストがブロックされていても動作し続けることがあります
* **Default 環境**: **Default** 環境は、**Allow package managers** がチェックされた **Limited** アクセスを使用します。そのセッションは、パッケージレジストリ、クラウドプロバイダーの API、コンテナレジストリ、一般的な開発用ドメインからなる[デフォルトの許可リスト](https://code.claude.com/docs/ja/cloud-environments.md#default-allowed-domains)に到達できます。

**対処方法:**

これらの手順は、ユーザー自身の環境のいずれかを変更するものです。[組織共有環境](https://code.claude.com/docs/ja/cloud-environments.md#organization-shared-environments)はセレクターで読み取り専用として開くため、[管理設定](https://claude.ai/admin-settings)の **Cloud environments** ページからネットワークアクセスを変更するよう Owner に依頼してください。

* [クラウドのスケジュールタスクのフォーム](https://code.claude.com/docs/ja/routines.md#environments-and-network-access)、またはクラウドセッションを開始する[環境セレクター](https://code.claude.com/docs/ja/cloud-environments.md#configure-your-environment)から、環境を編集用に開きます。
* **Edit cloud environment** ダイアログで、**Network access** の下の **Limited** を選択し、ブロックされたドメインを **Allowed domains** に追加します。1 行に 1 つのドメインを入力します。独自のドメインに加えて[デフォルトの許可リスト](https://code.claude.com/docs/ja/cloud-environments.md#default-allowed-domains)も許可するには、**Allow package managers** をチェックします。制限のないアクセスが必要な場合は、代わりに **Full** を選択します。
* **Save changes** をクリックします。次回の実行では更新された許可リストが使用されます。すでに開いているクラウドセッションについては、[ネットワークアクセスの変更が既存のセッションに反映されるタイミング](https://code.claude.com/docs/ja/cloud-environments.md#network-access)を参照してください。

アクセスレベルとデフォルトの許可リストについては[ネットワークアクセス](https://code.claude.com/docs/ja/cloud-environments.md#network-access)を参照してください。ローカルの CLI セッションはこのポリシーの影響を受けません。

### The proxy refused the connection

このメッセージは、Claude が `HTTPS_PROXY` または関連する[プロキシ変数](https://code.claude.com/docs/ja/network-config.md#environment-variables)で設定したプロキシ経由で[アーティファクト](https://code.claude.com/docs/ja/artifacts.md)を読み取るときに表示されます。アーティファクトのコンテンツは `*.frame.claudeusercontent.com` から取得されるため、Claude Code はまずプロキシに `CONNECT` リクエストを送信し、そのホストへのトンネルを開くよう求めます。プロキシが拒否するとホストには何も届かず、メッセージにはプロキシの HTTP ステータスが含まれます。

```text theme={null}
artifact content fetch failed (proxy refused the connection: HTTP 407)
artifact content fetch failed (proxy refused the connection: HTTP 403)
the proxy refused the connection to the artifact's content host (HTTP 502)
```

このステータスは、`CONNECT` に対するプロキシの応答です。ホストは一度も応答していないため、ステータスごとに異なる修正が必要です。

* `HTTP 407`: プロキシが必要とする認証情報を受け取っていません。[Basic 認証](https://code.claude.com/docs/ja/network-config.md#basic-authentication)に示すように、認証情報をプロキシ URL に含めてください。
* `HTTP 403`: プロキシが `*.frame.claudeusercontent.com` へのトンネリングを拒否しています。[ネットワークアクセス要件](https://code.claude.com/docs/ja/network-config.md#network-access-requirements)に記載されているそのホストを許可するよう、プロキシの運用担当者に依頼してください。
* `HTTP 502` などその他のステータス: ホストに到達できなかったなど、プロキシ自身の理由でトンネルが開かれませんでした。プロキシのログでそのステータスを調べてください。
* ステータスの代わりに `unreadable reply`: プロキシのアドレスにあるものが HTTP ステータス行で応答しませんでした。そのアドレスが HTTP プロキシであることを確認してください。

**対処方法:**

* [プロキシ設定](https://code.claude.com/docs/ja/network-config.md#proxy-configuration)の説明に従ってプロキシ変数のアドレスと認証情報を確認し、Claude Code を起動するシェルから、ユーザー自身のプロキシ URL を使って `curl -x http://proxy.example.com:8080 -I https://api.anthropic.com` を実行します。Windows PowerShell では `curl.exe` を実行します。このプローブが同じように失敗する場合は、まずプロキシの設定を修正してください。成功する場合、拒否はアーティファクトのホストに固有のものです。
* ネットワークで Claude Code がアーティファクトのホストに直接到達できる場合は、[`NO_PROXY`](https://code.claude.com/docs/ja/network-config#environment-variables) に `.frame.claudeusercontent.com` を追加します。エントリーはこの範囲に絞ってください。より広い `.claudeusercontent.com` というエントリーは `bridge.claudeusercontent.com` についてもプロキシをバイパスしてしまいますが、[IP 許可リスト](https://code.claude.com/docs/ja/network-config.md#organization-ip-allowlists-and-proxy-egress)を使用している組織は、このホストをプロキシ経由のままにしておく必要があります。

v2.1.238 より前は、Claude Code は拒否されたトンネルを一般的なネットワークエラーとして報告していました。

### The cloud environments service returned an empty or unexpected response

Claude Code は、CLI からクラウドセッションを作成するときや [`/remote-env`](https://code.claude.com/docs/ja/cloud-environments#select-an-environment-from-the-cli) を実行するときなど、いくつかの時点で[クラウド環境](https://code.claude.com/docs/ja/cloud-environments.md)の一覧をリクエストします。サーバーの応答を読み取れない場合、次のいずれかのメッセージが表示されます。

```text theme={null}
The cloud environments service returned an empty response (HTTP 200 with no body). This is usually temporary — try again in a moment.
The cloud environments service returned a response in an unexpected format (HTTP 200 with a non-JSON body). This is usually temporary — try again in a moment.
The cloud environments service returned a response in an unexpected format (HTTP 200 without a usable environments list). This is usually temporary — try again in a moment.
```

**対処方法:**

* 操作を再試行します。Claude Code は毎回一覧を改めてリクエストします
* メッセージが繰り返し表示される場合は、[status.claude.com](https://status.claude.com) で進行中のインシデントを確認してください

v2.1.236 より前は、Claude Code はこれらのメッセージの代わりに生の JavaScript の TypeError を表示していました。

### Failed to fetch session from Sessions API

このメッセージは、Claude Code が[ターミナルに取り込むよう指示されたクラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md#from-cloud-to-terminal)を見つけたものの、Anthropic のサーバーからその会話履歴を読み取れなかったため、セッションを開かなかったことを意味します。

```text theme={null}
Failed to fetch session from Sessions API: Failed to fetch session logs
```

これは `claude --teleport`、`/teleport` の後、または [`/tasks`](https://code.claude.com/docs/ja/commands) の一覧でセッションを選択した後に表示されます。`claude --teleport <session-id>` はこれを出力して終了コード 1 で終了します。

**対処方法:**

* 同じ teleport をもう一度実行します。同じように失敗する場合は、[問題を報告してください](#report-an-error)

v2.1.296 より前は、Claude Code は失敗した読み取りを再試行せず、失敗した後もこのメッセージを出力する代わりに、空の会話でセッションを開いて成功を報告することがありました。

### Couldn't load the history of cloud session

このメッセージは、Claude Code が[ターミナルに取り込むよう指示されたクラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md#from-cloud-to-terminal)を見つけたものの、その会話履歴のリクエストが見つからないという結果で返ってきたことを意味します。

```text theme={null}
Couldn't load the history of cloud session session_01HJKLMNOPQRSTUVWXYZ. Check it at https://claude.ai/code/session_01HJKLMNOPQRSTUVWXYZ?from=cli
```

**対処方法:**

* メッセージ内のリンクを開いて、ブラウザーでセッションを確認します。そこでは開けるのに、同じ teleport が再びこのように失敗する場合は、[問題を報告してください](#report-an-error)。

### Couldn't reconnect to your Remote Control session

原因と修正方法については、[Remote Control のトラブルシューティングにおけるこのメッセージ](https://code.claude.com/docs/ja/remote-control.md#couldnt-reconnect-to-your-remote-control-session)を参照してください。

### Sessions ended while this machine was offline

Claude Code は、マシンが長時間オフラインになり、マシンが提供していた Remote Control 環境をサーバーがクリーンアップした後に、[`claude remote-control`](https://code.claude.com/docs/ja/remote-control#start-a-remote-control-session) を実行しているターミナルにこのメッセージを表示します。その環境内のセッションは終了しており、再開できません。数値は終了したセッションの数です。

```text theme={null}
2 sessions ended while this machine was offline — the environment was cleaned up on the server and can't be resumed.
```

**対処方法:**

* このメッセージの下に Claude Code が保持された worktree を一覧表示した場合は、そこからコミットされていない作業を回収します
* `claude remote-control` を実行して新しい環境を開始します

### Couldn't share the transcript

[セッション品質アンケート](https://code.claude.com/docs/ja/data-usage.md#session-quality-surveys)などのアンケートのプロンプトからセッションのトランスクリプトの共有に同意すると、Claude Code はそれを Anthropic にアップロードします。サードパーティプロバイダーの場合、[Claude apps gateway](https://code.claude.com/docs/ja/claude-apps-gateway) のセッションの場合、および Anthropic の認証情報が利用できない場合は、代わりにローカルアーカイブを保存します。このメッセージは、共有が完了しなかったことを意味します。

```text theme={null}
Couldn't share the transcript.
```

アップロードは 8 MiB の上限内に収まる必要があります。長いセッションでは、Claude Code は共有内容の一部を段階的に削除します。縮小したバージョンを送信できない場合、またはネットワークエラーやサーバーエラーでアップロードが止まった場合に、このメッセージを表示します。Claude Code が代わりにローカルアーカイブを保存する場合、このメッセージはアーカイブを書き込めなかったことを意味します。

**対処方法:**

* `/feedback` を実行して、何が起きたかの説明とともにトランスクリプトを送信します。環境で `/feedback` を利用できない場合は、[エラーを報告する](#report-an-error)を参照してください
* 他のリクエストも失敗している場合は、ネットワーク接続を確認し、[Unable to connect to API](#unable-to-connect-to-api) を参照してください

### Couldn't send feedback

`Couldn't send feedback` で始まるメッセージは、[`/feedback`、`/bug`、または `/share` ダイアログ](https://code.claude.com/docs/ja/commands#all-commands)から送信したレポート、またはキューに入った[フィードバックの下書き](https://code.claude.com/docs/ja/tools-reference.md#sendfeedback-tool-behavior)の受信を、フィードバックサービスが確認しなかったことを意味します。受信されていないものとして扱ってください。コロンの後に組織に関する文が続く場合は、組織がフィードバックを拒否しています。

2 つ目の例は組織による拒否です。

```text wrap theme={null}
Couldn't send feedback (couldn't reach the service). If it keeps failing, you can file at https://github.com/anthropics/claude-code/issues instead.

Couldn't send feedback: Feedback has not been enabled for your organization. To report a bug, open an issue at https://github.com/anthropics/claude-code/issues. Issues are public, so leave out anything confidential.
```

**対処方法:**

* **サインインしていない**: メッセージは `: not signed in. Run /login, then retry.` と続きます。`/login` を実行してから、もう一度送信してください
* **組織による拒否**: たとえば `: Feedback has not been enabled for your organization.` や `: Feedback collection is not available for organizations with custom data retention policies.` です。その後 7 日間、`/feedback` は[組織のポリシーにより無効化されている](#feedback-is-disabled-by-your-organizations-policy)と応答することがあります。キューに入った下書きはキューに残り、引き続き[予定どおりに期限切れになります](https://code.claude.com/docs/ja/tools-reference.md#discard-or-keep-a-draft)
* **認証情報が拒否された**: メッセージは `: the sign-in this session uses is not allowed to send feedback` または `: the server did not accept the credentials this session uses` と続きます。Claude Code のプロンプトで `/status` を実行して、このセッションがどのログイン、トークン、または API キーを送信しているかを確認してください
* **`Couldn't send feedback` の直後に `(request timed out)` または `(couldn't reach the service)`**: レポートまたはキューに入った下書きをもう一度送信します。ダイアログは入力したテキストを保持しており、キューに入った下書きのメッセージには `The draft is still queued.` と表示されます。他のリクエストも失敗している場合は、ネットワーク接続を確認し、[Unable to connect to API](#unable-to-connect-to-api) を参照してください。失敗が続く場合は、[github.com/anthropics/claude-code/issues](https://github.com/anthropics/claude-code/issues) でレポートを提出してください
* **`Couldn't send feedback` の直後に `(server returned <status>)`、または理由なし**: ステータスはサービスのレスポンスコードです。サービス自身のメッセージが送信された場合は、`(server returned 403: Access Forbidden)` のようにその後に続きます。失敗が続く場合は、[github.com/anthropics/claude-code/issues](https://github.com/anthropics/claude-code/issues) でレポートを提出してください

github.com/anthropics/claude-code の Issue は公開されるため、Issue を作成する際は、コード、トランスクリプト、その他の機密情報を含めないでください。

v2.1.281 より前は、ダイアログが開いている間に Remote Control の **Stop** またはセッション間の緊急メッセージが届くと、以降のすべての送信がこのメッセージで失敗していました。これらのバージョンでは、ダイアログを閉じて開き直してから、もう一度送信してください。

### Feedback payload too large

[フィードバックの下書き](https://code.claude.com/docs/ja/tools-reference.md#sendfeedback-tool-behavior)の[レビュー画面](https://code.claude.com/docs/ja/tools-reference.md#review-and-edit-a-draft)に表示されるこのメッセージは、サービスが下書きを受け付けたという確認を Claude Code が得ていないことを意味します。受信されていないものとして扱ってください。下書きは `/feedback` のキューに残るため、もう一度送信できます。

```text wrap theme={null}
Feedback payload too large. Try again without the transcript, or shorten the details.
```

**対処方法:**

* レビュー画面で **Send transcript** を `no` に設定してから、下書きをもう一度送信します。詳細を短くしても削減できるのは最大 10 KB のテキストで、これは下書きの詳細に入れられる上限です。

### スリープまたは時刻変更中の MCP サーバー接続タイムアウト

このメッセージは、[MCP サーバー](https://code.claude.com/docs/ja/mcp.md)への接続がタイムアウトし、その試行中にシステムクロックが先に進んだことを Claude Code が検出したことを意味します。

```text theme={null}
MCP server "<name>" connection timed out. Your computer went to sleep or its clock changed while connecting.
```

Claude Code はコンピューターがスリープしたのか、時刻が先に進められたのかを判別できないため、メッセージでは両方を挙げています。

**対処方法:**

サーバーにもう一度接続し、試行が完了するまでコンピューターをスリープさせないでください。サーバーが接続すれば、修正すべきことは何もありません。

* **対話型セッションの場合**: `/mcp` を実行し、サーバーを選択して **Reconnect** を選択します
* **シェルの場合**: [`claude -p`](https://code.claude.com/docs/ja/headless)、[`claude mcp list`](https://code.claude.com/docs/ja/mcp#managing-your-servers)、または `claude mcp get` コマンドをもう一度実行します。その後サーバーが `Skipping connection (recent failure cached` で始まるメッセージで失敗した場合は、15 分待ってからコマンドをもう一度実行してください。
* **[Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) アプリケーションの場合**: TypeScript では [`reconnectMcpServer()`](https://code.claude.com/docs/ja/agent-sdk/typescript#methods)、Python では [`ClaudeSDKClient.reconnect_mcp_server()`](https://code.claude.com/docs/ja/agent-sdk/python#methods) を呼び出します
* **サーバーが再び失敗した場合**: メッセージがこれと異なる場合は、[MCP サーバーが接続しないときに確認すること](https://code.claude.com/docs/ja/mcp-quickstart.md#troubleshooting)を参照してください。コンピューターがスリープせず、時刻も変更されていないのにこのメッセージが再び表示される場合は、[エラーを報告する](#report-an-error)を参照してください。

v2.1.307 より前は、Claude Code はこのメッセージの代わりに `MCP server "<name>" connection timed out after <N>ms` のようなタイムアウトメッセージを表示していました。

## リクエストエラー

これらのエラーはリクエストの内容に関連しています。ほとんどは API がリクエストを拒否した後に返されます。いくつかはリクエストが送信される前に Claude Code によってローカルで生成されます。

### Prompt is too long

会話と添付ファイルがモデルのコンテキストウィンドウを超えています。

```text theme={null}
Prompt is too long
```

対話セッションでは、Claude Code はこのエラーを次のように表示します：

```text theme={null}
Context limit reached · /compact or /clear to continue
```

[`DISABLE_COMPACT`](https://code.claude.com/docs/ja/env-vars) が設定されている場合、この行は `/clear` のみを表示します。下記のコンテキスト圧縮失敗形式などのエラーの長い形式では、`Prompt is too long ·` という表現が保持されます。`-p` 出力とトランスクリプトでは、テキストは `Prompt is too long` のままです。

[ユーザー設定](https://code.claude.com/docs/ja/settings-reference.md#autocompactenabled)で自動圧縮をオフにした場合、この行には次のように表示されます：

```text theme={null}
Context limit reached · /compact or /clear to continue · auto-compact is off · /config to turn it on
```

`/config` の **Auto-compact** トグルは、ユーザー設定に `autoCompactEnabled` を書き込みます。このヒントは `/config` の変更が有効になる場合にのみ表示されます。たとえば、[`DISABLE_AUTO_COMPACT`](https://code.claude.com/docs/ja/env-vars) または [`DISABLE_COMPACT`](https://code.claude.com/docs/ja/env-vars) が自動圧縮をオフにした場合には表示されません。また、プロジェクトまたは管理設定などのより高い優先度のスコープが `autoCompactEnabled` を `false` に設定している場合にも表示されません。v2.1.235 より前では、この行に自動圧縮ヒントは含まれていませんでした。

Amazon Bedrock はこの状態を `Input is too long for requested model.` として報告し、Claude Code は同じ方法で処理します。v2.1.217 より前では、Claude Code は Bedrock の表現を認識しなかったため、自動圧縮はトリガーされず、`/compact` は同じエラーで失敗しました。

[Claude apps gateway](https://code.claude.com/docs/ja/claude-apps-gateway-config.md#upstream-error-messages) は、クラウドアップストリームがプロバイダー独自のエラー形式でリクエストを拒否する場合、この状態を `capability_rejected: prompt_too_long` として報告します。Claude Code はトークンを `Prompt is too long` と同じように処理します。v2.1.228 より前では、Claude Code はトークンを認識しなかったため、自動圧縮はトリガーされませんでした。

このターンで自動圧縮が実行され、モデルが利用できないか認証失敗などの基礎となるエラーで失敗した場合、メッセージはセパレータの後にそのエラーを示します：

```text theme={null}
Prompt is too long · automatic compaction failed: <the underlying error>
```

示されたエラーを最初に解決してください。`/compact` は解決するまで同じエラーで失敗します。v2.1.229 より前では、失敗した自動圧縮は原因なしで `Prompt is too long` を表示していました。

このエラーで自動圧縮が実行される場合、通常は最も古いやり取りを要約し、最新のものを保持します。最後の手段として、Claude Code は異なる方法で要約します：

* やり取り全体を要約できない場合、Claude Code は最新のプロンプトをそのまま保持し、その前のすべてを要約します。
* その場合、会話がユーザーのプロンプトで終わらないときは、Claude Code は代わりに会話全体を要約します。

引き継ぐコンテンツにモデルの応答が含まれず、ユーザー自身のテキストが約 1,000 トークン未満である場合（大きすぎる貼り付けの後に送信した短い再試行など）、Claude Code はこの復旧をスキップします。`/clear` を実行して新しく開始してください。v2.1.269 より前では、やり取り全体を要約できない場合は常に圧縮が失敗したため、その状態のセッションはすべてのターンでこのエラーに再度ヒットしました。

単一のやり取りからなる会話には、要約する以前のターンがありません。そのような会話で自動圧縮が実行されるはずだった場合、Claude Code は試行をスキップし、代わりにリクエストを何が占めているかを説明します。API がエラーでトークン数を報告しない場合、メッセージは次のようになります：

```text theme={null}
Prompt is too long · this conversation is a single exchange and cannot be compacted — the request size comes mostly from system prompt, tool definitions, or attachments.
```

API がエラーでトークン数を報告する場合、Claude Code はそれらを会話のサイズの独自の推定値と比較して、リクエストの大部分が何であるかを判断します：会話独自のコンテンツか、あるいは Claude Code が会話とともに送信するシステムプロンプト、ツール定義、添付ファイルコンテンツか。会話独自のコンテンツがリクエストの大部分である場合、メッセージは次のようになります：

```text theme={null}
Prompt is too long · the request is ~<request tokens> tokens (limit <limit>) and this conversation's own content is most of it. A single-exchange conversation cannot be compacted; start with less content (smaller files or pasted text).
```

リクエストの大部分が会話外にある場合、メッセージは次のようになります：

```text theme={null}
Prompt is too long · the request is ~<request tokens> tokens (limit <limit>) but this conversation is only ~<conversation tokens> tokens — the rest is system prompt, tool definitions, and attachment content. A single-exchange conversation cannot be compacted; reduce attached files/tools or start with less context.
```

v2.1.162 より前では、Claude Code は圧縮を試行し、失敗時に単純な `Prompt is too long` を表示していました。

**対応方法：**

* `/compact` を実行して以前のターンを要約し、スペースを解放するか、`/clear` を実行して新しく開始してください。`/compact` が `Not enough messages to compact.` と答える場合、会話は単一のやり取りであり、要約する以前のものがないため、スペースはそのプロンプトと Claude Code がすべてのリクエストで送信するもので占められています。`/clear` を実行し、貼り付けたテキストを少なくするか、より小さな添付ファイルで再送信するか、以下の手順を使用してツール定義とメモリファイルを削減してください
* `/context` を実行して、ウィンドウを消費しているものの内訳を確認してください：システムプロンプト、ツール、メモリファイル、メッセージ
* `/mcp disable <name>` で使用していない MCP サーバーを無効にして、コンテキストからツール定義を削除してください
* 大きな `CLAUDE.md` メモリファイルをトリミングするか、[パススコープルール](https://code.claude.com/docs/ja/memory.md#path-specific-rules)に指示を移動して、関連する場合にのみ読み込むようにしてください
* 自動圧縮はデフォルトでオンであり、通常このエラーを防ぎます。`/config` または [`DISABLE_AUTO_COMPACT`](https://code.claude.com/docs/ja/env-vars) でオフにした場合は、オンに戻してください。オフのままにする場合は、ウィンドウが満杯になる前に `/compact` を自分で実行してください。
* Claude Code がモデル ID を認識しないと警告した場合、その警告には Claude Code が想定したウィンドウが示されることがあります。モデルの実際のウィンドウが異なる場合は、[Claude Code に実際のウィンドウを指定](https://code.claude.com/docs/ja/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id)してください。
  * カスタムの [`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/ja/env-vars) を使用していて、エラーが `Prompt is too long · automatic compaction failed` で始まる場合は、[モデルのコンテキストウィンドウを設定](https://code.claude.com/docs/ja/model-config.md#correct-the-window-for-a-gateway-or-custom-model-id)するか、v2.1.299 以降に[更新](https://code.claude.com/docs/ja/setup.md#update-claude-code)してください。v2.1.299 より前は、Claude Code はリクエストを送信する代わりに、想定された 200K ウィンドウ付近でそのメッセージを出してターンを終了していました。
* Claude が会話を圧縮している最中に停止した直後にこのエラーが表示された場合、会話は変更されておらず、まだ圧縮が必要な大きさのままです。`/compact` を実行してから、メッセージを再送信してください。エラーの再発を防ぐには、Claude Code を v2.1.304 以降に[更新](https://code.claude.com/docs/ja/setup.md#update-claude-code)してください。v2.1.304 より前は、そのタイミングで停止するとターンがこのエラーで終了することがありました。
* v2.1.305 では、多数の MCP ツールを使用し、Anthropic API に直接接続している場合、このエラーによって API からの無関係な 400 または 422 エラーが隠れることがあります。元のエラーを確認するには、Claude Code を v2.1.306 以降に[更新してください](https://code.claude.com/docs/ja/setup.md#update-claude-code)。

[コンテキストウィンドウを探索](https://code.claude.com/docs/ja/context-window.md)して、コンテキストがどのように満杯になるかのインタラクティブビューを確認してください。

### コンテキストがトークン制限を超えています

会話がモデルのコンテキストウィンドウを超えて大きくなると、`/context` は出力の先頭にこの警告を表示します。

```text theme={null}
Context exceeds the 200k-token limit by 94k tokens — run /compact or /clear to continue.
```

`Context exceeds` の警告が表示された後、[自動圧縮](https://code.claude.com/docs/ja/settings-reference.md#autocompactenabled)がオン（デフォルト）であれば、どちらのコマンドも実行する必要はありません。

* **自動圧縮がオンの場合**: 次のメッセージを送信します。それでも [`Prompt is too long`](#prompt-is-too-long) で失敗する場合は、その項目を参照してください。
* **自動圧縮がオフの場合**: セッション内で、警告に `/compact` が示されていればそれを実行するか、`/clear` を実行して最初からやり直します。どちらかを実行するまで、メッセージは `Context limit reached`（`-p` の出力では `Prompt is too long`）で失敗します。

超過した制限が 1M コンテキストモデルの 200K 境界などの圧縮ウィンドウである場合、警告は異なる表現になります。圧縮ウィンドウはモデルのコンテキストウィンドウより小さい場合があるため、それを超えたリクエストでも成功する可能性があります。

```text theme={null}
Context is 94k tokens past the 200k-token compaction window — run /compact to reduce usage.
```

[`DISABLE_COMPACT`](https://code.claude.com/docs/ja/env-vars) を設定した場合、どちらの形式も `/compact` の代わりに `/clear` を示します。

**対応方法：**

* **コンテキスト圧縮ウィンドウの警告の後**: 複数ターンの会話では、`/compact` を実行して以前のターンを要約し、空き領域を確保します。代わりに新しく始める場合は、`/clear` を実行します。
* 使用量を削減するその他の方法については、[Prompt is too long](#prompt-is-too-long)を参照してください

v2.1.216 より前では、`/context` は 100% を超える使用量を表示し、それが何を意味するか、または復旧方法を説明する警告行がありませんでした。

### Request too large

トークン化前の生のリクエストボディが API の 32MB 制限を超えました。通常は、大きな貼り付けコンテンツ、ツール結果、または添付ファイルが原因です。この制限は [コンテキストウィンドウ](#prompt-is-too-long)とは別です。

```text theme={null}
Request too large (max 32MB). Accumulated images and attachments in the conversation pushed the request over the limit. Run /compact, or double press esc to go back and remove attachments.
```

リクエストが Claude API に直接送信され、API 自体がそれを拒否した場合、Claude Code は会話を測定し、復旧が機能するかどうかによってメッセージの表現を変えます。プロキシ、ゲートウェイ、またはクラウドプロバイダーを経由する場合は、一般的なメッセージが表示されます。測定された形式：

* `Request too large (max 32MB; 20.1MB of about 33.4MB is images or documents).`：画像またはドキュメントによってリクエストが制限を超えました。Claude Code はそれらを削除して再試行します。
* `Request too large for the API's 32MB request limit`：メッセージだけで制限を超えているため、メッセージは `compacting cannot make it fit` と示し、Claude Code は再試行しません。[非対話モード](https://code.claude.com/docs/ja/headless.md)では、メッセージは代わりに入力を削減するか、新しいセッションを開始するよう指示します。

v2.1.212 より前では、十分に蓄積された画像を持つ会話は、すべてのターンで `Request too large (max 32MB). Double press esc to go back and try with a smaller file.` で失敗しました。v2.1.229 より前では、Claude Code はすべての拒否に対して添付ファイルに関するアドバイスを表示していました。圧縮が役に立たない場合でも同様です。

**対応方法：**

* メッセージが `compacting cannot make it fit` と示す場合は、Esc キーを 2 回押して大きなコンテンツを追加したターンより前に戻るか、`/clear` を実行して新しく開始してください
* それ以外の場合は、`/compact` を実行します。これにより、蓄積された画像と添付ファイルが削除されます
* 大きなファイルの内容を貼り付けるのではなく、パスで参照してください。Claude はそれらをチャンクで読むことができます
* 画像については、以下の [Image was too large](#image-was-too-large)を参照してください

### Image was too large

貼り付けまたは添付された画像が API のサイズまたは寸法制限を超えています。

```text theme={null}
Image was too large. Double press esc to go back and try again with a smaller image.
API Error: 400 ... image dimensions exceed max allowed size
API Error: an image in the conversation could not be processed and was removed.
An image in the conversation exceeds the dimension limit for many-image requests (3000px). Run /compact to remove old images from context, or start a new session.
```

`could not be processed and was removed` の行は、サイズや寸法の上限を超えた画像など、会話内の画像を API が拒否したことを意味します。

これらのエラーのいずれかが繰り返し発生する場合は、Claude Code を更新してください。古いバージョンでは、次のような理由で画像エラーが繰り返されることがありました。

* v2.1.299 より前は、多数の画像を含む長い会話で、Claude Code が上限を超えた画像ではなく、最後に添付した画像を削除することがありました。その結果、`was removed` の行が毎ターン繰り返され、Claude には新しい画像が見えませんでした。
* v2.1.299 より前は、VS Code、Desktop アプリ、Agent SDK で、Claude の作業中に添付した画像には、他の添付画像に適用されるリサイズが適用されませんでした。それらの画像は元のサイズのまま API に送信されたため、長い会話で画像エラーが繰り返し発生していました。
* v2.1.166 より前は、貼り付けた画像が会話内に残り、その後のすべてのメッセージで同じエラーが繰り返されることがありました

**対応方法：**

* 貼り付ける前に画像をリサイズしてください。API は単一の画像で最長辺 8000 ピクセルまで、コンテキストに 20 枚を超える画像がある場合は 3000 ピクセルまでの画像を受け入れます。
* 全画面ではなく、関連する領域に絞ったスクリーンショットを撮ってください
* `dimension limit for many-image requests` メッセージの場合、メッセージで示されていれば Claude Code のプロンプトで `/compact` を実行するか、画像の数を減らして新しいセッションを開始します

`dimension limit for many-image requests` メッセージには、API のエラーで示されたピクセルの上限が表示されます。

### Unable to resize image

Claude Code は、API に送信する前に添付画像をダウンスケールできませんでした。

```text theme={null}
Unable to resize image — image processing is unavailable and dimensions could not be read from the file header. Please convert the image to PNG, JPEG, GIF, or WebP.
Unable to resize image — dimensions exceed the 2000x2000px limit and image processing failed. Please resize the image to reduce its pixel dimensions.
Unable to resize image (… raw, … base64). The image exceeds the … API limit and compression failed. Please resize the image manually or use a smaller image.
Unable to resize image — could not verify image dimensions are within the 2000x2000px API limit.
Unable to resize image — it is a CMYK JPEG, which Claude Code cannot decode, and at …px it is over the 2000x2000px limit, so it cannot be sent. Re-save it as an RGB PNG or JPEG and try again.
Unable to resize image — it is an animated WebP whose first frame Claude Code cannot decode, and at …px it is over the 2000x2000px limit, so it cannot be sent. Save its first frame as a PNG or JPEG and try again.
Unable to resize image — its pixels could not be decoded (the file may be damaged, or use an encoding Claude Code cannot read), and it is over the … API limit (… raw, … base64), so it cannot be sent. Re-save it as a PNG or JPEG and try again.
```

Claude Code は通常、大きな画像を自動的にリサイズします。これらのエラーは、画像をデコードまたはリサイズして API 制限内に収めることができなかったことを意味します。

表示されるエラーでは、これらの例の `2000x2000px` の代わりに `2576x2576px` など、異なるピクセル制限が示されることがあります。

**対応方法：**

* メッセージが画像を変換するよう求める場合は、PNG、JPEG、GIF、または WebP に変換して再度添付してください。Claude Code はファイルヘッダーからこれらの形式の寸法を確認でき、画像をデコードする必要はありません。
* メッセージが寸法またはサイズ制限を報告する場合は、その制限を下回るように画像をリサイズまたは再圧縮してから添付してください。
* メッセージが CMYK JPEG、アニメーション WebP、または破損している可能性のあるファイルなどの原因を示す場合は、メッセージが提案する形式で画像を再保存して再度添付してください。

### Request rejected as unprocessable by the model

API は、モデルが処理できないものとしてリクエストを拒否しました。メッセージは API 自体のものです。

```text theme={null}
API Error: 400 Request rejected as unprocessable by the model (too many or oversized images, or unsupported parameters)
```

Claude Code は、拒否されたリクエストから最も古い画像とドキュメントを削除して再送信できます。v2.1.290 より前は、この拒否に対して Claude Code が画像を削除しなかったため、数百枚の画像が蓄積された長いセッションではターンごとにこのエラーで失敗することがありました。

**対処方法：**

* 画像やドキュメントを含む会話でメッセージが繰り返し表示される場合は、自分でそれらを削除します。Esc を 2 回押してそれらを追加したターンより前に戻るか、`/clear` を実行して新しく始めます。

### PDF エラー

添付した PDF を処理できませんでした。メッセージはここに非対話形式で表示されます。対話セッションでは、代わりに Esc キーを 2 回押して再試行するよう促します。

```text theme={null}
PDF too large (max 100 pages, 20MB). Try reading the file a different way (e.g., extract text with pdftotext).
PDF is password protected. Try using a CLI tool to extract or convert the PDF.
The PDF file was not valid. Try converting it to text first (e.g., pdftotext).
```

**対応方法：**

* 大きすぎる PDF については、ファイル全体を添付するのではなく、Read ツールでページ範囲を読むよう Claude に依頼するか、`pdftotext` などのツールでテキストを抽出して、出力ファイルをパスで参照してください
* 保護されているか無効な PDF については、パスワードを削除するか、ソースアプリケーションからファイルを再度エクスポートしてから再試行してください

Claude が Read ツールで PDF からページ範囲を読むとき、読み取りは異なるメッセージで失敗する可能性があります：

```text theme={null}
pdftoppm is not installed. Install poppler-utils (e.g. `brew install poppler` or `apt-get install poppler-utils`) to enable PDF page rendering.
```

ページ範囲の読み取りは `pdftoppm` でページをレンダリングします。メッセージが提供するコマンドで poppler-utils をインストールするか、他のプラットフォームでは `pdftoppm` を `PATH` に配置する poppler ビルドをインストールしてください。どの PDF がページ範囲で読まれるかについては、[Read ツールの動作](https://code.claude.com/docs/ja/tools-reference.md#read-tool-behavior)を参照してください。

### Extra inputs are not permitted

リクエストを受け取ったエンドポイントが、リクエストのフィールドの 1 つを受け付けない入力として拒否しました。エンドポイントのメッセージにはそのフィールドが示されています。

```text theme={null}
API Error: 400 ... context_management: Extra inputs are not permitted
```

Claude Code は、`context_management` やツール検索の `defer_loading` などのベータ専用フィールドを、それらを有効にする `anthropic-beta` ヘッダーとともに送信します。ゲートウェイが本文を転送してもヘッダーを削除すると、API は認識できないフィールドを受け取ることになります。ゲートウェイが Anthropic 形式の本文を異なるスキーマを持つアップストリームに転送すると、そのアップストリームがそのようなフィールドを拒否します。[ベータヘッダーと本文フィールドのペア](https://code.claude.com/docs/ja/llm-gateway-protocol.md#beta-header-and-body-field-pairs)では、両方のケースを説明しています。

**対応方法：**

* メッセージに `context_management: Extra inputs are not permitted` が含まれている場合は、[Claude Code をアップデート](https://code.claude.com/docs/ja/setup.md#update-claude-code)して v2.1.304 以降にします。アップデート後、Claude Code はこの拒否に対してそのフィールドを除いてリクエストをもう一度送信します。v2.1.304 より前は、Claude Code はこの拒否に対して再試行しませんでした。
* メッセージが `defer_loading` または `tool_reference` を示している場合は、[Claude Code を v2.1.305 以降にアップデート](https://code.claude.com/docs/ja/setup.md#update-claude-code)してください。その後、Claude Code はこの拒否に対して、ツール検索フィールドを除いた[リクエストをもう一度送信](https://code.claude.com/docs/ja/llm-gateway-protocol.md#retry-without-tool-search)します。
* ゲートウェイがヘッダーを削除している場合は、`anthropic-beta` ヘッダーを転送するようにゲートウェイを設定します。ゲートウェイが転送する必要があるものについては、[機能のパススルー](https://code.claude.com/docs/ja/llm-gateway-protocol.md#feature-pass-through)を参照してください。
* フォールバックとして、起動前に [`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1`](https://code.claude.com/docs/ja/env-vars) を設定してください。正確なスコープについては [プリリリース機能を無効にする](https://code.claude.com/docs/ja/llm-gateway-protocol.md#disable-pre-release-capabilities)で説明しています。

v2.1.302 より前は、ゲートウェイが関与していなくても、このエラーでフィールド `diagnostics` が示されることがありました。これは、すでに Anthropic API を使用していたセッションが、再起動せずに Amazon Bedrock または Google Cloud's Agent Platform に移行した場合に発生していました。たとえば、開いたままにしていたセッションは、別の Claude Code ウィンドウで [`/setup-bedrock`](https://code.claude.com/docs/ja/commands) を実行すると Bedrock に移行します。これらのバージョンでは、そのセッションで `/clear` を実行するか、セッションを再起動してください。

### ツール入力スキーマが無効です

リクエスト内のツールが、API の JSON Schema 検証に失敗する `input_schema` を宣言したため、API はリクエスト全体を拒否しました。`tools.` の後の番号は、検索可能な名前ではなく、リクエストのツールリスト内の失敗したツールの位置です。

```text theme={null}
API Error: 400 ... tools.N.custom.input_schema: JSON schema is invalid
API Error: 400 ... tools.N.custom.input_schema.properties: Property keys should match pattern '^[a-zA-Z0-9_.-]{1,64}$'
```

最初の形式は、スキーマが有効な JSON Schema draft 2020-12 ではないことを意味します。2 番目は、トップレベルのプロパティ名がメッセージが引用するパターンと一致しないことを意味します。

Claude Code はサーバーのツールを読み込む際に [この検証に失敗する入力スキーマを持つ MCP ツールを除外](https://code.claude.com/docs/ja/mcp.md#tools-with-invalid-input-schemas)するため、リクエストには通常そのようなツールは含まれません。

それでも、次のような場合にはエラーが発生することがあります。

* [機能フラグの取得](https://code.claude.com/docs/ja/env-vars.md#features-that-need-feature-flag-fetching)がオンになっているものの、[フラグがまだ届いていない](https://code.claude.com/docs/ja/env-vars.md#first-session-after-an-install-or-upgrade)場合。v2.1.328 より前は、取得がオフの場合にもこのエラーが発生することがありました。
* ツールのスキーマが `$schema` で draft 2020-12 以外の JSON Schema ダイアレクトを宣言している場合。

**対応方法：**

* Claude Code のバージョンが v2.1.300 より前の場合は、シェルで [`claude update`](https://code.claude.com/docs/ja/setup#update-claude-code) を実行します。v2.1.300 より前は、Claude Code は[拒否されたツールのパラメーターを除いてリクエストを再試行する](https://code.claude.com/docs/ja/mcp.md#tools-whose-input-schema-the-api-refuses)ことをしなかったため、そのツールを含むすべてのリクエストでこのエラーが繰り返されていました。
* 無効なスキーマを宣言する MCP サーバーを削除するか、[無効にしてください](https://code.claude.com/docs/ja/mcp.md#disable-a-server-without-removing-it)。エラーはツールを位置でのみ示します。v2.1.216 以降では、各サーバーのログで、入力スキーマが拒否されるツールを示す行を確認してください。どのログにもそれが示されていない場合は、サーバーを 1 つずつ無効にしてください。
* サーバーを保守している場合は、ツールの `input_schema` を修正してください。スキーマは有効な JSON Schema である必要があり、トップレベルのプロパティ名は 1 ～ 64 文字で、ASCII 文字と数字、`_`、`.`、`-` のみを使用する必要があります。[無効な入力スキーマを持つツール](https://code.claude.com/docs/ja/mcp.md#tools-with-invalid-input-schemas)を参照してください。

### MCP ツール名が 128 文字を超えています

MCP サーバーが、`mcp__<server>__<tool>` などの完全な名前が API が受け入れる 128 文字を超えるツールを一覧表示しています。Claude Code は [そのツールを Claude に送信するツールから除外](https://code.claude.com/docs/ja/mcp.md#tools-with-names-longer-than-128-characters)し、サーバーの他のツールは引き続き機能します。シェルから `claude --debug` で開始したセッションでは、Claude Code は `~/.claude/debug/<session-id>.txt` のデバッグログに次のメッセージを書き込みます：

```text theme={null}
Tool "mcp__<server>__<tool>" is not sent to Claude: its name has <N> characters and the API accepts at most 128
```

**対応方法：**

* サーバーを保守している場合は、ツールの名前を短くしてください。
* サーバーが [MCP 設定](https://code.claude.com/docs/ja/mcp.md#mcp-installation-scopes)にある場合は、そこでより短い名前（`analytics-database` の代わりに `db` など）を付けてください。その後、[権限ルール](https://code.claude.com/docs/ja/permissions.md#mcp)や [フック matcher](https://code.claude.com/docs/ja/hooks.md#match-mcp-tools) など、古い名前でサーバーまたはそのツールを参照しているものを更新してください。
* [プラグインがサーバーをバンドルしている](https://code.claude.com/docs/ja/mcp.md#plugin-provided-mcp-servers)場合、ツールの完全な名前にはプラグイン名も含まれます。プラグインの保守担当者にサーバー名またはツール名を短くするよう依頼してください。

v2.1.292 より前では、Claude Code はそれでもツールを送信し、API はそのツールを含むすべてのリクエストを `API Error: 400 ... tools.N.custom.name: String should have at most 128 characters` で拒否していました。

### tool\_use.name が 200 文字を超えています

会話履歴内のツール呼び出しが、API がリクエストで受け入れる 200 文字の制限を超える名前を含んでいます：

```text theme={null}
API Error: 400 ... tool_use.name: String should have at most 200 characters
```

Claude Code は、応答が到着したときと保存された会話を読み込むときに、そのような名前を 200 文字に切り詰めるため、呼び出しは [`No such tool available`](#no-such-tool-available) ツールエラーで失敗し、会話はこの API エラーなしで続行されます。

**対応方法：**

* `claude update` を実行してから、会話を再開してください。更新されたバージョンはトランスクリプトを読み込むときに長すぎる名前を修復するため、スタックしていた会話が再度機能します。

v2.1.281 より前では、長すぎる名前は履歴に残り、API は `/compact` や `--resume` を含む会話を再送信するすべてのリクエストを拒否したため、このエラーが繰り返され、会話はスタックしました。

### There's an issue with the selected model

設定されたモデル名が認識されなかったか、アカウントがそれへのアクセス権を持っていません。v2.1.160 の時点で、末尾のヒント（ここでは対話形式で表示）はサーフェスによって異なります。

```text theme={null}
There's an issue with the selected model (claude-...). It may not exist or you may not have access to it. Run /model to pick a different model.
```

**対応方法：**

* **対話 CLI**：`/model` を実行して、アカウントで利用可能なモデルから選択してください。
* **非対話モード（`-p`）**：有効なエイリアスまたは ID で `--model` を渡すか、[`ANTHROPIC_MODEL`](https://code.claude.com/docs/ja/env-vars) を設定してください。このサーフェスではエラーテキストに `Run --model` が表示されます。
* **Agent SDK**：モデルはプログラムで設定されるため、エラーテキストはヒントを省略します。TypeScript で [`Options` の `model`](https://code.claude.com/docs/ja/agent-sdk/typescript#options) を設定するか、Python で [`ClaudeAgentOptions(model=...)`](https://code.claude.com/docs/ja/agent-sdk/python#claudeagentoptions) を設定し、構造化された `model_not_found` エラーを処理して、独自の再試行またはモデルピッカーを表示してください。
* 完全なバージョン付き ID ではなく、`sonnet` や `opus` などのエイリアスを使用してください。エイリアスは保守されたデフォルトに解決されるため、古くなりません。[モデル設定](https://code.claude.com/docs/ja/model-config.md)を参照してください。
* 間違ったモデルが CLI で戻り続ける場合は、古い ID がどこかに設定されています。[優先順位順](https://code.claude.com/docs/ja/model-config.md#setting-your-model)でモデルを設定できる場所を確認し、古い値を削除してください。
* v2.1.206 より前は、更新できなくなった期限切れの claude.ai ログインにより、すべてのモデルがこのエラーで失敗していました。これらのバージョンでは `/login` を実行してください。
* [`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/ja/env-vars) が [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)を指していて、すべてのモデルがこのように失敗する場合は、ゲートウェイとそのアップストリームが[ツール検索](https://code.claude.com/docs/ja/mcp.md#tool-search-through-a-gateway)フィールドを受け付けることを確認してください。デフォルトでは、Claude Code は `defer_loading` ツールフィールドと `tool_reference` ブロックを、それらを有効にする `anthropic-beta` ヘッダーとともに送信します。v2.1.304 より前は、`ENABLE_TOOL_SEARCH` でオンにしない限り、ゲートウェイ経由ではツール検索はオフでした。
* Google Cloud の Agent Platform デプロイについては、[Google Cloud の Agent Platform トラブルシューティング](https://code.claude.com/docs/ja/google-vertex-ai.md#troubleshooting)を参照してください。

### Model is not a recognized model id

モデルの切り替えに渡した文字列は、Claude Code がモデルとして使用できるものではないため、リクエストを送信せずに切り替えを拒否し、セッションは現在のモデルを保持します。[Agent SDK](https://code.claude.com/docs/ja/agent-sdk/typescript.md) の `setModel()` メソッドでモデルを設定した場合、[Desktop app](https://code.claude.com/docs/ja/desktop.md) など Claude Code CLI を代わりに実行するアプリがモデルを設定した場合、または [Remote Control](https://code.claude.com/docs/ja/remote-control.md) を通じて接続されたデバイスからモデルを選択した場合に、このエラーが発生する可能性があります。v2.1.200 より前では、Claude Code は文字列を保存し、次のリクエストで [There's an issue with the selected model](#theres-an-issue-with-the-selected-model)として失敗しました。

```text theme={null}
Model "Sonnet5" is not a recognized model id. Did you mean 'claude-sonnet-5'?
```

この例では、アプリは表示名 `Sonnet 5` を送信し、メッセージはそれをスペースなしで繰り返しています。末尾のヒントは、最も近いエイリアスまたはモデル ID を示します。十分に近いものがない場合は、代わりに `Run /model to see available models.` と表示されます。[Desktop app](https://code.claude.com/docs/ja/desktop.md) が起動するセッションでは、一致なしの場合のヒントは `Switch to a different model.` と表示されます。

Agent SDK または Anthropic API 上のアプリを通じて切り替える場合、表示名や空の文字列など、モデル ID になり得ない文字列のみがこのエラーになります。

Remote Control デバイスからモデルを選択する場合、Claude Code はローカルで文字列をチェックします。モデルエイリアス、Claude Code が一覧表示するモデルまたはユーザーが設定したモデル、`claude-` で始まる ID のいずれでもない文字列は、`claud-sonnet-5` などのタイプミスされた ID を含めて、このエラーになります。v2.1.260 より前では、このチェックは Remote Control での選択を対象としていなかったため、認識されない文字列が適用され、次のリクエストで失敗しました。

**対応方法：**

* 引数なしで `/model` を実行してピッカーを開き、アカウントで利用可能なモデルから選択してから、そこに表示されるエイリアスまたは ID を渡してください
* 新しい Claude Code バージョンでのみサポートされるエイリアスを使用した場合は、`claude update` を実行するか、代わりにモデルの完全な ID を渡してください。サーバーはそのモデルに最小 Claude Code バージョンを要求する場合があります。[Claude Code does not support this model](#claude-code-does-not-support-this-model)を参照してください。
* v2.1.200 より前に保存されたモデルはこのチェックで修復されません。古い値が戻り続ける場合は、[モデルの設定](https://code.claude.com/docs/ja/model-config.md#setting-your-model)に記載されている場所から削除してください。
* Anthropic API 以外のプロバイダー、またはゲートウェイやカスタム `ANTHROPIC_BASE_URL` の背後では、空の文字列のみがこのエラーになります。Claude Code は、すべてのプロバイダーでリクエスト時に [認識されないモデルの診断行](#unrecognized-model-id-on-a-request)を書き込むことがあります。

### Model not found

モデルを名前で切り替えましたが、Claude Code はその名前のモデルが存在することを確認できませんでした。名前が [モデルエイリアス](https://code.claude.com/docs/ja/model-config.md#model-aliases)でも Claude Code がローカルで受け入れる別の表記でもない場合、Claude Code は最小限の API リクエストでそれを検証し、このエラーは通常、API エンドポイントの応答です。`/model <name>` では、スペースを含むものなど、そもそもモデル ID になり得ない名前も同じメッセージになります。

```text theme={null}
Model 'claude-opus-9' not found
```

プロバイダー固有のモデル ID を持つプロバイダーでは、メッセージはフォールバックモデルのプロバイダーの ID を示す `Try '...' instead` 提案を追加する場合があります。

**対応方法：**

* 引数なしで `/model` を実行し、アカウントで利用可能なモデルから選択するか、`sonnet` などの [モデルエイリアス](https://code.claude.com/docs/ja/model-config.md#model-aliases)を使用してください。これは保守されたデフォルトに解決されます
* 完全な ID を入力した場合は、プロバイダーのモデルカタログと照合してください。新しくリリースされたモデルは、プロバイダーまたはリージョンが提供する前に Anthropic API で利用可能になる場合があります。
* Agent SDK では、`setModel()` はこのメッセージで失敗し、セッションは前のモデルで実行し続けます。TypeScript SDK では、[`supportedModels()`](https://code.claude.com/docs/ja/agent-sdk/typescript#query-object)を呼び出して、切り替えることができるモデルを一覧表示してください。
* v2.1.265 より前では、`/model` は `opusplan[1m]` エイリアス表記もこのエラーで拒否しました。これらのバージョンでは、Claude Code を更新するか、代わりに [設定](https://code.claude.com/docs/ja/model-config.md#setting-your-model)または `--model` でモデルを設定してください。

### Couldn't confirm model with the API

[Agent SDK](https://code.claude.com/docs/ja/agent-sdk/typescript.md) の `setModel()` メソッド、または [Desktop アプリ](https://code.claude.com/docs/ja/desktop.md)など Claude Code CLI を代わりに実行するアプリを通じてモデルを切り替えましたが、API エンドポイントでモデル ID を確認するリクエストに 15 秒以内に応答がありませんでした。セッションは現在のモデルを維持します。

```text theme={null}
Couldn't confirm model "claude-sonnet-5" with the API. Try again, or run /model to see available models.
```

[Desktop app](https://code.claude.com/docs/ja/desktop.md) が起動するセッションでは、メッセージは `Try again.` で終わります。

**対応方法：**

* モデルを再度切り替えてください
* 切り替えが失敗し続ける場合は、Claude Code が API エンドポイントに到達できることを確認してください。[ネットワークと接続エラー](#network-and-connection-errors)を参照してください

### 選択したモデルを確認するときの API エラー

`/model <name>` でモデルを選択したか、セッションに接続されたアプリが切り替えを要求しました。API は、モデルを検証するために Claude Code が送信する最小限のリクエストを、レート制限やサーバーエラーなど、独自のエントリを持たない理由で拒否しました。セッションは現在のモデルを保持し、メッセージの末尾にそのことが示されます：

```text theme={null}
API error: 429 <the server's explanation> · model not changed
```

メッセージの中央は HTTP ステータスとサーバー独自の説明です。

**対応方法：**

* サーバーの説明に対応してください。レート制限または 5xx ステータスの場合は、待機してモデルを再度選択してください
* 独自の表現を持つ拒否は、[Model not found](#model-not-found)や [Model is restricted by your organization's settings](#model-is-restricted-by-your-organizations-settings)などの周囲のエントリで説明しています

### Claude Opus is not available with the Claude Pro plan

アクティブなサブスクリプションプランには、選択したモデルが含まれていません。

```text theme={null}
Claude Opus is not available with the Claude Pro plan. If you have updated your subscription plan recently, run /logout and /login for the plan to take effect.
```

Claude Desktop アプリが実行するセッションでは、メッセージはコマンドを示すのではなく、`sign out and sign in again` と表示します。

**対応方法：**

* `/model` を実行し、プランに含まれるモデルを選択してください
* 最近プランをアップグレードしてもこれが表示される場合は、`/logout` を実行してから `/login` を実行してください。保存されたトークンはサインイン時のプランを反映するため、claude.ai でアップグレードしても、再認証するまで既存のセッションで有効になりません。
* 各プランに含まれるモデルについては、[claude.com/pricing](https://claude.com/pricing)を参照してください

### Claude Code does not support this model

Claude Code バージョンが必要な最小値を下回っているため、API は 400 でリクエストを拒否しました。選択したモデルが新しいバージョンを必要としている（サーバーはモデルごとにチェックします）か、組織のポリシーが新しいバージョンを必要としています。400 にはエラーコード `claude_code_version_too_old` が含まれ、メッセージはどの最小値が適用されるかを示します。

```text theme={null}
API Error: 400 Claude Code 2.1.219 does not support this model; version 2.1.255 or newer is required. Run 'claude update', or update the Claude desktop app, then try again.
```

組織ポリシーの表現は次のとおりです：

```text theme={null}
API Error: 400 Claude Code 2.1.240 is older than the minimum version required by your organization's policy. Run 'claude update', or update the Claude desktop app, to continue.
```

API がチェックするバージョンは、リクエストを行った Claude Code バイナリが報告するバージョンです。

**対応方法：**

そのバイナリを更新してから、新しいセッションを開始してください。[セルフホスト環境](https://code.claude.com/docs/ja/self-hosted-environments-deploy.md#pin-the-version)を除き、更新方法はバイナリの入手元によって決まります：

| リクエストを行ったバイナリ | 更新方法 |
| :- | :- |
| インストールした Claude Code | `claude update` を実行 |
| Claude デスクトップアプリ | アプリを更新 |
| [VS Code 拡張機能](https://code.claude.com/docs/ja/vs-code.md)がバンドルするバイナリ | 拡張機能を更新 |
| Agent SDK パッケージがバンドルするバイナリ | [SDK パッケージをアップグレード](https://code.claude.com/docs/ja/agent-sdk/hosting.md#runtime-dependencies)してから、アプリケーションを再起動します。[コンパイルされた単一ファイル実行可能ファイル](https://code.claude.com/docs/ja/agent-sdk/typescript.md#compile-to-a-single-executable)では、それを再ビルドします |

* [stable リリースチャネル](https://code.claude.com/docs/ja/setup.md#configure-release-channel)で `claude update` を実行した場合、最新の stable リリースより先には進みません。そのリリースは必要な最小バージョンを下回っている可能性があります。latest チャネルに移行してから、再度更新してください。組織が [管理設定](https://code.claude.com/docs/ja/managed-settings.md)を通じてチャネルまたはバージョンを固定している場合は、管理者に変更を依頼してください
* モデルごとの表現については、別のモデルに切り替えることで現在のセッションで作業を続けることができます。CLI で `/model` を実行するか、ストリーミング入力モードで TypeScript SDK の `Query` オブジェクトの [`setModel()`](https://code.claude.com/docs/ja/agent-sdk/typescript#query-object)を呼び出すか、Python SDK の `ClaudeSDKClient` の [`set_model()`](https://code.claude.com/docs/ja/agent-sdk/python#claudesdkclient)を呼び出してください
* 組織ポリシーの表現については、続行する前に更新してください

### Model is restricted by your organization's settings

組織の管理者が claude.ai 管理コンソールでこのモデルを無効にしたか、管理設定が [`availableModels`](https://code.claude.com/docs/ja/model-config#restrict-model-selection) 許可リストまたは [`deniedModels`](https://code.claude.com/docs/ja/model-config#block-specific-models-or-versions) リストを通じてそれを除外しました。`--model`、`ANTHROPIC_MODEL`、または `model` 設定が制限されたモデルを指定した場合、通知は起動時に表示され、セッションが代わりに使用するモデルを示します。管理設定によってセッションで使用できる許可されたモデルが残らない場合は、[管理設定がデフォルトモデルをブロック](#managed-settings-block-the-default-model)を参照してください。管理者が claude.ai 管理コンソールでセッションが実行されているモデルを無効にした後、置換通知はセッション中に表示される場合もあります。

```text theme={null}
Model "claude-opus-4-8" is restricted by your organization's settings. Using claude-sonnet-4-6 instead.
```

制限されたモデルに対して `/model <name>` を入力すると拒否され、セッションは現在のモデルを保持します。管理コンソールで無効にされたモデルの場合、拒否は `Model '<name>' is restricted by your organization's settings. Run /model to choose a different model.` と表示されます。管理設定が除外するモデルの場合、`Model '<name>' is not available. Your organization restricts model selection.` と表示されます。

エージェント、スキル、またはコマンド名で始まる通知は、制限が [サブエージェントの要求されたモデル](https://code.claude.com/docs/ja/sub-agents.md#choose-a-model)に適用されたことを意味します：サブエージェントは置換モデルで実行され、セッションのモデルは変更されません。v2.1.223 より前では、Claude Code は Agent ツールで起動されたサブエージェントに対してのみ通知を表示していました。

Claude Code は、モデルファミリーエイリアス（`opus`、`sonnet`、`haiku`、`fable` のいずれか）を、そのファミリーの最新バージョンではなく、そのファミリーへのリクエストとして扱います。Anthropic API および [Claude Platform on AWS](https://code.claude.com/docs/ja/claude-platform-on-aws.md)では、制限されたファミリーエイリアスは、組織の設定が許可するファミリーの最新バージョンに解決され、置換通知がそのバージョンを示します。Claude Code が `/model <alias>` を拒否するのは、ファミリーのすべてのバージョンが制限されている場合のみです。v2.1.205 より前では、ファミリーエイリアスは、同じファミリーの古いバージョンが許可されている場合でも、最新バージョンのみに基づいて置換または拒否されていました。

**対応方法：**

* `/model` を実行して、組織が許可するモデルから選択してください。制限されたモデルはピッカーから非表示になります。
* 制限されたモデルが `--model`、`ANTHROPIC_MODEL`、設定ファイルの `model` フィールド、または [サブエージェント](https://code.claude.com/docs/ja/sub-agents.md#choose-a-model)、スキル、コマンドの `model` フロントマターに設定されている場合は、その値を削除または更新して、通知が再度表示されないようにしてください
* 制限されたモデルへのアクセスが必要な場合は、組織の管理者に有効にするよう依頼してください。[組織のモデル制限](https://code.claude.com/docs/ja/model-config.md#organization-model-restrictions)を参照してください。

### Can't switch to the default model

Default モデルを選択しました（たとえば、`/model` ピッカーで Default 行を選択するか、`/model default` を入力した場合）。Claude Code は切り替えを拒否したため、セッションは現在のモデルを保持します。

```text theme={null}
Can't switch to the default model: your organization's managed settings block it (claude-opus-4-6) in "deniedModels", and none of the models they allow can be used as the default instead. Ask your administrator to update "deniedModels" or "availableModels".
```

コロンの後の表現は、切り替えをブロックしたものを示します：

* **`your organization's managed settings block it ... in "deniedModels"`**：管理拒否リストが、Default オプションが解決するモデルをブロックしています
* **`your organization allows only the models listed in "availableModels"`**：[`availableModelsMatch`](https://code.claude.com/docs/ja/settings-reference#availablemodelsmatch) が `"exact"` に設定された管理 [`availableModels`](https://code.claude.com/docs/ja/model-config#restrict-model-selection) 許可リストが、Default オプションが解決するモデルを含んでいません
* **`Claude Code couldn't read your organization's managed settings to check which models they allow`**：[管理設定](https://code.claude.com/docs/ja/managed-settings.md)を読み取ることができず、Claude Code は未確認のまま切り替えを適用するのではなく拒否します

**対応方法：**

* [`deniedModels`](https://code.claude.com/docs/ja/settings-reference#deniedmodels) と `availableModels` の表現については、`/model` を実行して、組織が許可するモデルを名前で選択してください
* メッセージが示す管理設定を更新するよう管理者に依頼してください
* `couldn't read` の表現については、Claude Code を再起動してください。それでも続く場合は、管理者に管理設定を確認するよう依頼してください

代わりに、これらの管理設定の下でセッションが `Claude Code can't start` メッセージで起動に失敗する場合は、[管理設定がデフォルトモデルをブロック](#managed-settings-block-the-default-model)を参照してください。

### Model switch was blocked by a PreModelSwitch hook

[PreModelSwitch フック](https://code.claude.com/docs/ja/hooks.md#premodelswitch)が、ユーザーまたはクライアントが要求したモデルの切り替えを承認しなかったため、セッションは現在のモデルを保持します。切り替えが入力したコマンドではなく、[Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) ホストまたは [Remote Control](https://code.claude.com/docs/ja/remote-control.md) から来た場合、メッセージは `Model switch blocked by a PreModelSwitch hook` と表示され、ターゲットモデルは示されません。

```text theme={null}
Model switch to Opus 4.6 was blocked by a PreModelSwitch hook: Opus 4.6 is retired for this project. Use a newer model.
```

コロンの後の理由は、何が切り替えを拒否したかを示します：

* **フックが書いた理由**：PreModelSwitch フックが [切り替えを拒否したか確認を求めた](https://code.claude.com/docs/ja/hooks.md#premodelswitch-decision-control)際に、その理由を提供しました。求められていることに対応するか、フックが許可するモデルを選択してください。
* **`PreModelSwitch hook <name> did not respond before its timeout`**：[タイムアウト](https://code.claude.com/docs/ja/hooks.md#timeouts)までに応答しないフックは切り替えをブロックします。ハングしているコマンドを修正するか、そのフックの `timeout` を上げてから、再度切り替えてください。
* **`confirmation required, and this session cannot ask`**：フックが理由なしで `ask` と答えましたが、制御リクエストには確認プロンプトを表示する方法がありません。[`-p` 実行](https://code.claude.com/docs/ja/headless)での `/model` コマンドは、同じ状態を理由の後に `(run /model interactively to confirm)` を付けて報告します。対話セッションから切り替えを行うか、このモデルに対するフックの決定を変更してください。
* **`so organization-managed PreModelSwitch hooks could not be checked`**: v2.1.323 より前の Claude Code は、[管理プラグイン](https://code.claude.com/docs/ja/settings-reference.md#enabledplugins)が提供する PreModelSwitch フックを判別できない場合に拒否します。このフレーズの前のテキストには、失敗した内容が示されます。拒否を止めるには、Claude Code をアップデートしてください。失敗したプラグインのフックも実行させるには、プラグインを修正するか管理者に依頼してください。詳細を確認するには、シェルで `claude --debug` を起動してモデルを切り替え、[デバッグログ](https://code.claude.com/docs/ja/hooks.md#debug-hooks)を確認してください。
* **`a PreModelSwitch hook failed before answering`** または **`PreModelSwitch hooks were cancelled (the control stream closed) before answering`**：フックの実行が判定なしで終了し、Claude Code はそれを承認として扱いません。`claude --debug` を実行して失敗したものを確認してから、再度切り替えてください。

v2.1.260 より前では、管理プラグインによる拒否は `plugin hooks could not be loaded, so PreModelSwitch hooks could not be checked; see the debug log` と表示されていました。Claude Code はプラグインの読み込みを 1 回再試行した後、組織が管理プラグインを持っていない場合でも、セッション内のそれ以降の切り替えを拒否していました。これらのバージョンでは、セッションを再起動してプラグインの読み込みを再度実行してください。

### Couldn't save it as your default

デフォルトとして保存するモデルを選択しましたが（たとえば、`/model <name>` または `/model` ピッカーでの `Enter`）、Claude Code は選択をユーザー設定ファイル `~/.claude/settings.json` に書き込むことができませんでした。切り替え自体は適用されたため、現在のセッションは選択したモデルで実行されますが、デフォルトは変更されず、次のセッションは古い値で開始されます。

```text theme={null}
Set model to Fable 5.1 for this session only · couldn't save it as your default: ~/.claude/settings.json can't be written (EROFS)
```

ファイルパスの後の理由は失敗したものを示します：

* **`can't be written (<code>)`**：書き込みが括弧内のオペレーティングシステムエラーコードで失敗しました。たとえば、ファイルまたはそのリンク先のファイルが書き込みを拒否するファイルシステム上にある場合は `EROFS` になります。ファイルを書き込み可能にして再度切り替えてください。別のツールがファイルを生成している場合は、代わりにそのツールで `model` キーを設定してください。[Claude Code で行った変更が新しいセッションで失われる](https://code.claude.com/docs/ja/settings.md#a-change-you-made-in-claude-code-is-lost-in-new-sessions)を参照してください。
* **`isn't valid JSON`**：ディスク上のファイルが解析できず、Claude Code は読み戻せないコンテンツを上書きするのではなく、ファイルをそのままにします。構文エラーを修正してから再度切り替えてください。[壊れた設定ファイルを修正する](https://code.claude.com/docs/ja/settings.md#fix-a-broken-settings-file)を参照してください。

`couldn't confirm it was saved as your default (~/.claude/settings.json is still being written)` で終わる通知は、3 秒経過しても書き込みが完了していないことを意味します。書き込みはバックグラウンドで続行されるため、デフォルトが保存される可能性はあります。次のセッションがどのモデルで開始されるかを確認するか、`/model <name>` を再度実行してください。

v2.1.265 より前では、書き込みが失敗した場合でも、通知はモデルが `saved as your default for new sessions` であると表示していました。

### アドバイザーが現在のメインモデルより能力が低いです

[アドバイザーモデル](https://code.claude.com/docs/ja/advisor.md)がセッションのメインモデルより下位にランク付けされているため、Claude Code は選択を保持しますが、メインモデルのリクエストにアドバイザーを付加しません。

```text theme={null}
Advisor set to Opus 4.8
Note: Opus 4.8 is less capable than the current main model (Sonnet 5.5), so the advisor will not activate. Choose a more capable advisor, or switch to a smaller main model.
```

同じ状態を報告する他のメッセージ：

* 対話セッションでは、`Advisor will not activate on the main model (advisor is less capable); subagents may still use it and may use more tokens · /advisor` という通知が表示されます。
* [非対話モード](https://code.claude.com/docs/ja/headless.md)で `--advisor` フラグを付けて起動し、その実行が[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)でない場合、警告が stderr に出力され、実行はそのまま開始されます。警告は `"<advisor>" cannot advise "<main model>" (the advisor must be at least as capable as the main model). The advisor will not be used for the main model.` です。対話セッションでは、この警告は[デバッグログ](#configuration-warnings)にのみ書き込まれます。

**対応方法：**

* より上位のアドバイザーか、より下位のメインモデルを選択してください。[アドバイザーモデルを選択する](https://code.claude.com/docs/ja/advisor.md#choose-an-advisor-model)では、ランキングと各メインモデルで受け入れられるアドバイザーを一覧で示しています。
* アドバイザーがモデルに助言できる [サブエージェント](https://code.claude.com/docs/ja/sub-agents.md)で引き続き使用したい場合は、アドバイザーを設定したままにしてください

v2.1.287 より前では、Claude Code はいくつかの組み合わせを異なる方法でランク付けしていました。Opus 4.7 または Opus 4.8 のメインモデルに Sonnet 5.5 のアドバイザーを組み合わせた場合にこの注記を表示していましたが、この組み合わせは現在受け入れられます。また、現在この注記が表示される一部のアドバイザー（Sonnet 5.5 のメインモデルに対する Opus 4.8 のアドバイザーなど）を付加していました。

### thinking.type.enabled is not supported for this model

Claude Code のバージョンが選択したモデルの最小バージョンより古いです。CLI は、モデルが受け入れなくなった思考設定を送信しました。

```text theme={null}
API Error: 400 ... "thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior.
```

**対応方法：**

* `claude update` を実行して Claude Code を再起動してください。Opus 4.7 には v2.1.111 以降が必要です。Opus 4.8 には v2.1.154 以降が必要です。Sonnet 5 には v2.1.197 以降が必要です。Opus 5 には v2.1.219 以降が必要です。Opus 5.5 には v2.1.280 以降が必要です。Sonnet 5.5 には v2.1.284 以降が必要です
* [stable リリースチャネル](https://code.claude.com/docs/ja/setup.md#configure-release-channel)では、更新しても最新の stable リリースより先には進まず、そのリリースはこれらのバージョンより古い可能性があります。latest チャネルに移行してから更新してください
* アップグレードできない場合は、`/model` を実行して代わりに Opus 4.6 または Sonnet 4.6 を選択してください
* [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) でこれに遭遇した場合は、代わりに SDK パッケージをアップグレードしてください。Opus 4.8 には TypeScript SDK v0.3.154 以降と Python SDK v0.2.88 以降が必要です。Sonnet 5 には TypeScript SDK v0.3.197 以降が必要です。Opus 5 には TypeScript SDK v0.3.219 以降が必要です。Opus 5.5 には TypeScript SDK v0.3.280 以降が必要です。Sonnet 5.5 には TypeScript SDK v0.3.284 以降が必要です

### Effort isn't available with thinking turned off

[拡張思考](https://code.claude.com/docs/ja/model-config.md#extended-thinking)をオフにして、[effort レベル](https://code.claude.com/docs/ja/model-config.md#adjust-effort-level)を `high` より上にして実行しました。モデルはその組み合わせを受け入れないため、API はリクエストを拒否しました。

```text theme={null}
API Error: Effort 'xhigh' isn't available with thinking turned off on this model · run /effort high to continue, or turn thinking back on (unset MAX_THINKING_TOKENS=0)
```

`·` の後のヒントはセッションによって異なります：非対話セッションでは `use --effort high (or the effortLevel setting)` と表示され、Claude Desktop アプリが実行するセッションでは `you can lower effort to High` と表示されます。

**対応方法：**

* [effort レベルを](https://code.claude.com/docs/ja/model-config.md#set-the-effort-level) `high` 以下に下げてください。
* 思考をオンに戻してください。たとえば、[`MAX_THINKING_TOKENS`](https://code.claude.com/docs/ja/env-vars) を未設定にするか、設定から [`"alwaysThinkingEnabled": false`](https://code.claude.com/docs/ja/settings-reference#alwaysthinkingenabled) を削除してください。

v2.1.242 より前では、Claude Code は API 独自のメッセージを表示していました：`API Error: 400 output_config.effort 'xhigh' is not supported when thinking is disabled on this model. Use effort 'high' or below, or enable thinking.`v2.1.251 より前では、Claude Code は設定された effort レベルでリクエストを送信していたため、思考がオフの場合、Opus 5 は `high` を超えるすべてのリクエストを拒否していました。現在、Claude Code は Opus 5 など、この組み合わせを拒否することがわかっているモデルには代わりに effort `high` を送信します。

### 思考予算が出力制限を超えています

設定された拡張思考の予算が最大応答長を超えているため、実際の回答のためのスペースが残っていません。

```text theme={null}
API Error: 400 ... max_tokens must be greater than thinking.budget_tokens
```

**対応方法：**

* [`CLAUDE_CODE_MAX_OUTPUT_TOKENS`](https://code.claude.com/docs/ja/env-vars) を思考予算より大きくしてください
* 予算が出力長とどのように相互作用するかについては、[拡張思考](https://code.claude.com/docs/ja/model-config.md#extended-thinking)を参照してください

### Response exceeded the output token maximum

Claude の応答が、リクエストで許可された出力トークンの最大数に達し、そこで切り捨てられました。

```text theme={null}
API Error: Claude's response exceeded the ... output token maximum. To configure this behavior, set the CLAUDE_CODE_MAX_OUTPUT_TOKENS environment variable.
API Error: Claude's response exceeded the 64000 output token maximum for a request sent without streaming. The CLAUDE_CODE_MAX_OUTPUT_TOKENS environment variable cannot raise this limit.
```

`a request sent without streaming` を示す形式は、ストリーミングリクエストが失敗し、Claude Code がストリーミングなしで再送信したことを意味します。この場合、応答は 64,000 出力トークンに制限されます。v2.1.299 より前は、このように再送信されたリクエストで応答が切り捨てられると、このメッセージが表示されずにターンが終了し、応答が完了したかのように扱われていました。

**対処方法：**

* 応答が切り捨てられる前に Claude がテキストを書いていた場合は、対話セッションで `continue` と返信して残りを求めます。そのテキストは会話内に残ります。
* メッセージで `CLAUDE_CODE_MAX_OUTPUT_TOKENS` の設定を求められている場合は、値の上限については [`CLAUDE_CODE_MAX_OUTPUT_TOKENS`](https://code.claude.com/docs/ja/env-vars) を、設定場所については[環境変数を設定する](https://code.claude.com/docs/ja/env-vars.md#set-environment-variables)を参照してください
* 各応答を上限内に収めるには、1 回の応答につき 1 つのファイルや 1 つのセクションなど、出力を小さな単位に分けるよう Claude に求めます

### ツール使用または思考ブロックの不一致

会話履歴が矛盾した状態で API に到達しました。

```text theme={null}
API Error: 400 due to tool use concurrency issues. Run /rewind to recover the conversation.
API Error: 400 orphaned tool_result in conversation history. Run /rewind to recover the conversation.
API Error: 400 duplicate tool_use ID in conversation history. Run /rewind to recover the conversation.
API Error: 400 ... unexpected `tool_use_id` found in `tool_result` blocks
API Error: 400 ... thinking blocks ... cannot be modified
```

すべてのバリアントは同じことを意味します：履歴内の `tool_use`、`tool_result`、`thinking` ブロックのシーケンスが、API が期待するものと一致しなくなっています。

**対応方法：**

* Opus 4.7 または Opus 4.8 を使用している場合は、最初に `claude update` を実行してください。v2.1.156 より前のバージョンは、通常のツール使用中にこのエラーをトリガーすることがあり、`/rewind` ではそれを解消できません。
* `/rewind` を実行するか、Esc キーを 2 回押して、破損したターンの前のチェックポイントに戻り、そこから続行してください。チェックポイントがどのように作成および復元されるかについては、[チェックポイント機能](https://code.claude.com/docs/ja/checkpointing.md)を参照してください。

### Invalid data in redacted\_thinking block

会話履歴内の以前のターンに含まれる `redacted_thinking` ブロックを受け入れられなかったため、API は 400 でリクエストを拒否しました。

```text theme={null}
API Error: 400 ... Invalid `data` in `redacted_thinking` block
```

Claude Code は会話の以前の思考をリクエストから除外し、1 回再試行するため、セッションはエラーを表示せずに続行されます。v2.1.282 より前では、Claude Code は拒否されたブロックを保持し、それ以降のすべてのターンが同じエラーで失敗しました。

**対応方法：**

* v2.1.281 以前を使用していて、すべてのターンがこのエラーで失敗する場合は、`claude update` を実行してセッションを再開してください
* エラーが続く場合は、`/clear` を実行してブロックを含まない会話を開始してください

### Unsupported tool content removed

Claude Code が Anthropic API に直接接続し、保存されたセッションを読み込むまたはプレビューする場合、Anthropic API が受け入れないツールコンテンツを削除し、削除されたコンテンツが 2 つの思考ブロックの間にあった場所にこの行を残します：

```text theme={null}
[Unsupported tool content removed]
```

このようなコンテンツは、Anthropic API 以外のものが API の形式で応答した場合にセッションファイルに入り込みます。典型的には、[`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/ja/env-vars) で設定された、別のプロバイダーのツール呼び出しを変換するサードパーティプロキシです。Claude Code はセッションが Anthropic API に直接接続する場合にのみこれを削除し、セッションがプロキシ経由または別のプロバイダーで実行される場合は、保存された履歴をそのまま読み込みます。v2.1.246 より前では、Claude Code はツール使用とその結果を API に送り返し、再開されたセッションのすべてのターンが `messages.1.content.0.server_tool_use.name: Input should be 'web_search', 'web_fetch', ...` などの 400 エラーで失敗しました。

**対応方法：**

* プレースホルダー行が表示される場合は、対応は不要です。セッションは削除されたコンテンツなしで続行されます。
* 代わりに再開されたセッションのすべてのターンが 400 エラーで失敗する場合は、`claude update` を実行してセッションを再度再開してください。v2.1.246 より前のバージョンはコンテンツを削除しません。

### role 'system' must precede an 'assistant' message

システムメッセージが、API が受け入れない会話内の位置にあるため、API は 400 でリクエストを拒否しました：

```text theme={null}
API Error: 400 messages.6: role 'system' must precede an 'assistant' message or end the array; ...
```

Claude Code は、リマインダーや添付ファイルのテキストの一部を会話内のシステムメッセージとして送信します。API がその位置を拒否した場合、Claude Code はそのテキストを代わりに通常のユーザーメッセージとして送信して、リクエストを 1 回再試行します。API の同種の配置に関する表現（`use the top-level 'system' parameter for the initial system prompt` など）にも同じ復旧が適用されます。

それでもエラーが表示される場合、拒否されたシステムメッセージは Claude Code が削除できるものではありません。これは通常、Claude Code と API の間のプロキシまたは [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)が独自のシステムメッセージを追加したことを意味します。

**対応方法：**

* [`ANTHROPIC_BASE_URL`](https://code.claude.com/docs/ja/env-vars) で設定されたプロキシまたはゲートウェイの背後でエラーがすべてのターンで繰り返される場合は、プロキシなしで接続して原因を確認し、その運用者にエラーを報告してください
* `/clear` を実行して新しい会話を開始してください。そこでもエラーが再発する場合、原因は保存された会話ではなく、リクエストの経路にあります。

v2.1.280 より前では、Claude Code はこの表現を認識しなかったため、拒否されたシステムメッセージが Claude Code 自体が送信したものである場合にもエラーが表示され、会話のそれ以降のすべてのターンが同じように失敗しました。

### Invalid encrypted\_content in search\_result block

会話履歴に API が復号化できないホスト型 Web 検索コンテンツが含まれているため、API は 400 でリクエストを拒否しました。表現は読み取れないフィールドを示します：

```text theme={null}
API Error: 400 ... Invalid `encrypted_content` in `search_result` block
API Error: 400 ... Invalid `encrypted_index` in `text` block
API Error: 400 ... Failed to decrypt web search result content
API Error: 400 ... Invalid `encrypted_stdout` in `encrypted_code_execution_result` block
```

API のホスト型 [Web 検索ツール](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)からの結果には、API のみが読み取れる暗号化されたフィールドが含まれています。`encrypted_stdout` の表現は、そのような結果を読み取ったホスト型コード実行プログラムの出力を示しており、API はこれも暗号化します。API は、別の組織向けに生成されたコンテンツなど、復号化できないコンテンツを再送するリクエストを拒否します。

Claude Code 独自の [WebSearch ツール](https://code.claude.com/docs/ja/tools-reference.md#websearch-tool-behavior)は検索結果をプレーンテキストとして記録するため、これらのブロックは通常、ホスト型 Web 検索を自ら実行したプロキシまたは [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)を通じて会話に入り込みます。

3 つの Web 検索の表現については、Claude Code は検索呼び出し、結果、引用を送信内容から除外し、リクエストを 1 回再試行するため、セッションはエラーを表示せずに続行されます。`encrypted_stdout` の表現にはそのような復旧がないため、そのメッセージは引き続き表示されます。v2.1.282 より前では、Claude Code は拒否された Web 検索ブロックも保持し、それ以降のすべてのターンと `/compact` が同じように失敗しました。

**対応方法：**

* v2.1.281 以前を使用していて、すべてのターンが Web 検索の表現のいずれかで失敗する場合は、`claude update` を実行してセッションを再開してください
* エラーが続く場合、またはメッセージが `encrypted_stdout` を示す場合は、`/rewind` を実行してそのコンテンツを追加したターンの前のチェックポイントに戻るか、`/clear` を実行してそれを含まない会話を開始してください
* Claude Code をプロキシまたはゲートウェイの背後で実行している場合は、その運用者にエラーを報告してください

### 使用ポリシーによる拒否

会話内のコンテンツが [使用ポリシー](https://www.anthropic.com/legal/aup)のチェックをトリガーしたため、API は応答を拒否しました。

メッセージに `` Details: `[reasoning_extraction]` `` という行が含まれている場合は、[セーフガードが Claude の推論を求めるリクエストを警告しました](#safeguards-flagged-a-request-for-claudes-reasoning)を参照してください。

メッセージには、拒否が誤りだと思われる場合にサポートに伝えることができるリクエスト ID とメッセージ ID が含まれています。

```text theme={null}
API Error: Opus 4.6 can't help with this. Start a new session to continue.

Send feedback with /feedback or learn more: https://www.anthropic.com/legal/aup
```

メッセージは拒否したモデルを示すか、モデルが記録されていない場合は `Claude` を示します。

チェックは最新のプロンプトだけでなく会話全体を評価するため、同じセッションで新しいメッセージを送信すると、通常、同じ拒否が再度トリガーされます。`--continue` または `--resume` でセッションを終了して再度開いた後も同様です。ディスク上のトランスクリプトにはまだトリガーとなったコンテンツが含まれているためです。[Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md)、[Google Cloud の Agent Platform](https://code.claude.com/docs/ja/google-vertex-ai.md)、[Microsoft Foundry](https://code.claude.com/docs/ja/microsoft-foundry.md) では、このメッセージはモデルの安全対策がサイバーセキュリティのトピックとして警告したリクエストも対象とします。[安全対策がサイバーセキュリティのトピックを警告しました](#safety-measures-flagged-a-cybersecurity-topic)を参照してください。

v2.1.219 より前では、メッセージは `Claude Code is unable to respond to this request, which appears to violate our Usage Policy (https://www.anthropic.com/legal/aup). Please double press esc to edit your last message or start a new session for Claude Code to assist with a different task.` と表示されていました。

**対応方法：**

* Esc キーを 2 回押すか、`/rewind` を実行して、拒否をトリガーしたターンの前のチェックポイントに戻り、言い換えるか別のアプローチを試してください。[チェックポイント機能](https://code.claude.com/docs/ja/checkpointing.md)を参照してください。
* どのターンが原因であるかを特定できない場合は、`/clear` を実行して同じプロジェクトで新しい会話を開始してください。以前の会話はディスクに保持され、`/resume` で引き続き利用できます。
* 巻き戻しが利用できない [非対話モード](https://code.claude.com/docs/ja/headless.md)（`-p`）では、`--continue` なしの新しいセッションで、言い換えたプロンプトで再試行してください。ポリシーチェックはモデルによって異なるため、`--model` で別のモデルに切り替えることで拒否が解消される場合もあります。

### 安全対策がサイバーセキュリティのトピックを警告しました

モデルの安全対策が、会話内のコンテンツをサイバーセキュリティのトピックとして警告しました。メッセージはリクエストを警告したモデルを示します：

```text theme={null}
API Error: Opus 4.8's safeguards flagged this message. Our intentionally broad safeguards allow us to deliver more capabilities faster, but can sometimes flag legitimate cybersecurity work. Send feedback with /feedback or learn more: https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude
```

メッセージに `` Details: `[reasoning_extraction]` `` という行が含まれている場合は、[セーフガードが Claude の推論を求めるリクエストを警告しました](#safeguards-flagged-a-request-for-claudes-reasoning)を参照してください。

このメッセージは、正当なサイバーセキュリティ作業へのアクセスを付与する [Cyber Verification Program](https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude) にリンクしています。[自動モデルフォールバック](https://code.claude.com/docs/ja/model-config.md#automatic-model-fallback)を備えたモデルは、このリンクを含まない別のメッセージを表示します。Opus 5.5 と Sonnet 5.5 では、そのメッセージは `<model>'s safeguards flagged this session` で始まります。Claude Code が代わりにモデルを切り替える場合についても、そのセクションで説明しています。

[Amazon Bedrock](https://code.claude.com/docs/ja/amazon-bedrock.md)、[Google Cloud の Agent Platform](https://code.claude.com/docs/ja/google-vertex-ai.md)、[Microsoft Foundry](https://code.claude.com/docs/ja/microsoft-foundry.md) では、サイバーセキュリティの警告は代わりに [使用ポリシーによる拒否](#usage-policy-refusal)のメッセージになります。

**対応方法：**

* 作業にこのコンテンツが必要な場合は、[Cyber Verification Program](https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude) を通じてアクセスを申請してください
* リクエストがサイバーセキュリティのトピックに関するものではなかった場合は、`/feedback` を実行して誤検知を報告してください
* 同じセッションで作業を続けるには、Esc キーを 2 回押すか、`/rewind` を実行して、警告をトリガーしたターンの前のチェックポイントに戻り、別のアプローチを試してください。[チェックポイント機能](https://code.claude.com/docs/ja/checkpointing.md)を参照してください。

表示されたメッセージが代わりに以下のいずれかの文言である場合は、以前のバージョンの Claude Code における同じ警告です。

* v2.1.219 から v2.1.296 までは、メッセージの最後の文の前に `Apply to the Cyber Verification Program to reduce these interruptions.` が含まれることもありました
* v2.1.203 から v2.1.218 までは、メッセージは `<model> has safety measures that flagged this message for a cybersecurity topic. To learn about the Cyber Verification Program and apply for access, visit our help center:` で、その後に同じヘルプセンターのリンクが続いていました。インタラクティブセッションでは、さらに `If you were not engaging in a cybersecurity topic, please send feedback via /feedback.` が続いていました
* v2.1.203 より前は、メッセージは `<model>'s safeguards flagged this message for a cybersecurity topic. If your work requires this access, you can apply for an exemption:` で、その後に適用除外フォームへのリンクが続いていました

### セーフガードが Claude の推論を求めるリクエストを警告しました

モデルに内部の推論を応答内で再現するよう求めるものとしてセーフガードがリクエストを警告したため、API はリクエストを拒否しました。API はこの [拒否カテゴリ](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#refusal-response)を `reasoning_extraction` と呼び、拒否メッセージには次の行が含まれます：

```text theme={null}
Details: `[reasoning_extraction]`
```

v2.1.234 より前では、拒否メッセージに `Details` 行は含まれていませんでした。

**対応方法：**

* Claude に思考や推論をそのまま、または固定形式で書き出すよう求める指示（`<thinking>` セクション、スクラッチパッドセクション、JSON 出力の `reasoning` フィールドなど）を削除するか、言い換えてください。この指示は、プロンプト内にある場合もあれば、Claude Code がプロンプトとともに読み込むカスタマイズ（CLAUDE.md、スキル、サブエージェントのプロンプト、出力スタイル、MCP ツールの説明など）内にある場合もあります。
* カスタマイズがトリガーかどうかを確認するには、ターミナルで [`claude --safe-mode`](https://code.claude.com/docs/ja/cli-reference#cli-flags) を実行してカスタマイズを無効にしたセッションを開始し、同じプロンプトを送信してください
* カスタマイズを変更した後は、新しいセッションを開始してください
* すでに送信したプロンプトを言い換えるには、[巻き戻しと要約](https://code.claude.com/docs/ja/checkpointing.md#rewind-and-summarize)を参照してください
* Claude に回答の説明を求めることは引き続き可能です。短い説明、結果の根拠、または実行したアクションの要約を求めてください。Claude の思考の要約を読むには、[`showThinkingSummaries`](https://code.claude.com/docs/ja/settings-reference#showthinkingsummaries) を参照してください。
* その他の例や、言い換えたリクエストが引き続き拒否される場合の対応については、[Keep reasoning in thinking blocks](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#keep-reasoning-in-thinking-blocks)を参照してください

### Output blocked by content filtering policy

API の出力コンテンツフィルターが、Claude が生成していた応答を停止しました。メッセージテキストは API から送られます：

```text theme={null}
API Error: Output blocked by content filtering policy
```

**対応方法：**

* 最後のメッセージを言い換えるか、別のアプローチを試してください
* ブロックをトリガーしたターンの前のチェックポイントに戻るには、Esc キーを 2 回押すか、`/rewind` を実行してください。[チェックポイント機能](https://code.claude.com/docs/ja/checkpointing.md)を参照してください

## コマンドラインエラー

これらのエラーは、`claude` コマンドラインとそのサブコマンド、プロンプトで送信したコマンド名、そして `/security-review` のようにプロンプトの実行前にシェルコマンドを実行してコンテキストを収集するコマンドから発生します。CLI を再起動する `/tui` からも発生します。

### `--bg` と `--print` の競合

このメッセージには Claude Code v2.1.198 以降が必要です。同じ `claude` の呼び出しで `--bg` と `-p` または `--print` を組み合わせています。`--bg` は後で `claude agents` でアタッチする[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md#from-your-shell)を開始しますが、`--print` は[非対話モード](https://code.claude.com/docs/ja/headless.md)で実行され、`claude agents` がアタッチする対話セッションを開始しません。v2.1.198 より前は、この組み合わせによって、アタッチできないバックグラウンドジョブが何も通知されずに作成されていました。

```text theme={null}
--bg and --print conflict: --print never starts the interactive session that `claude agents` attaches to, so the job would be unattachable. The prompt is the positional — drop --print: `claude --bg '<task>'`.
```

**対処方法:**

* `-p` または `--print` を外してください。`--bg` はプロンプトを位置引数として受け取るため、`claude --bg "<task>"` で完全なコマンドになります。[シェルから新しいエージェントを Dispatch する](https://code.claude.com/docs/ja/agent-view.md#from-your-shell)を参照してください。
* バックグラウンドセッションを作成せずにプロンプトを非対話モードで実行して結果を出力するには、`--bg` を外して `claude -p "<task>"` を実行してください

### Couldn't tell whether `--bg` is a flag or text

`--bg` または `--background` を、バックグラウンドフラグとして意図したのかテキストとして意図したのかを Claude Code が判断できない位置に付けて `claude` を実行しました。コマンドは何も開始せず、次の行を出力して終了コード 1 で終了しました:

```text theme={null}
Couldn't tell whether --bg is a flag or text here, so nothing was started. To start a background session put it first: claude --bg <prompt>
```

`--background` と入力した場合は、この行には代わりに `--background` が表示されます。

**対処方法:**

* [バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md#from-your-shell)を開始するには、フラグを先頭にしてシェルでコマンドを再実行してください: `claude --bg --name nightly-audit "<task>"`

### システムプロンプトフラグとそのファイル形式の競合

1 回の `claude` の呼び出しで [`--append-subagent-system-prompt`](https://code.claude.com/docs/ja/cli-reference#cli-flags) と `--append-subagent-system-prompt-file` を同時に渡したため、`claude` はセッションを開始せずに終了コード 1 で終了します:

```text theme={null}
Error: Cannot use both --append-subagent-system-prompt and --append-subagent-system-prompt-file. Please use only one.
```

v2.1.283 より前は、`--system-prompt` と `--system-prompt-file`、または `--append-system-prompt` と `--append-system-prompt-file` を同時に渡した場合も、`claude` は同じように終了していました。これらの組み合わせは[結合](https://code.claude.com/docs/ja/cli-reference.md#system-prompt-flags)されずに競合していたためです。これらのバージョンでは、メッセージには組み合わせたフラグの組が表示されます。

**対処方法:**

* フラグの一方の形式だけを残し、もう一方を外してください。固定のプロンプトファイルと実行ごとのテキストを組み合わせるには、両方のフラグを渡すのではなく、起動前にテキストをファイルにマージしてください

### Invalid `--agents` configuration

`--agents` に渡した値が無効なため、`claude` はセッションを開始せずに終了コード 1 で終了します。`--safe-mode` を渡すか [`CLAUDE_CODE_SAFE_MODE`](https://code.claude.com/docs/ja/env-vars#variables) を設定すると、Claude Code は `--agents` を完全に無視します。`--resume` または `--continue` を使用する場合、インライン JSON の値はチェックされずにセッションが開始されますが、ファイルから読み込まれた値は起動のたびにチェックされます。v2.1.242 より前は、Claude Code はそのままセッションを開始していました。

```text theme={null}
Error: Invalid --agents configuration:
<what failed>
```

1 行目に続く内容は、値がどのように失敗したかによって異なります。Claude Code は次のチェックを順に実行し、最初に失敗したチェックで停止します。値に 2 種類の問題がある場合、2 つ目の問題は 1 つ目を修正した後にのみ表示されます:

1. 値が `{` で始まるのに JSON として解析できない場合、または `--agents` ファイルの内容を解析できない場合、Claude Code は JSON パーサー自体のメッセージを含む `invalid JSON:` 行を 1 行出力します
2. 解析はできても、エージェント定義が [CLI で定義するサブエージェント](https://code.claude.com/docs/ja/sub-agents.md#choose-the-subagent-scope)のスキーマと一致しない場合、Claude Code は問題ごとに 1 行を出力します
3. エージェント名が `-` で始まる場合、Claude Code は `<name>: agent names must not start with '-'` を出力します

問題の行が 20 行を超える場合、Claude Code は最初の 20 行を出力し、残りを `…and N more` に置き換えます。

`--print` を使用する場合、`--agents` はインラインオブジェクトの代わりに [JSON ファイルへのパス](https://code.claude.com/docs/ja/sub-agents.md#choose-the-subagent-scope)も受け付けます。v2.1.281 より前は、`--agents` はインライン JSON のみを受け付け、ファイルパスを無効な JSON として扱っていました。ファイル形式には独自の拒否メッセージがあり、このメッセージの代わりに出力されます。たとえば次のものがあります:

* **`Error: --agents takes a JSON object, or a file path only with --print (-p)`**: Claude Code が対話セッションで値をファイルパスとして読み取りました。定義をインライン JSON として渡すか、`-p` を追加してファイルから読み込んでください。
* **`Error: --agents file not found: <path>`**: そのパスにファイルが存在しません。`{` で始まらず有効な JSON でもない値はパスとして読み取られるため、シェルによって崩れたインライン JSON もこのように失敗することがあります。パスまたはクォートを確認して、コマンドを再実行してください。

**対処方法:**

* メッセージに列挙されている各問題を修正してから、コマンドを再実行してください。[CLI で定義するサブエージェントが受け付けるフィールド](https://code.claude.com/docs/ja/sub-agents.md#choose-the-subagent-scope)を参照してください。

### Cloud sessions cannot be created from a `--restricted` session

[`--restricted`](https://code.claude.com/docs/ja/cli-reference#cli-flags) でセッションを開始すると、Claude Code はそのセッションから[クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md#from-terminal-to-cloud)を作成することを拒否します。新しいセッションは制限付きプロセスの外部で実行され、制限モードが適用されないためです。Claude Code はサーバーに接続する前にクライアント側で拒否するため、クラウドセッションは作成されません:

```text theme={null}
Cloud sessions cannot be created from a --restricted session: they would not enforce it.
```

**対処方法:**

* 制限付きセッション内でタスクをローカルに実行してください
* セッションの起動方法を制御できる場合は、`--restricted` を付けずに新しい `claude` セッションを開始し、そこからクラウドセッションを作成してください

v2.1.248 より前の Claude Code には `--restricted` フラグがありません。それ以前のバージョンでは、フラグ自体が不明なオプションのエラーとして拒否されます。

### Cloud sessions are disabled by your organization's policy

組織の `allow_remote_sessions` ポリシーがオフになっているため、[クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md)とそれを使用するコマンドは利用できません:

```text theme={null}
Cloud sessions are disabled by your organization's policy. Contact your organization admin to enable them.
```

このメッセージは、[ターミナルからクラウドセッションを作成する](https://code.claude.com/docs/ja/claude-code-on-the-web.md#from-terminal-to-cloud)とき、および `/teleport`、`/remote-env`、`/web-setup` などのクラウドセッションを必要とするコマンドを送信したときに表示されます。v2.1.268 より前は、これらのコマンドを送信すると代わりに [`Unknown command`](#unknown-command) が返されていました。

メッセージにこのセッションで使用中の認証情報が示され、末尾が `Cloud sessions use your claude.ai login.` になっている場合は、[Cloud sessions use your claude.ai login](#cloud-sessions-use-your-claude-ai-login) を参照してください。Claude Code が組織のポリシーをまったく読み込めなかった場合は、代わりに[別のメッセージ](#couldnt-verify-your-organizations-policy-for-cloud-sessions)が表示されます。

**対処方法:**

* 組織の [Owner](https://code.claude.com/docs/ja/server-managed-settings.md#access-control) に、[claude.ai/admin-settings/claude-code](https://claude.ai/admin-settings/claude-code) の Claude Code 管理設定でクラウドセッションを有効にするよう依頼してください

### Cloud sessions use your claude.ai login

[ポリシーによる拒否](#cloud-sessions-are-disabled-by-your-organizations-policy)のメッセージにこのセッションで使用中の認証情報が示され、末尾がこの文になっている場合、Claude Code はその認証情報を発行した組織のクラウドセッションポリシーをチェックしています。その組織は、claude.ai のログインが属する組織とは異なる場合があります:

```text theme={null}
Cloud sessions are disabled by your organization's policy. This session is using ANTHROPIC_API_KEY, so Claude Code checked the policy for the organization that key belongs to. Cloud sessions use your claude.ai login.
```

最後の文は、クラウドセッションがその認証情報ではなく claude.ai のログインで実行されることを意味します。この形式は、`--cloud` や `--teleport` などを使用してシェルからクラウドセッションを開始、再開、またはメッセージ送信したときに表示されます。v2.1.296 より前は、この場合も組織の管理者に連絡するよう求める形式が出力されていました。

### Couldn't verify your organization's policy for cloud sessions

これらのメッセージは、Claude Code が組織のポリシーを読み込めなかったことを意味します。Claude Code は、[クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md)を作成、再開、またはメッセージ送信する前にこのポリシーをチェックします。ポリシーのリクエストが完了していない間は、次のメッセージが表示されます:

```text theme={null}
Couldn't verify your organization's policy for cloud sessions. Check your network connection and try again.
```

セッション内では、`/teleport` や `/web-setup` などのクラウドセッションを必要とするコマンドでもこのメッセージが表示されます。シェルであれば `Cloud sessions aren't available:` の形式が出力される場合でもこのメッセージになり、その 2 文目は `Check your network connection, then restart Claude Code and try again.` となります。

ポリシーのリクエストが失敗すると、メッセージには何が失敗したかが示されます。これは、`--cloud` や `--teleport` などのフラグを使用してシェルからクラウドセッションを開始、再開、またはメッセージ送信する場合に該当します。API への経路がない場合は、次のように表示されます:

```text theme={null}
Cloud sessions aren't available: couldn't reach api.anthropic.com to load your organization's policy. Check your network or proxy.
```

その他の失敗も同じ書き出しに続けて、HTTP 403 でリクエストを拒否したプロキシ、サーバーエラー、API が受け付けなかった認証情報などの原因が示されます。`ANTHROPIC_API_KEY` 環境変数など、このセッションが claude.ai のログインの代わりに使用している認証情報を API が受け付けなかった場合、メッセージにはその認証情報の名前と、それを解除するよう求める内容が含まれることもあります:

```text theme={null}
Cloud sessions aren't available: api.anthropic.com didn't accept this session's credentials when Claude Code asked for your organization's policy. Cloud sessions use your claude.ai login. ANTHROPIC_API_KEY is set, so this session is using API-key auth — unset it (or run in a shell without it) to use cloud sessions.
```

v2.1.296 より前は、これらの失敗でも `Couldn't verify` メッセージが出力されていました。

**対処方法:**

* `Couldn't verify` メッセージの場合は、ネットワーク接続を確認して再試行してください。セッション内の場合は、先に Claude Code を再起動してください
* `Cloud sessions aren't available:` メッセージの場合は、プロキシの確認や、示されている認証情報の解除など、原因に応じた対処を行ってから、コマンドを再実行してください

### Nothing was stashed because a folder replaced a tracked file

このメッセージは、チェックアウト内で、以前は git で追跡されるファイルまたはリンクがあった場所にフォルダーが置かれていることを意味します。`claude --teleport` や `/teleport` などで[クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md#from-cloud-to-terminal)をターミナルに取り込む際に stash オプションを選択した後に表示されます。その状態を stash するとフォルダー内のファイルが削除される可能性があるため、Claude Code は stash を拒否し、チェックアウトとインデックスを変更しないままにします:

```text wrap theme={null}
Error: Nothing was stashed: "f" is now a folder in place of a tracked file or link, and stashing could delete what's in it for good. Commit the change or move the folder somewhere else, then try again.
```

**対処方法:**

* メッセージのとおり、変更をコミットするかフォルダーを別の場所に移動してから、Teleport を再実行してください

### The `--json-schema` value is not a valid JSON Schema

[非対話モード](https://code.claude.com/docs/ja/headless.md#get-structured-output)で [`--json-schema`](https://code.claude.com/docs/ja/cli-reference#cli-flags) に渡したスキーマが JSON Schema のコンパイルに失敗したため、`claude` はプロンプトを実行せずに終了コード 1 で終了します。v2.1.205 より前は、無効なスキーマはエラーなしで構造化されていない出力を生成し、`format` キーワードを使用するスキーマはすべて無効として扱われていました。

```text theme={null}
Error: --json-schema is not a valid JSON Schema: data/type must be equal to one of the allowed values
```

2 つ目のコロン以降のテキストはバリデーターの診断メッセージで、失敗したキーワードまたは場所を示しています。`"format": "email"` のように `format` キーワードを使用するスキーマは有効です。Claude Code は `format` をアノテーションとして受け付け、強制はしません。

Claude Code はスキーマのコンパイル前に 2 つのチェックを実行します。解析可能な JSON でない値は `Error: --json-schema is not valid JSON` で拒否し、オブジェクトでない有効な JSON は `Error: --json-schema must be a JSON object` で拒否します。

**対処方法:**

* 診断メッセージが示すスキーマの部分を修正してから、コマンドを再実行してください
* 動作するスキーマとコマンドについては、[構造化出力を取得する](https://code.claude.com/docs/ja/headless.md#get-structured-output)を参照してください

### Settings file exceeds the 2MiB limit

[`--settings`](https://code.claude.com/docs/ja/cli-reference#cli-flags) に渡したファイルが 2 MiB を超えているため、`claude` は起動時にファイルを読み込まずに終了コード 1 で終了します。v2.1.214 より前は、Claude Code はサイズをチェックせずにファイルを読み込んでいたため、数ギガバイトのファイルや `/dev/zero` などのデバイスファイルによってメモリが際限なく増加していました。

```text theme={null}
Error: Settings file exceeds the 2MiB limit: /path/to/settings.json
```

Claude Code は、通常のファイルではない `--settings` のパスも同じように拒否します。デバイス、FIFO、ソケットの場合は `Error: Cannot use settings file (Not a regular file (device, FIFO, or socket))` に続いてパスが表示され、ディレクトリの場合は `EISDIR` の理由が表示されます。

**対処方法:**

* `--settings` に 2 MiB 未満の通常の JSON 設定ファイルを指定してください。形式については[設定](https://code.claude.com/docs/ja/settings.md)を参照してください。

### Configuration error in \~/.claude.json

Claude Code は、アカウント情報、MCP サーバー、プロジェクトごとの状態を保持するファイルである `~/.claude.json` を解析できませんでした。`claude -p` のような[非対話モード](https://code.claude.com/docs/ja/headless.md)での起動は、終了コード 1 で終了します。

Claude Code が[バックアップ](https://code.claude.com/docs/ja/claude-directory.md#cleaned-up-automatically)を見つけると、出力にその名前が示され、バックアップを元に戻す `cp` 行が出力されます:

```text wrap theme={null}
Claude configuration file at /home/user/.claude.json is corrupted: <JSON parser's message>
The corrupted file has been backed up to: /home/user/.claude/backups/.claude.json.corrupted.1793664000000
A backup file exists at: /home/user/.claude/backups/.claude.json.backup.1793660400000
You can manually restore it by running: cp -f "/home/user/.claude/backups/.claude.json.backup.1793660400000" "/home/user/.claude.json"

Configuration error in /home/user/.claude.json: <JSON parser's message>
```

**対処方法:**

* **出力に `cp` 行がある場合**: その行をターミナルで実行してください。Windows では PowerShell で実行してください。
* **出力に `cp` 行がない場合、または実行後もエラーが再発する場合**: `~/.claude.json` に設定がまだ残っている場合は、その JSON を修正してください。修正できない場合は、[`~/.claude/backups/`](https://code.claude.com/docs/ja/claude-directory#cleaned-up-automatically) に別の `.claude.json.backup.<timestamp>` ファイルがあればそれで上書きするか、ファイル名を変更してください。`~/.claude.json` にファイルがない場合、Claude Code はデフォルト設定で起動し、ファイルに保持されていた内容は何も引き継がれません。
* **`~/.claude.json` に設定が残っていない場合**: [`~/.claude/backups/`](https://code.claude.com/docs/ja/claude-directory#cleaned-up-automatically) またはホームディレクトリで、設定がまだ残っている `.claude.json.corrupted.<timestamp>` ファイルを探してください。その JSON を修正してから、`~/.claude.json` に上書きコピーしてください。見つからない場合や修正できない場合は、設定が残っている `.claude.json.backup.<timestamp>` ファイルで同じ手順を試してください。いずれにも残っていない場合は、`~/.claude.json` のファイル名を変更し、[`claude mcp add`](https://code.claude.com/docs/ja/mcp#installing-mcp-servers) で MCP サーバーを再度追加してください。

### Claude configuration file was empty and no backup holds anything

起動時のこのメッセージは、示されているファイルが空で、そのファイルの [`.backup` コピー](https://code.claude.com/docs/ja/claude-directory#cleaned-up-automatically)のいずれにも内容がないことを意味します。Claude Code は、そのファイルが保持する内容についてデフォルトで起動しました。`settings.json` ファイルと `.mcp.json` は別のファイルです。

```text wrap theme={null}
Claude configuration file at /home/user/.claude.json was empty and no backup holds anything: starting with defaults.
```

**対処方法:**

* そのファイルで設定していた内容を再設定してください。たとえば、ターミナルから `claude mcp add` で `user` スコープおよび `local` スコープの [MCP サーバー](https://code.claude.com/docs/ja/mcp.md#mcp-installation-scopes)を追加してください。
* Claude Code から求められた場合は、再度サインインしてください

v2.1.318 より前は、バックアップのない空のファイルは[破損](#configuration-error-in-claude-json)として報告されていました。

### The current directory no longer exists

シェルが入った後に削除または移動されたディレクトリ（別のシェルが削除した worktree や一時ディレクトリなど）から `claude` を起動しました。Claude Code は作業ディレクトリを読み取れないため、対話モードと[非対話モード](https://code.claude.com/docs/ja/headless.md)のどちらでも、セッションを開始する前に終了コード 1 で終了します。v2.1.239 より前は、このメッセージの代わりに、Claude Code はミニファイされたバンドルソースと生の `ENOENT ... uv_cwd` スタックを stderr に出力してクラッシュしていました。

```text theme={null}
The current directory no longer exists (it was deleted or moved). Start Claude Code from an existing directory.
error: The current working directory was deleted, so that command didn't work. Please cd into a different directory and try again.
```

原因と対処方法はどちらの形式でも同じです。

権限の変更など、別の理由で Claude Code が作業ディレクトリを読み取れない場合は、代わりにエラーコードがメッセージに示されます: `Can't read the current directory (EACCES). Start Claude Code from a different directory.`

macOS で、`~/Desktop`、`~/Documents`、`~/Downloads`、または iCloud Drive 内のディレクトリに対して `EPERM` が表示される場合、通常は macOS がターミナルアプリによるそのフォルダーへのアクセスをブロックしていることを意味します。そのフォルダーを読み取る他のコマンドも同様に失敗します。そこでの `ls` は、`sudo` を付けても `Operation not permitted` を報告します。

**対処方法:**

* ホームディレクトリやプロジェクトディレクトリなど、存在するディレクトリに移動してから、`claude` を再実行してください
* ディレクトリが同じパスに再作成された場合、シェルは削除されたディレクトリをまだ保持しています。`cd "$PWD"` を実行するか、ディレクトリから出て入り直してから、`claude` を再実行してください
* macOS で `EPERM` が表示される場合は、Cmd+Q でターミナルアプリを終了して再度開き、そのフォルダーに戻って `claude` を実行してください。そのフォルダーで `ls` がまだ失敗する場合は、**システム設定 > プライバシーとセキュリティ > ファイルとフォルダ** を開き、ターミナルアプリに対してそのフォルダーをオンにしてから、ターミナルを開き直してください

### 一時ディレクトリが拒否された、または作成できない

macOS と Linux では、Claude Code は起動時に、システムの一時ディレクトリまたは [`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/ja/env-vars) による上書き先の下に、専用の一時ディレクトリ `claude-<uid>` を作成します。ディレクトリを作成できない場合、またはそのパスに既に存在するエントリが安全性チェックに失敗した場合、Claude Code はセッションを開始せずに失敗内容を stderr に出力し、終了コード 1 で終了します:

```text wrap theme={null}
Claude Code's temporary directory /tmp/claude-501 could not be created: the volume holding /tmp is full (ENOSPC). Free space on that volume, or set CLAUDE_CODE_TMPDIR to a directory on another one, then try again.

Temp directory /tmp/claude-501 is not a directory (may be an attacker-planted symlink). Refusing to use it. Set CLAUDE_CODE_TMPDIR to a directory you control, or ask an administrator to remove it.

Temp directory /tmp/claude-501 is owned by uid 502, expected 501. Refusing to use it — another user may have pre-created it. Set CLAUDE_CODE_TMPDIR to a directory you control, or ask an administrator to remove it.

Temp directory /tmp/claude-501 is not readable (its mode may have been altered, or a path component denies search). Refusing to use it — restore its permissions (chmod 0700) or remove it. Set CLAUDE_CODE_TMPDIR to a directory you control, or ask an administrator to remove it.
```

**対処方法:**

* `could not be created` に続いて `is full (ENOSPC)` が表示される場合は、メッセージに示されているボリュームのディスク容量を空けてください。代わりに `your disk quota on the volume holding /tmp is used up (EDQUOT)` と表示される場合は、そのボリューム上にある不要になった自分のファイルを削除してください
* `Refusing to use it` の形式の場合は、リンク先ではなく示されているエントリ自体を削除してから、Claude Code を再起動してください。`owned by uid` の形式の場合、削除できるのは管理者またはそのユーザーのみです
* `is not readable` の場合は、示されているディレクトリに対して `chmod 0700` を実行するか、ディレクトリを削除してから再起動してください
* いずれの場合も、[`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/ja/env-vars) を自分が管理するディレクトリに設定して Claude Code を再起動し、拒否されたパスはそのままにしておくこともできます

v2.1.309 より前は、ボリュームがいっぱいの場合やクォータを使い切った場合、Claude Code はオペレーティングシステムのエラーテキストのみを出力していました。たとえば `ENOSPC: no space left on device, mkdir '/tmp/claude-501'` のようなもので、同じ手順で対処できます。

### Claude Code could not save because the disk is full

[`claude -p`](https://code.claude.com/docs/ja/headless) の実行後に stderr に出力されるこの行は、ディスクがいっぱいであるか、ディスククォータを使い切ったため、Claude Code が実行内容をすべて保存できなかったことを意味します:

```text wrap theme={null}
Error: Claude Code could not save all of this session's transcript under /Users/you/.claude because the disk is full (ENOSPC). If you resume this session, part of the conversation may be missing. Free up space on that disk before the next run.
```

出力形式が text または `json` の場合、またはメッセージに `output sent to a file` と示されている場合、実行は終了コード 1 で終了します。その他の `stream-json` の実行は通常の終了コードのままです。

**対処方法:**

* **`the disk is full (ENOSPC)`**：次の実行の前に、出力ファイルまたはメッセージ内のパスがあるディスクの空き容量を確保します
* **`your disk quota is used up (EDQUOT)`**: 次回の実行前に、容量を空けるか、より大きなクォータを依頼してください

### Directory couldn't be resolved to a real location

作業ディレクトリのサブディレクトリに対して `/add-dir` を実行しましたが、Claude Code はそのディレクトリを実際の場所に解決できませんでした。

作業ディレクトリのサブディレクトリには既にファイルアクセス権があるため、`/add-dir` はそのスキル、コマンド、エージェントを読み込むだけです。読み込む前に、Claude Code はシンボリックリンクを解決したディレクトリの実際の場所が作業ディレクトリ内にあることを確認します。その場所を解決できない場合、Claude Code は何も読み込まず、次のメッセージを表示します:

```text theme={null}
packages/app couldn't be resolved to a real location, so its skills, commands, and agents weren't loaded. Check that it is a directory inside the working directory and try again.
```

**対処方法:**

* パスが作業ディレクトリ内の実在するディレクトリを示していることを確認してから、`/add-dir` を再実行してください
* このメッセージはファイルアクセスを変更しません。ディレクトリの `.claude/` の内容が読み込まれなかったことを報告するだけです

v2.1.261 より前は、作業ディレクトリが `/net/<host>` の自動マウント上にある場合にも、すべての `/add-dir <subdirectory>` でこのメッセージが表示されていました。そこでは Claude Code が設計上パスの解決を行わないため、ディレクトリに問題はなく、再試行しても解決しませんでした。

### Remote Control 起動時の Workspace not trusted

> [!NOTE]
>
> `claude ultrareview` が `Error: Workspace not trusted` を出力した場合は、代わりに [claude ultrareview 実行時の Workspace not trusted](#workspace-not-trusted-when-running-claude-ultrareview) を参照してください。

信頼していないディレクトリで `claude remote-control` またはそのエイリアス `claude rc` を使用して [Remote Control](https://code.claude.com/docs/ja/remote-control.md) のサーバーモードを開始しましたが、コマンドはそのディレクトリを信頼するかどうかを確認できませんでした。たとえば、コマンドの標準入力または標準出力がリダイレクトまたはパイプされているために、ターミナルではない場合です。コマンドは終了コード 1 で終了します:

```text theme={null}
Error: Workspace not trusted. Please run `claude` in /Users/you/project first to review and accept the workspace trust dialog.
```

同じく `Error: Workspace not trusted.` で始まる 2 つのバリエーションは、ディレクトリを信頼すると有効になる内容を表示するにはターミナルが小さすぎる場合や、ターミナルがサイズを報告しなかった場合に表示されます。ウィンドウを大きくするか通常のターミナルウィンドウに切り替えてから、`claude rc` を再実行してください。

ホームディレクトリではメッセージが異なります。ワークスペースの信頼ダイアログはホームディレクトリの信頼を保存しないため、そこで承認してもこのチェックを満たせないからです。v2.1.214 より前は、ホームディレクトリでも上記のメッセージが表示されていましたが、その助言はそこでは成功しません。

```text theme={null}
Error: Workspace not trusted. /Users/you is your home directory, and for security home-directory trust is never saved, so running `claude` here first won't help. Run `claude rc` from a project directory instead (run `claude` there once to accept the trust dialog).
```

[`Trust <directory>?` の質問](https://code.claude.com/docs/ja/remote-control#requirements)に `n` と答えるか Enter を押すと、コマンドはディレクトリを示す `Remote Control did not start` メッセージを出力し、終了コード 1 で終了します。`claude rc` を再実行して `y` と答えてください。

**対処方法:**

* まずターミナルからディレクトリを信頼します。そこで `claude` を実行して[ワークスペース信頼ダイアログ](https://code.claude.com/docs/ja/permissions.md#project-allow-rules-and-workspace-trust)を承認してから、元のコマンドを再実行します
* ホームディレクトリにいる場合は、プロジェクトディレクトリに移動してそこで Remote Control を開始してください

v2.1.284 より前は、ターミナル内であってもコマンドは確認を行いませんでした。

### claude ultrareview 実行時の Workspace not trusted

信頼していないフォルダーで、[`claude ultrareview`](https://code.claude.com/docs/ja/ultrareview#trust-the-folder-before-the-review-runs) がそのフォルダーを信頼するかどうかを確認できない場合、レビューが開始される前に実行は終了コード 1 で終了します:

```text theme={null}
Error: Workspace not trusted. Please run `claude` in /Users/you/project first to review and accept the workspace trust dialog. Or, in a script or CI job, pass `--trust-workspace` to trust the folder for this run only.
```

たとえば、標準入力または標準出力がターミナルではない場合、サブコマンドは確認できません。`claude ultrareview --json > findings.json` のように出力をファイルに送ると、標準出力はターミナルではなくなります。

**対処方法:**

* スクリプトや CI ジョブでは、`--trust-workspace` を末尾に付けて、その実行に限りフォルダーを信頼してください: `claude ultrareview --trust-workspace`。git と Claude Code がフォルダーの git 設定やプロジェクト設定に記載されたプログラムを実行できるようになるため、信頼できるコードに対してのみ付けてください。コードを信頼できないプルリクエストについては、[信頼できるブランチからレビューを実行](https://code.claude.com/docs/ja/ultrareview.md#trust-the-folder-before-the-review-runs)してください。
* 自分のマシンでは、そのフォルダーで `claude` を実行して[ワークスペースの信頼ダイアログ](https://code.claude.com/docs/ja/permissions.md#project-allow-rules-and-workspace-trust)を承認してから、元のコマンドを再実行してください

セッション内では、`/ultrareview` と `/code-review ultra` が `Ultrareview did not start: "<folder>" is not trusted, and this session started without asking whether you trust it` で停止することがあります。[`IS_DEMO`](https://code.claude.com/docs/ja/env-vars#variables) を設定せずにそのフォルダーで `claude` を起動し、ワークスペース信頼ダイアログを承認してから、新しいセッションでコマンドを実行してください。

`claude ultrareview` からの次の各メッセージは、レビューが開始されず、終了コードが 1 であることを意味します:

* **`Error: Workspace not trusted. This terminal ...`**: ターミナルが行数と列数を報告しなかったか、信頼の質問とその警告を表示しきれません。ターミナルを大きくするか、サイズを報告するターミナルを使用してから、`claude ultrareview` を再実行してください。ホームディレクトリ以外では、そのフォルダーで一度 `claude` を実行して信頼ダイアログを承認しておくと、以降の実行では確認されなくなります。
* **`Error: Workspace not trusted. <folder> is your home directory`**: ホームディレクトリの信頼は保存されないため、先にそこで `claude` を実行しても解決しません。代わりにプロジェクトディレクトリで一度 `claude` を実行して信頼ダイアログを承認した後、そこから `claude ultrareview` を実行するか、`--trust-workspace` を末尾に付けてください。
* **`No answer in time.` に続いて `Error: Workspace not trusted`**: `Trust <folder>? [y/N]` の質問に 5 分間回答がありませんでした。`claude ultrareview` を再実行して回答してください。
* **`Ultrareview did not start: <folder> is not trusted`**: `Trust <folder>? [y/N]` の質問で、たとえば `n` と答えるか Enter を押して拒否しました。レビューを開始するには、`claude ultrareview` を再実行して `y` と答えてください。
* **``Ultrareview did not start: `--trust-workspace` takes no value``**: `--trust-workspace` の後に、PR 番号や `false` など、フラグ以外のものが続いています。フォルダーを信頼しない場合は、フラグを付けないでください。この実行に限り信頼する場合は、PR 番号またはベースブランチをフラグの前に置いてください: `claude ultrareview 1234 --trust-workspace`。

v2.1.309 より前は、`claude ultrareview` は `--trust-workspace` を受け付けませんでした。

### 質問に回答がなかったため Remote Control が開始されなかった

このメッセージは、[`claude remote-control`](https://code.claude.com/docs/ja/remote-control) がメッセージ内で引用されている初回実行時の質問を行い、回答が得られなかったことを意味します:

```text theme={null}
Remote Control did not start: "Enable Remote Control?" got no answer. Run `claude remote-control` at a terminal and answer y once; it won't ask again.
Remote Control did not start: "Choose [1/2] (default: 1):" got no answer. You can run `claude remote-control` and choose, or pass --spawn=same-dir or --spawn=worktree.
```

**対処方法:**

* **`Enable Remote Control?`**: スクリプトやサービスでは、誰かが回答する前に標準入力が終了します。スクリプトやサービスを実行するユーザーとして、ターミナルで一度 `claude remote-control` を実行し、`y` と答えてください。
* **`Choose [1/2] (default: 1):`**: `claude remote-control` を再実行して[スポーンモードを選択](https://code.claude.com/docs/ja/remote-control.md#set-the-default-spawn-mode-for-a-project)するか、[`--spawn=same-dir` または `--spawn=worktree`](https://code.claude.com/docs/ja/remote-control#start-a-remote-control-session) を渡して質問をスキップしてください

### Not carried over to the sessions Remote Control starts

`remote-control` 動詞の前に、Remote Control が開始するセッションを制限または設定するグローバルな `claude` フラグ（`--settings`、`--setting-sources`、`--permission-mode`、`--disallowed-tools`、`--mcp-config` など）を付けて [Remote Control](https://code.claude.com/docs/ja/remote-control.md) を開始しました。動詞の前に置いたフラグは、それらのセッションには届きません。そのため Claude Code は開始を拒否し、そのフラグを示します:

```text theme={null}
Error: `--settings` before `remote-control` is not carried over to the sessions Remote Control starts, so Remote Control refuses to start rather than drop it — remove it, and give Remote Control's own options after the verb (see `claude remote-control --help`). Pass settings with `claude remote-control --settings <file>`.
```

`--verbose`、`--model`、またはラッパーが挿入する `--session-id` や `--plugin-dir` など、破棄しても問題のないグローバルフラグは拒否されません。Claude Code はそれらを無視し、Remote Control は開始されます。

Claude Code は、破棄しても問題ないとまだ認識していないグローバルフラグに対しても開始を拒否します。そのため、新しいリリースで追加されたフラグは、後のリリースで問題ないとマークされるまでこのメッセージに表示されることがあります。

**対処方法:**

* 動詞の前からフラグを削除し、[Remote Control 独自のオプション](https://code.claude.com/docs/ja/remote-control.md#start-a-remote-control-session)を動詞の後に渡してください。`claude remote-control --help` でそれらのオプションを確認できます
* 拒否されたフラグが `--permission-mode` の場合は、`claude remote-control --permission-mode <mode>` を実行して、Remote Control が開始するセッションの権限モードを設定してください

v2.1.248 より前は、グローバルフラグが先にあると `claude remote-control` は独自のフラグを受け付けず、コマンドは `unknown option` エラーで失敗していました。

### `--settings` ファイルが原因で Remote Control が開始されなかった

[`claude remote-control --settings`](https://code.claude.com/docs/ja/remote-control#start-a-remote-control-session) に渡したファイルに問題があります:

```text theme={null}
Error: Remote Control did not start, because sessions would skip part or all of the --settings file ./rc-settings.json: Invalid or malformed JSON
```

**対処方法:**

* メッセージが示す問題を修正してから、`claude remote-control` コマンドを再実行してください

### The settings file has changed since Remote Control started

`claude remote-control` を実行しているターミナルでのこのメッセージは、[`--settings`](https://code.claude.com/docs/ja/remote-control#start-a-remote-control-session) に渡したファイルの現在の内容ではセッションが開始されないことを意味します:

```text theme={null}
Session failed: Error: The settings file /path/to/settings.json has changed since Remote Control started, so this session did not start. Restart `claude remote-control` to use it as it is now.
```

**対処方法:**

* ファイルを現在の内容で使用するには、`claude remote-control` を停止して同じコマンドを再実行してください。提供していたセッションを戻すには、[サーバー停止後にセッションを再開する](https://code.claude.com/docs/ja/remote-control.md#resume-sessions-after-stopping-the-server)を参照してください。
* Remote Control の開始時の設定を維持するには、ファイルの内容を元に戻し、`claude remote-control` が終了している場合はコマンドを再実行してください

### `--sandbox` or `--no-sandbox` is not supported by claude remote-control

このエラーは、[Remote Control](https://code.claude.com/docs/ja/remote-control.md) サーバーを開始するコマンドが `remote-control` の後に `--sandbox` または `--no-sandbox` を渡しており、`claude remote-control` がどちらのフラグも受け付けないことを意味します。サーバーは開始されずに終了コード 1 で終了します:

```text theme={null}
Error: --sandbox is not supported by claude remote-control. The flag had no effect and was removed. To sandbox sessions, set sandbox.enabled to true in settings.
Error: --no-sandbox is not supported by claude remote-control. The flag had no effect and was removed. Remove it from the command.
```

**対処方法:**

* サーバーを自動で開始するスクリプトやサービス定義を含め、コマンドからフラグを削除してから再実行してください
* サーバーが開始するセッションをサンドボックス化するには、[設定ファイル](https://code.claude.com/docs/ja/settings.md#where-settings-live)で [`sandbox.enabled`](https://code.claude.com/docs/ja/settings-reference#sandbox-enabled) を `true` に設定して、[サンドボックス化](https://code.claude.com/docs/ja/sandboxing.md)をオンにしてください

両方のフラグは v2.1.300 で `claude remote-control` から削除されたため、以前のバージョン向けに書かれたコマンドにはまだいずれかが含まれている場合があります。

### claude import is not yet available in this build

[`claude import`](https://code.claude.com/docs/ja/cli-reference#cli-commands) を実行しましたが、Claude Code はインポートフローがオフになっていることを検出したため、コマンドはインポートを開始せずに終了コード 1 で終了します。v2.1.222 より前は、インポートフローがオフのビルドでは `import` をプロンプトとして扱い、このメッセージを出力する代わりに対話セッションを開始していました。

```text theme={null}
`claude import` is not yet available in this build. Run `claude` and use /mcp or edit ~/.claude/settings.json directly.
```

Claude Code は、Anthropic から取得してディスクにキャッシュする機能フラグによって `claude import` をオンにします。このメッセージは、キャッシュされた値がオフであることを意味します。原因は通常、次のいずれかです:

* インストール後にセッションを開始していないため、Claude Code がまだフラグを取得していません。最初の `claude import` では、機能が利用可能な場合でもこのメッセージが出力されることがあります。
* Amazon Bedrock、Google Cloud の Agent Platform、Microsoft Foundry、Claude Platform on AWS、または [Claude apps gateway](https://code.claude.com/docs/ja/claude-apps-gateway#availability-and-limitations) を通じて Claude Code を使用しています。これらのセッションでは Claude Code は機能フラグを取得しないため、`claude import` は利用できないままです。
* 機能フラグの取得をオフにする `DISABLE_TELEMETRY`、`DO_NOT_TRACK`、[`CLAUDE_CODE_DISABLE_FEATURE_FLAGS`](https://code.claude.com/docs/ja/env-vars#variables)、`DISABLE_GROWTHBOOK`、または [`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC`](https://code.claude.com/docs/ja/env-vars) を設定しているため、`claude import` は利用できないままです。

**対処方法:**

* 新規インストールの場合は、`claude` を起動し、セッションの読み込みを待ってから終了し、`claude import` を再実行してください
* 機能フラグの取得がオフのままの環境では、設定を自分で行ってください。[`claude mcp add`](https://code.claude.com/docs/ja/mcp#installing-mcp-servers) で MCP サーバーを追加し、引き継ぎたい [`CLAUDE.md` ファイル](https://code.claude.com/docs/ja/memory#how-claude-md-files-load)、[スキルとコマンド](https://code.claude.com/docs/ja/skills.md#where-skills-live)、[サブエージェント](https://code.claude.com/docs/ja/sub-agents.md#choose-the-subagent-scope)を作成してください。メッセージには `~/.claude/settings.json` も示されていますが、`claude import` が引き継ぐ設定のうち、このファイルが保持するのは[権限モード](https://code.claude.com/docs/ja/settings-reference.md#permission-settings)のみです。Claude Code はこのファイルから MCP サーバーを読み込みません。

### Could not read Claude Code config

Claude Code がアカウント情報とプロジェクトごとの状態を保存するファイルである `~/.claude.json` を解析できない状態で、[`claude import`](https://code.claude.com/docs/ja/cli-reference#cli-commands) を実行しました。このサブコマンドは利用可否を確認するためにそのファイルを読み込みますが、対話セッションが表示する復旧ダイアログは表示しないため、終了コード 1 で終了します。v2.1.222 より前は、設定ファイルを読み取れない状態で `claude import` を実行すると対話セッションが開始され、その復旧ダイアログがファイルを処理していました。

```text theme={null}
Could not read Claude Code config — run `claude` with no arguments to recover it.
```

**対処方法:**

* 引数なしで `claude` を実行してください。Claude Code は無効なファイルを検出し、リセットを提案します。その後、`claude import` を再実行してください。
* 手動で行った編集を残したい場合は、代わりにエディターで `~/.claude.json` の JSON 構文を修正してから、`claude import` を再実行してください

### Could not import a server from Claude Desktop

Claude Code は、`claude mcp add-from-claude-desktop` で選択したサーバーの 1 つを追加できませんでした。コマンドは選択した他のサーバーのインポートを続行し、追加できなかったサーバーごとに 1 行を出力します。v2.1.205 より前は、最初に失敗したサーバーでインポートが停止していました。

```text theme={null}
Could not import my server: Invalid name my server. Names can only contain letters, numbers, hyphens, and underscores.
```

サーバー名の後のテキストが理由です。最も一般的なのは名前のチェックです。Claude Desktop ではサーバー名にスペースやピリオドなどの文字を使用できますが、`claude mcp` では英字、数字、ハイフン、アンダースコアに制限されます。その他の理由には、検証に失敗するサーバー設定や、組織の [MCP ポリシー](https://code.claude.com/docs/ja/managed-mcp.md)によってブロックされたサーバーがあります。

**対処方法:**

* `claude_desktop_config.json` 内のサーバー名を、英字、数字、ハイフン、アンダースコアのみを使用するように変更してから、`claude mcp add-from-claude-desktop` を再実行してください
* `claude mcp add` または `claude mcp add-json` で、有効な名前を付けてそのサーバーを直接追加してください。[Claude Desktop から MCP サーバーをインポートする](https://code.claude.com/docs/ja/mcp.md#import-mcp-servers-from-claude-desktop)を参照してください。

### Cannot add MCP server to the managed scope

`--scope managed` を付けて `claude mcp add` または `claude mcp add-json` を実行しました。このスコープには、組織が [`managedMcpServers`](https://code.claude.com/docs/ja/settings-reference#managedmcpservers) 管理設定を通じて提供するサーバーが含まれます。Claude Code はそれらを管理設定からのみ読み込むため、コマンドはそのスコープにサーバーを書き込めません。

```text theme={null}
Cannot add MCP server to scope: managed
```

**対処方法:**

* 書き込み可能なスコープ（`local`、`user`、または `project`）にサーバーを追加してください。`--scope` を指定しない場合、コマンドは `local` を使用します。[MCP のインストールスコープ](https://code.claude.com/docs/ja/mcp.md#mcp-installation-scopes)を参照してください
* 組織内のすべてのユーザーにサーバーを提供するには、デプロイする管理設定の [`managedMcpServers`](https://code.claude.com/docs/ja/settings-reference#managedmcpservers) にサーバーを追加してください

### 管理設定でプラグインのサーバーのみが許可されている場合に MCP サーバーを追加できない

組織の管理設定で [`strictPluginOnlyCustomization`](https://code.claude.com/docs/ja/settings-reference#strictpluginonlycustomization) が `true` または `mcp` を含むリストに設定されている状態で、`claude mcp add` または `claude mcp add-json` を実行しました。この設定では、Claude Code は `~/.claude.json` や `.mcp.json` から MCP サーバーを読み込まないため、コマンドは読み込まれることのないサーバーを保存せずに終了コード 1 で終了します:

```text theme={null}
Cannot add MCP server: your organization's managed settings allow only MCP servers that plugins provide. Install a plugin that provides this server, or ask your administrator to make it available.
```

`claude mcp add-from-claude-desktop` は、選択した各サーバーをインポートされなかったものとして報告し、このメッセージを理由として示します。[`/import`](https://code.claude.com/docs/ja/commands#all-commands) は追加しようとした各 MCP サーバーについてこのメッセージを報告しますが、見つかった他の項目はインポートします。

v2.1.284 より前は、これらのコマンドはサーバーを保存して成功を報告していましたが、サーバーが読み込まれることはありませんでした。

**対処方法:**

* サーバーを提供する[プラグイン](https://code.claude.com/docs/ja/plugins/install.md)をインストールしてください
* 管理者に、サーバーを[プラグイン](https://code.claude.com/docs/ja/plugins/org.md)で配布するか、リモートの HTTP または SSE サーバーであれば [`managedMcpServers`](https://code.claude.com/docs/ja/settings-reference#managedmcpservers) を通じて提供するよう依頼してください

### Can't read .mcp.json

`--scope project` を付けた `claude mcp add` や `claude mcp add-json`、または `claude mcp remove` など、プロジェクトの [`.mcp.json`](https://code.claude.com/docs/ja/mcp#project-scope) を読み込むコマンドが、現在のディレクトリにあるファイルが通常のファイルではないか 2 MiB を超えていることを検出したため、ファイルを読み込まずにこのエラーで終了します。

```text theme={null}
Can't read .mcp.json: it isn't a regular file or is larger than 2097152 bytes. Fix or remove it, then run the command again.
```

v2.1.257 より前は、`.mcp.json` が FIFO の場合、コマンドは出力なしで永久に待機し、`/dev/zero` などのデバイスファイルへのシンボリックリンクの場合は、プロセスが強制終了されるまでメモリが増加し続けていました。

**対処方法:**

* 現在のディレクトリの `.mcp.json` に何があるかを確認してください。[プロジェクトスコープの形式](https://code.claude.com/docs/ja/mcp.md#project-scope)の通常の JSON ファイルに置き換えるか削除してから、コマンドを再実行してください。

### MCP サーバーが保存または削除されなかった

このエラーは、`claude mcp add` や `claude mcp remove` などのコマンドが `~/.claude.json` に変更を反映できなかったことを意味します。他の Claude Code プロセスがファイルをロックしたままにしていたか、ファイルが読み取り専用であるかサンドボックスによって保護されている可能性があります。

```text theme={null}
MCP server "example" was not saved to /home/user/.claude.json. If other Claude Code processes use that file, they may have kept it locked: add the server again, with CLAUDE_CODE_CONFIG_LOCK_WAIT_MS=60000 set to wait up to a minute. If that file is read-only or protected by a sandbox, make it writable or run the command outside the sandbox first.
```

削除の後では、メッセージは `was not saved to` の代わりに `was not removed from`、`add the server again` の代わりに `remove the server again` となります。`local` スコープのサーバーの場合、パスの後に、エントリが属するプロジェクトディレクトリが `(local scope for /path/to/project)` として続きます。

**対処方法:**

* **他の Claude Code プロセスが実行中の場合**: コマンドはファイルのロックを約 10～20 秒待機した後、書き込まずに中止します。[`CLAUDE_CODE_CONFIG_LOCK_WAIT_MS`](https://code.claude.com/docs/ja/env-vars#variables) を `60000` など、より長い待機時間（ミリ秒）に設定して、同じコマンドを再実行してください。
* **ファイルが読み取り専用またはサンドボックスで保護されている場合**: メッセージが示すファイルを書き込み可能にしてから同じ追加または削除コマンドを再実行するか、そのコマンドをサンドボックスの外で実行してください。

v2.1.283 より前は、`claude mcp add`、`claude mcp add-json`、`claude mcp remove` は、変更がファイルに反映されなかった場合でも成功を報告していました。v2.1.318 より前は、メッセージにロックについての記載がなく、Claude Code は [`CLAUDE_CODE_CONFIG_LOCK_WAIT_MS`](https://code.claude.com/docs/ja/env-vars#variables) を読み取っていませんでした。

### MCP サーバーが保存または削除されていない可能性がある

`user` または `local` [スコープ](https://code.claude.com/docs/ja/mcp.md#mcp-installation-scopes)のサーバーに対して `claude mcp add`、`claude mcp add-json`、または `claude mcp remove` を実行しましたが、Claude Code は変更を確認するために `~/.claude.json` を読み戻すことができませんでした。変更はディスクに反映されている場合もあれば、されていない場合もあります。`to confirm the change` の後の括弧内に理由が示されます。

```text theme={null}
MCP server "example" may not have been saved: /home/user/.claude.json could not be read to confirm the change (EACCES: permission denied, open '/home/user/.claude.json'). Run `claude mcp get example` to check, then add the server again if it is missing.
```

削除の後では、メッセージは `may not have been removed` となり、末尾が `then remove the server again if it is still listed` となります。理由が `the file was not found` の場合、サーバーはまだ設定されている可能性があります。

v2.1.283 より前は、変更を確認できなかった場合でもコマンドは成功を報告していました。

**対処方法:**

* `claude mcp get <name>` を実行して、変更がディスクに反映されているかを確認してください。`local` スコープのサーバーの場合、ローカルスコープはプロジェクトごとであるため、サーバーが属するプロジェクトディレクトリから実行してください。
* 追加後にサーバーが見つからない場合、または削除後もまだ表示される場合は、同じ追加または削除コマンドを再実行してください。

### Server is Anthropic-hosted and doesn't support local OAuth

サードパーティの ID プロバイダーを通じて認証する、Anthropic がホストするコネクタのホストを URL が指している MCP サーバーに対してサインインを開始しました。これらのホストには、`microsoft365.mcp.claude.com`、`gmail.mcp.claude.com`、`gcal.mcp.claude.com` があります。[これらのサインインは claude.ai を通じてのみ機能する](https://code.claude.com/docs/ja/mcp.md#use-mcp-servers-from-claude-ai)ため、Claude Code は `/mcp` パネルと `claude mcp login` のどちらからも、これらのホストに対するローカルの OAuth フローの開始を拒否します。

```text theme={null}
"gmail" is Anthropic-hosted and doesn't support local OAuth. Connect it via Settings → Connectors on claude.ai (requires `claude login`), then it'll be available here automatically.
```

**対処方法:**

* 同じ URL の claude.ai コネクタを隠してしまわないように、`claude mcp remove <name>` で自分のエントリを削除してください
* 削除した後、Claude Code で使用しているアカウントでサインインした状態で、[claude.ai/customize/connectors](https://claude.ai/customize/connectors) でサービスを接続してください。接続されると、アクティブな認証方法が claude.ai サブスクリプションのログインであれば、[コネクタは Claude Code に自動的に表示されます](https://code.claude.com/docs/ja/mcp.md#use-mcp-servers-from-claude-ai)

### Server rejected the Authorization header minted by the configured headersHelper

[`headersHelper`](https://code.claude.com/docs/ja/mcp#use-dynamic-headers-for-custom-authentication) が `Authorization` ヘッダーを提供する MCP サーバーが、接続に対して HTTP 401 または 403 で応答したため、Claude Code は接続の失敗を報告します。ヘルパーが `Authorization` ヘッダーを提供しているため、Claude Code はそのサーバーについて [OAuth にフォールバックしません](https://code.claude.com/docs/ja/mcp.md#authenticate-with-remote-mcp-servers):

```text theme={null}
Server rejected the Authorization header minted by the configured headersHelper (HTTP 401). Check that the helper command returns a valid credential for this MCP endpoint — OAuth fallback is disabled when the helper supplies Authorization.
```

Claude Code は接続を試行するたびにヘルパーを再実行するため、トークンのローテーションの競合など一時的な拒否の後の再試行では、新しい認証情報で成功することがあります。

**対処方法:**

* Claude Code が実行するのと同じ方法で、`headersHelper` コマンドを自分で実行してください。つまり、[Claude Code がヘルパーを実行するディレクトリ](https://code.claude.com/docs/ja/mcp.md#where-the-helper-runs)から、[Claude Code がヘルパー用に設定する環境変数](https://code.claude.com/docs/ja/mcp.md#use-dynamic-headers-for-custom-authentication)を設定し、プロジェクトの `.mcp.json`、プラグイン、またはプロジェクトのエージェントファイルに由来するサーバーの場合は [Claude Code が削除する認証情報の変数](https://code.claude.com/docs/ja/mcp.md#which-variables-a-helper-can-read)を除いて実行します。サーバーのエンドポイントが受け付ける `Authorization` の値が出力されることを確認してください
* ヘルパーまたはその認証情報のソースを修正した後、`/mcp` でサーバーを選択して **Reconnect** を選んでください

v2.1.248 より前は、ヘルパーが `Authorization` ヘッダーを提供するサーバーに対しても、Claude Code は OAuth ディスカバリーを実行していました。そのディスカバリーは、拒否された認証情報を報告する代わりに、`Incompatible auth server: does not support dynamic client registration` で失敗することがありました。

### MCP サーバーが elicitation 機能を拒否した

Java MCP SDK 0.11.0 から 0.17.0 で構築された MCP サーバーが接続を拒否しました。これらの SDK バージョンは、Claude Code がハンドシェイクで宣言する `form` および `url` の [elicitation モード](https://code.claude.com/docs/ja/mcp.md#elicitation-modes-claude-code-declares)を解析できません。メッセージは次のとおりです:

```text theme={null}
This server (Java MCP SDK 0.17.0 or older) rejected Claude Code's elicitation capability. Set "bareElicitationCapability": true for it, or upgrade to Java MCP SDK 0.17.1+ (Spring AI 1.0.7+ or 1.1.6+).
```

**対処方法:**

* サーバーを Java MCP SDK 0.17.1 以降、またはメッセージに示されている Spring AI のリリースのいずれかにアップグレードしてください
* または、MCP 設定のそのサーバーのエントリに `"bareElicitationCapability": true` を追加してから、Claude Code を再起動してください。このフィールドは stdio、`sse`、`http`、`ws` のエントリで受け付けられ、Claude Code v2.1.281 以降が必要です

次の `.mcp.json` エントリは、1 つの HTTP サーバーに対してこのフィールドを設定します:

```json theme={null}
{
  "mcpServers": {
    "inventory": {
      "type": "http",
      "url": "https://mcp.example.com/mcp",
      "bareElicitationCapability": true
    }
  }
}
```

再起動後、`/mcp` にはサーバーが接続済みとして表示されます。Claude Code はそのサーバーに対してのみ form モードを宣言するため、サーバーをアップグレードしたらこのフィールドを削除してください。

サーバーが、`Unrecognized field "form"` を含むものなど、独自のエラーテキストで失敗することもあります。同じ対処方法が適用されます。

### MCP permission prompt tool not found

[`--permission-prompt-tool`](https://code.claude.com/docs/ja/cli-reference#cli-flags) に渡したツールが、実行で最初に権限の判断が必要になった時点で、接続済みの MCP ツールの中にありませんでした。そのサーバーが接続されなかったか、接続済みのサーバーがその名前のツールを公開していないためです。Claude Code はそれでもプロンプトを送信します。[非対話モード](https://code.claude.com/docs/ja/headless.md)の実行は最初のツール呼び出しでこのエラーとともに終了コード 1 で終了するため、リクエストは行われたにもかかわらず回答は生成されません。最初のプロンプトの前に、Claude Code は [`MCP_TIMEOUT`](https://code.claude.com/docs/ja/env-vars) で設定されるサーバーごとの接続タイムアウト（30 秒）まで、そのサーバーの接続を待機します。v2.1.206 より前は、起動時にサーバーの接続完了を待機しなかったため、起動が遅いものの正常なサーバーでもこのエラーが発生していました。

```text theme={null}
Error: MCP tool mcp__permissions__approve (passed via --permission-prompt-tool) not found. Available MCP tools: none
```

`Available MCP tools:` の後のリストには、接続されていた MCP ツールが示されます。

**対処方法:**

* サーバーが起動して接続を維持していることを確認してください。同じディレクトリで `claude mcp list` を実行し、サーバーが接続済みとして表示されることを確認してください
* ツール名が、サーバーが公開する `mcp__<server>__<tool>` の名前と一致していることを確認してください
* サーバーの起動に 30 秒を超える時間が必要な場合は、[`MCP_TIMEOUT`](https://code.claude.com/docs/ja/env-vars) を引き上げてください

### OAuth callback port is already in use

OAuth でリモート MCP サーバーにサインインすると、Claude Code はサインインのコールバックを受け取るためにローカルのリスナーを開始します。そのリスナーが必要とするポートが別のプロセスに保持されている場合、サインインはこのメッセージで失敗します。これは主に、[`MCP_OAUTH_CALLBACK_PORT`](https://code.claude.com/docs/ja/env-vars) 変数または `--callback-port` で[固定のコールバックポート](https://code.claude.com/docs/ja/mcp.md#use-a-fixed-oauth-callback-port)を設定している場合に発生します。固定のポートがない場合、Claude Code は利用可能なポートを選択するためです。

```text theme={null}
OAuth callback port <port> is already in use — another process may be holding it. Run `lsof -ti:<port> -sTCP:LISTEN` to find it.
```

Windows では、代わりに `netstat -ano | findstr :<port>` が提案されます。

**対処方法:**

* メッセージのコマンドを実行してポートを保持しているプロセスを特定し、停止するか終了を待ってください
* 別のプログラムがそのポートを恒常的に必要とする場合は、サーバーに別のリダイレクト URI を登録し、使用している方法に応じて `MCP_OAUTH_CALLBACK_PORT` または `--callback-port` でそのポートを設定してください
* その後、たとえば `/mcp` でサーバーを選択して、サインインを再度開始してください

### No available ports for OAuth redirect

[OAuth](https://code.claude.com/docs/ja/mcp.md#authenticate-with-remote-mcp-servers) でリモート MCP サーバーにサインインすると、Claude Code はサインインのコールバックを受け取るためにローカルのリスナーを開始します。Claude Code がそのためのローカルポートをバインドできない場合、サインインはこのメッセージで失敗します。マシン上の何か（セキュリティソフトウェアや、ローカルのリスナーを拒否するサンドボックスポリシーなど）が、`127.0.0.1` でのリッスンを妨げています。

```text theme={null}
No available ports for OAuth redirect
```

v2.1.268 より前は、Claude Code はオペレーティングシステムが割り当てるポートにフォールバックしなかったため、自身が選択したポートをバインドできなかっただけの場合にもこのメッセージが表示されていました。これは、Claude Code が選択するポートを含むポート範囲を Hyper-V が予約している Windows ホストで発生することがあります。

**対処方法:**

* セキュリティソフトウェアやサンドボックスポリシーが、プロセスによる `127.0.0.1` でのリッスンをブロックしていないかを確認し、Claude Code がローカルポートをバインドできるように許可してください
* その後、たとえば `/mcp` でサーバーを選択して、サインインを再度開始してください

### origin/HEAD がないと /security-review が失敗する

[`/security-review`](https://code.claude.com/docs/ja/commands#all-commands) は、ブランチと `origin/HEAD`（`origin` リモートでどのブランチがデフォルトかを記録するローカル ref）との差分を取ってレビューのコンテキストを構築します。その ref が存在しない場合、差分を収集する git コマンドが失敗し、レビューは開始前に停止します。

```text theme={null}
Error: Shell command failed for pattern "!`git diff --name-only origin/HEAD...`": [stderr]
fatal: ambiguous argument 'origin/HEAD...': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
```

メッセージには、代わりに `git log` や別の `git diff` が引用されている場合があります。Git が `origin/HEAD` を作成するのは、リモートがデフォルトブランチを通知し、フェッチの refspec がそれをカバーしている場合のみです。コミットのあるリモートを完全に `git clone` した場合はこれに該当します。次のような構成では ref が存在しません:

* refspec が狭すぎるフェッチを行う、単一ブランチまたは CI のチェックアウト
* サーバー側の HEAD が、誰もプッシュしていないブランチを指しているリモート
* `origin` リモートがないリポジトリ、または一度もフェッチしていないリポジトリ

Claude Code は、[動的コンテキストを挿入する](https://code.claude.com/docs/ja/skills.md#when-an-injected-command-fails)すべてのスキルで同じエラーを表示し、挿入されたコマンドが失敗するとそのスキルの呼び出しは中止されます。

コマンドの実行前に発生する類似のメッセージもあります:

* `Shell command permission check failed for pattern "..."`: コマンドの権限チェックで許可されませんでした。各権限モードでどの結果が中止につながるか、また `allowed-tools` がいつコマンドを事前承認するかについては、[挿入されたコマンドの権限チェック](https://code.claude.com/docs/ja/skills.md#permission-checks-on-injected-commands)を参照してください
* ``Skill <name> requires bash (`shell: bash` in frontmatter) but Git Bash was not found``: スキルのフロントマターが、bash のないマシンで bash を要求しています。Git for Windows をインストールするか、フロントマターを `shell: powershell` に変更してください。[挿入されたコマンドの実行方法](https://code.claude.com/docs/ja/skills.md#how-injected-commands-run)を参照してください

**対処方法:**

* リモートのデフォルトブランチを指定して ref を作成してください: `git remote set-head origin <default-branch>`。これは、ローカルの追跡 ref `origin/<default-branch>` が存在する場合に機能します。単一ブランチのクローンのように存在しない場合は、先にブランチをフェッチしてください。`git remote set-branches --add origin <branch>` を実行し、次に `git fetch origin` を実行してから、set-head コマンドを再実行します。その後、`/security-review` を再実行してください。
* ブランチを指定したくない場合は、`git fetch origin` を実行してから `git remote set-head origin --auto` を実行してください。これはリモートにどのブランチがデフォルトかを問い合わせます。リモートが空であるか、HEAD が誰もプッシュしていないブランチを指しているためにデフォルトブランチを通知しない場合、`error: Cannot determine remote HEAD` で失敗します。その場合は代わりにブランチを明示的に指定してください。クローンがそのブランチをフェッチしない場合、`error: Not a valid ref` で失敗します。その場合は、先に上記のように refspec を広げてください。
* リポジトリにリモートがない場合は、`git remote add origin <url>` でリモートを追加し、ref を作成する前にフェッチしてください。リモートが空の場合は、先に `git push -u origin HEAD` でブランチをプッシュし、set-head コマンドでそのブランチを指定してください。すると `origin/HEAD` はプッシュしたばかりのブランチを指すため、ブランチがそこから分岐するまで `/security-review` には空の差分が表示されます。

### スキルまたはコマンド内のシェルコマンドが実行されなかった

`No shell command in <name> was run` は、そのスキルまたはコマンドファイル内の `` !`<command>` `` [動的コンテキストコマンド](https://code.claude.com/docs/ja/skills.md#inject-dynamic-context)に、Bash ツールまたは PowerShell ツールが拒否する文字が含まれていることを意味します:

* **どちらのツールでも**: タブまたは改行以外の生の制御文字
* **PowerShell ツール**: さらに U+FEFF または U+180E

メッセージの末尾には拒否されたコマンドが表示され、拒否された各文字は `�` として示されます。次は Bash ツールの例です:

```text theme={null}
No shell command in /my-skill was run, because the Bash tool does not accept one of them: command contains control characters that would be hidden in the approval dialog. Unprintable characters are shown as � below: remove them from the skill or command file, or from the arguments or options substituted into it.
build.sh --target�dist
```

**対処方法:**

* メッセージの末尾に引用されたコマンド内の各 `�` を見つけてください。それが表す文字を、[スキルまたはコマンドファイル](https://code.claude.com/docs/ja/skills.md#where-skills-live)から、またはファイルに代入される引数や[オプション](https://code.claude.com/docs/ja/plugins/manifest-reference.md#user-configuration)から削除してください。

### 4,000,000 文字の上限を超えるスキル、コマンド、またはフック

`more than 4,000,000 characters` を含むメッセージは、スキル、コマンド、または[プロンプトフックやエージェントフック](https://code.claude.com/docs/ja/hooks.md#prompt-and-agent-hook-fields)が実行されなかったことを意味します。長いテキストを引数として貼り付けた場合は、それをファイルに保存し、テキストが会話に残っているため `/clear` を実行してから、ファイルのパスを渡します。

`PreToolUse` のプロンプトフックまたはエージェントフックが制限を超えている場合、Claude が直接行うツール呼び出しはブロックされません。そのような制限のない[コマンドフック](https://code.claude.com/docs/ja/hooks.md#command-hook-fields)を使用してください。Code Mode のコードからの呼び出しについては、[フックの失敗後にツール呼び出しが実行された](https://code.claude.com/docs/ja/code-mode.md#tool-call-ran-after-a-hook-failed)を参照してください。

### Input must be provided when using `--print`

引数なしの `claude` で対話 UI を開始するには、stdout がターミナルである必要があります。stdout がリダイレクトされている場合、またはコンソールが本物のターミナルではない場合（PowerShell ISE や一部の IDE の出力ペインなど）、`claude` は代わりに[非対話モード](https://code.claude.com/docs/ja/headless.md)で実行されます。これはプロンプトを必要とする `claude -p` と同じモードであるため、フラグを渡していなくてもメッセージには `--print` が示されます。プロンプトを指定せず、stdin に何もパイプせずに `-p`/`--print` を渡した場合も、どこでも同じエラーが発生します。

```text theme={null}
Error: Input must be provided either through stdin or as a prompt argument when using --print
```

**対処方法:**

* 対話的に使用する場合は、本物のターミナルで `claude` を実行してください。ISE ではなく Windows Terminal または PowerShell コンソールを、出力ペインではなく IDE の統合ターミナルを使用してください
* 1 回限りの使用の場合は、プロンプトを渡してください: `claude -p "your question"`、または `echo "your question" | claude -p` のようにパイプしてください

### Claude Code can't read the keyboard here

[`-p`](https://code.claude.com/docs/ja/headless) を付けずに `claude` を実行したため[対話セッション](https://code.claude.com/docs/ja/interactive-mode.md)が開始されましたが、その標準入力がターミナルではありません。何かが標準入力をパイプまたはリダイレクトしたか、`claude` を起動したプログラムが独自の入力ストリームを渡しています。

対話セッションにはキー入力を読み取るためのターミナルが必要であり、ターミナルがない場合の Claude Code の動作はプラットフォームによって異なります。

* **Windows**: Claude Code はインターフェースを起動する代わりに、メッセージを stderr に出力してコード 1 で終了します
* **macOS と Linux**: Claude Code は `/dev/tty` からキー入力を読み取ってセッションを開始し、パイプされたテキストがあれば最初のプロンプトとして扱います。`/dev/tty` を開けない場合にメッセージが表示され、その 1 行目では Windows の文言の代わりに `/dev/tty` が示されます。

Windows では、メッセージは次のとおりです。

```text theme={null}
Claude Code can't read the keyboard here: stdin is not a terminal (it is piped, redirected, or supplied by the program that launched claude), and on Windows it can't fall back to the console for input yet.
Run claude directly in Windows Terminal, PowerShell, or Command Prompt, without piping or redirecting its input.
To send text as a prompt and print the reply instead, add -p; it also works with --continue and --resume <session-id> (for example: type notes.md | claude -p --continue).
```

**対処方法:**

* 対話的に作業するには、入力をパイプやリダイレクトせずに、ターミナルで `claude` を直接実行します
* スクリプトなどから対話インターフェースなしで応答を得るには、`-p` を追加し、`claude -p "your question"` や `echo "your question" | claude -p` のように、プロンプトを引数または stdin で渡します。`--continue` や `--resume <session-id>` でも同じように動作します。

v2.1.287 より前は、Claude Code はこのメッセージを出力する代わりにインターフェースを起動し、画面に何も表示しないか、`Raw mode is not supported` を含むエラーで失敗していました。

`claude install` の実行中に `Raw mode is not supported` が表示される場合は、[インストール中の `Raw mode is not supported`](https://code.claude.com/docs/ja/troubleshoot-install#raw-mode-is-not-supported-during-install) を参照してください。

### Input contained only whitespace

[非対話モード](https://code.claude.com/docs/ja/headless.md)では、API が可視テキストのないメッセージを拒否するため、Claude Code はスペース、タブ、改行だけで構成されたプロンプトを送信せずに拒否します。表示されるメッセージは、空のプロンプトがどこから来たかによって異なります。

* **`claude -p` のプロンプト引数またはパイプされた stdin**: `claude` は `Error: Input contained only whitespace. Provide a prompt with text through stdin or as a prompt argument when using --print` で終了します
* **実行中の `--input-format stream-json` または [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) セッションに送信されたメッセージ**: Claude Code はモデルを呼び出さずにターンを終了し、セッションは引き続き使用できます。拒否は情報メッセージとして、またターンの結果テキストとして届きます: `Blank prompt — the message was only whitespace, so nothing was sent to the model.`

v2.1.229 より前は、Claude Code は空白のみのメッセージを API に送信し、API がそのリクエストを 400 エラーで拒否していました。

**対処方法:**

* プロンプトに可視テキストを含めます。スクリプトが変数やファイルからプロンプトを組み立てる場合は、Claude Code を呼び出す前にソースが空でないことを確認します。

### stream-json input carried over 256M characters with no newline

プログラムが `claude -p --input-format stream-json` の実行に対して、改行を含まずに 268,435,456 文字を超えるデータを stdin に送信したため、Claude Code はそれ以上入力をバッファリングせずに、このエラーを stderr に出力してコード 1 で終了します。メッセージではこの上限を `256M` と表記しています。v2.1.257 より前は、Claude Code はこのような入力を無制限にバッファリングし、プロセスがクラッシュするか強制終了されるまでメモリ使用量が増え続けていました。

```text theme={null}
Error: stream-json input carried over 256M characters with no newline. Each stream-json message must be a single newline-terminated JSON line: either the producer is not newline-terminating its messages, or one message exceeded this budget.
```

これほど長い入力に改行がない場合、通常はプロデューサーがそもそも stream-json のプロデューサーではないことを意味します。たとえば、誤ってパイプされたバイナリファイルやプレーンなログ出力などです。上限を超える単一のメッセージも、同じチェックで失敗します。

**対処方法:**

* stdin に何がパイプされているかを確認します。[`--input-format stream-json`](https://code.claude.com/docs/ja/cli-reference#cli-flags) では、すべてのメッセージが改行で終わる 1 行の JSON でなければなりません
* 代わりにプレーンテキストを送信するには、`--input-format stream-json` を外します。`claude -p` はデフォルトで stdin からプレーンテキストのプロンプトを読み取ります

### Unknown command

対話的なターミナルセッションで、このセッションのどのコマンドにも一致しない `/` 名を送信したため、Claude Code は何も実行せずにその名前を報告します。

```text theme={null}
Unknown command: /hepl. Did you mean /help?
```

Claude Code は、このセッションでメニューに表示されるコマンド名またはエイリアスのうち、最も近いものを提案します。近いものがない場合、メッセージは名前の後で終わります。原因は通常、次のいずれかです。

* `/help` を `/hepl` と入力するなどのタイプミス。送信前に近い候補を選ぶ方法については、[コマンドメニューが入力内容と照合する仕組み](https://code.claude.com/docs/ja/commands.md#how-the-command-menu-matches-what-you-type)を参照してください
* コマンドは存在するものの、プラットフォーム、プラン、認証方法などの要件が満たされていないため、このセッションでは利用できない。[`/web-setup`](https://code.claude.com/docs/ja/web-quickstart#web-setup-shows-no-commands-match-or-unknown-command)、[`/schedule`](https://code.claude.com/docs/ja/routines#schedule-returns-unknown-command)、[`/auto-mode-setup`](https://code.claude.com/docs/ja/auto-mode-config#auto-mode-setup-returns-unknown-command) の項目を参照してください。一部のコマンドは、組織のポリシーで無効にされている場合に、[`Cloud sessions are disabled by your organization's policy`](#cloud-sessions-are-disabled-by-your-organizations-policy) のような独自のメッセージで応答します
* このセッションにインストールまたは接続されていない[プラグイン](https://code.claude.com/docs/ja/plugins/overview.md)または [MCP サーバー](https://code.claude.com/docs/ja/mcp.md#use-mcp-prompts-as-commands)のコマンド

Claude Code が一致しない `/` 名にこのように応答するのは、対話的なターミナルセッションの場合だけです。それ以外のすべてのセッションでは、代わりにプロンプトを通常のメッセージとして Claude に送信し、コマンドが実行されなかったことを示す注記と、Claude がそのセッションで実行できるコマンドの一覧を添えます。これには次のセッションが含まれます。

* `-p` による実行
* [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) アプリケーション
* [デスクトップアプリ](https://code.claude.com/docs/ja/desktop.md)の Code タブ
* [VS Code 拡張機能](https://code.claude.com/docs/ja/vs-code.md)のチャットパネル
* [クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md)と[クラウドスケジュールタスク](https://code.claude.com/docs/ja/routines.md)

これらのセッションのいずれかで実行できない組み込みコマンドについては、Claude Code は Claude に送信せずに、そのコマンドが利用できないことを引き続き応答します。v2.1.274 より前は、一致しない名前を Claude に送信していたのはクラウドセッションとクラウドスケジュールタスクだけでした。v2.1.273 より前は、それらも `Unknown command` と応答していました。

Claude Code は、`/` で始まるすべてのプロンプトをコマンドとして扱うわけではありません。`/` の後の最初の単語が句読点で始まる場合（Lean のドキュメントコメントを開始する `/--` など）や、`/var/log/syslog` のようなパスである場合は、プロンプトを通常のメッセージとして Claude に送信します。

v2.1.236 より前は、入力した名前に近い候補がコマンドメニューに表示されている状態で `Enter` を押すと、Claude Code はその候補を実行していたため、`/hepl` のようなタイプミスでは、このメッセージが表示される代わりに `/help` が実行されていました。

**対処方法:**

* 提案された名前を実行するか、`/` に続けて名前の一部を入力し、このセッションで利用できるものを確認します
* ドキュメントに記載されているコマンドが不明と報告される場合は、[コマンドリファレンス](https://code.claude.com/docs/ja/commands.md)でそのコマンドの行に記載されている要件を確認します

### Diff is too large for ultrareview

未コミットの変更やステージ済みの変更を含む、ブランチとベースブランチの間の差分が [ultrareview](https://code.claude.com/docs/ja/ultrareview.md) のサイズ上限を超えているため、`/code-review ultra` と `claude ultrareview` サブコマンドはクラウドセッションの開始前にレビューを拒否します。拒否されたレビューは無料実行回数を消費せず、使用クレジットも課金されません。メッセージには、適用されている上限、差分のサイズ、変更行数が最も多いファイルが示されます。v2.1.216 より前は、メッセージには生の差分統計のみが表示されていました。

```text theme={null}
Diff is too large for ultrareview: 812 files, 96,410 lines changed (limits: 500 files, 8,000 lines). Largest files: package-lock.json (41,904 lines), dist/bundle.js (18,210 lines), src/generated/api.ts (9,876 lines). Pass a closer base branch (`/code-review ultra <branch>`) to narrow the scope, or split the change.
```

プルリクエストのレビューにも同じ上限が適用されます。その場合のメッセージは `PR #<N> is too large for ultrareview` で始まり、PR のファイル数と行数が示されます。

**対処方法:**

* `/code-review ultra develop` のように、作業に近いベースブランチを渡して、そのブランチに対する差分のみをレビュー対象にします
* 変更を小さなブランチに分割し、それぞれをレビューします。メッセージに示されたファイルは変更行数への寄与が最も大きいため、まずそれらを独自のブランチに移します。

### Could not find merge-base with the base branch

`/code-review ultra` と `claude ultrareview` サブコマンドは、ブランチとベースブランチの間の差分をレビューします。これには両者が共有するコミットが必要です。`git merge-base` がそのようなコミットを見つけられない場合、Claude Code はクラウドセッションの開始前にレビューを拒否します。完全であることを Claude Code が確認でき、少なくとも 1 つのブランチを持つクローンでは、拒否する代わりに[追跡対象のすべてのファイルをレビューする](https://code.claude.com/docs/ja/ultrareview.md#diff-limits-and-fallbacks)方式にフォールバックします。この拒否が表示されるのは、ベースブランチがまったく見つからない場合、クローンが完全であることを Claude Code が確認できない場合、または SHA-256 オブジェクト形式のようにツリー全体の差分を取得できないまれなリポジトリの場合です。

```text theme={null}
Could not find merge-base with main. Pass the base branch explicitly (e.g. `/code-review ultra develop`) or make sure you're in a git repo with a main branch.
```

最初の文の後のヒントは、Claude Code が検出した状況によって異なります。

* **ベースブランチを渡さなかった場合**: Claude Code はリポジトリのデフォルトブランチと比較し、上の例のようにベースを明示的に渡すよう提案します
* **すでにクローン内にあったベースブランチを渡した場合**: ヒントは ``Make sure <branch> exists locally or on origin (try `git fetch origin <branch>`)`` となります
* **クローン内になかったベースブランチを渡した場合**: Claude Code は比較の前に origin からそのブランチをフェッチしました。ヒントは ``<branch> was fetched from origin but shares no history with HEAD. If another branch is your real base, pass it explicitly (`/code-review ultra <branch>`)`` となります。クローンがシャロークローンかどうかを Claude Code が判断できない場合は、代わりに `git fetch --unshallow origin` を提案します。v2.1.221 より前は、フェッチされたすべてのベースブランチに対してヒントが `git fetch --unshallow origin` を提案しており、完全なクローンではこのコマンドが `fatal: --unshallow on a complete repository does not make sense` で失敗していました。

**対処方法:**

* 別のブランチが実際のベースである場合は、明示的に渡します: `/code-review ultra <branch>`
* クローンに完全な履歴がない可能性がある場合は、`git fetch --unshallow origin` を実行してからレビューを再実行します

### Your checkout has no branches

チェックアウトには、コミットがあってもブランチがない場合があります。`git init` の後に `git fetch <url>` と `git checkout FETCH_HEAD` を実行すると、ref のない detached HEAD になります。Claude Code は [ultrareview](https://code.claude.com/docs/ja/ultrareview.md) のためにリポジトリを git bundle としてパッケージ化してアップロードしますが、ブランチやその他の ref がないリポジトリはバンドルできないため、`/code-review ultra` と `claude ultrareview` サブコマンドはクラウドセッションの開始前にレビューを拒否します。

```text theme={null}
Your checkout has no branches (detached HEAD only), which cloud review can't bundle. Create one first — `git checkout -b <name>` — then rerun /code-review ultra.
```

v2.1.221 より前は、Claude Code はこのチェックアウト内の追跡対象ファイルをすべてレビューしようとし、アップロードが失敗していました。

**対処方法:**

* `git checkout -b <name>` で現在のコミットにブランチを作成してから、レビューを再実行します

### No GitHub account is connected to your Claude account

`/code-review ultra <PR#>` または `claude ultrareview <PR#>` を実行しました。Claude Code はクラウドセッションを作成する前に、[Claude アカウントに接続された GitHub アカウント](https://code.claude.com/docs/ja/ultrareview.md#review-a-pull-request)が PR のリポジトリにアクセスできるかどうかをサーバーに問い合わせます。アカウントが接続されていないか、接続の有効期限が切れているため、クラウドでのクローンが失敗することになり、Claude Code は起動を拒否します。拒否された起動では、Claude Code は無料実行回数を消費せず、使用クレジットも課金しません。

```text theme={null}
Ultrareview clones <owner>/<repo> in the cloud with the GitHub account connected to your Claude account, and none is connected (or the connection expired). To fix: run /web-setup to reuse your GitHub CLI login, or connect an account at https://claude.ai/connect-github — then re-run /code-review ultra 1234 (allow a minute after connecting).
```

セッションで [`/web-setup`](https://code.claude.com/docs/ja/web-quickstart#connect-from-your-terminal) を利用できない場合、メッセージには claude.ai のリンクのみが示されます。

**対処方法:**

* `/web-setup` を実行して GitHub CLI のログインを Claude アカウントに接続するか、[claude.ai/connect-github](https://claude.ai/connect-github) でアカウントを接続します
* 接続してから 1 分後にレビューを再実行します

v2.1.248 より前は、Claude Code は起動前にこれを確認していませんでした。

### Your connected GitHub account can't see the repository

`/code-review ultra <PR#>` または `claude ultrareview <PR#>` を実行しましたが、[Claude アカウントに接続された GitHub アカウント](https://code.claude.com/docs/ja/ultrareview.md#review-a-pull-request)が PR のリポジトリを読み取れないため、クラウドでのクローンが失敗することになり、Claude Code は起動を拒否します。拒否された起動では、Claude Code は無料実行回数を消費せず、使用クレジットも課金しません。

```text theme={null}
Your connected GitHub account can't see <owner>/<repo> — usually the Claude GitHub app isn't installed on <owner> or wasn't granted this repo (web-connected accounts need it for private repos), or a different GitHub account is connected. To fix: run /web-setup to reuse your GitHub CLI login, or install the app at https://github.com/apps/claude/installations/new — then re-run /code-review ultra 1234.
```

セッションで [`/web-setup`](https://code.claude.com/docs/ja/web-quickstart#connect-from-your-terminal) を利用できない場合、メッセージにはアプリのインストールのみが示されます。

**対処方法:**

* ローカルの `gh` CLI がリポジトリを読み取れる場合は、`/web-setup` を実行してそのログインを Claude アカウントに接続します
* 変更後にレビューを再実行します

v2.1.248 より前は、Claude Code は起動前にこれを確認していませんでした。

### The GitHub App preflight failed transiently

ローカルリポジトリから[クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md)を開始したところ、2 つのステップが同時に失敗しました。Claude Code はリポジトリのバンドルをビルドまたはアップロードできませんでした。アップロードの前に、クラウドサービスが GitHub からリポジトリをクローンできるかどうかを確認しましたが、そのチェックは明確な結果ではなく、ネットワークエラー、タイムアウト、一時的なサーバーエラーなど、再試行で解消される可能性のあるエラーで終了しました。完全なメッセージは、`Could not upload repo bundle (<error>)` のようにバンドルを妨げた原因で始まり、プリフライトの文で終わります。

```text theme={null}
Could not upload repo bundle (<error>). The GitHub App preflight failed transiently (network or service hiccup) — retry in a moment to start from GitHub instead
```

**対処方法:**

* 少し待ってからコマンドを再実行します。GitHub のチェックに合格すると、Claude Code は GitHub のクローンからセッションを開始できるため、アップロードの失敗によって起動が妨げられることはなくなります
* 再試行しても失敗し続ける場合は、メッセージの冒頭にアップロードを妨げた原因が示されています。その原因が修正可能なものであれば、修正してローカルリポジトリからセッションを開始できるようにします

v2.1.251 より前は、GitHub のチェックが一時的に失敗しただけの場合でも、Claude Code はメッセージを `Please set up GitHub on https://claude.ai/code` で終えていましたが、セットアップに関する助言では一時的な失敗は解消できません。

### The repository upload can't follow a git setting

[ローカルリポジトリをアップロードするクラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md#send-local-repositories-without-github)、またはブランチの [ultrareview](https://code.claude.com/docs/ja/ultrareview.md) を開始しましたが、ファイルに適用される属性ルールを決定する git 設定のいずれかに、アップロードが従うことができません。アップロードを続行してルールを見落とすと、clean フィルターで暗号化されるファイルのように、git が保存前に変換するファイルが、ディスク上の状態のままクラウドに届く可能性があります。そのため Claude Code はアップロードを拒否し、何もアップロードされません。

```text theme={null}
Not uploading this working tree: core.ignoreCase (which decides whether .gitattributes patterns match file names regardless of letter case) is set in <file>, and the upload cannot follow that setting, so a file git would change before storing it (to encrypt it, for example) could be uploaded as it is on disk. Move the core.ignoreCase line into this repository’s .git/config or directly into your ~/.gitconfig, then retry.
```

メッセージには設定名とその設定場所が示され、該当するケースの修正方法で終わります。`core.attributesFile` と `attr.tree` についても同じ拒否が表示され、それぞれに独自の修正方法が示されます。

メッセージには、git の設定が `include` または `includeIf` ディレクティブを通じて読み込む設定ファイルが示されることがあります。これは、そのディレクティブの条件がこのリポジトリに当てはまらない場合でも同様です。

**対処方法:**

* メッセージの最後の文にある修正方法を適用します

### GitHub isn't connected to your Claude account

たとえば `/autofix-pr` を使用して、ローカルリポジトリから[クラウドセッション](https://code.claude.com/docs/ja/claude-code-on-the-web.md)を開始しました。Claude アカウントに GitHub アカウントが接続されていないか、接続の有効期限が切れているため、Claude Code は起動を拒否します。

```text theme={null}
GitHub isn't connected to your Claude account, so this repository can't be cloned in the cloud. Run /web-setup to connect with your GitHub CLI login, or connect on the web at https://claude.ai/connect-github
```

[`/schedule`](https://code.claude.com/docs/ja/routines) でクラウドスケジュールタスクを作成すると、同じメッセージがリポジトリ名を示すセットアップの注記として表示されます。この注記はタスクの作成を妨げません。

**対処方法:**

* `/web-setup` を実行して GitHub CLI のログインを Claude アカウントに接続するか、[claude.ai/connect-github](https://claude.ai/connect-github) でアカウントを接続します。2 つの方法の違いについては、[GitHub 認証オプション](https://code.claude.com/docs/ja/claude-code-on-the-web.md#github-authentication-options)を参照してください。
* 接続してから 1 分後にコマンドを再実行します

v2.1.268 より前は、Claude Code はこれを Claude GitHub App のチェックの一時的な失敗として報告し、再試行またはアプリのインストールを提案していましたが、どちらも GitHub アカウントを接続するものではありません。

### A GitHub organization policy is blocking Claude

Claude Code のプロンプトで、[`/autofix-pr`](https://code.claude.com/docs/ja/claude-code-on-the-web#auto-fix-pull-requests) のようなクラウドセッションを開始するコマンドを実行しました。Claude Code はセッションを作成する前に GitHub 上のリポジトリへの Claude のアクセスを確認しますが、GitHub 組織に Claude をブロックするポリシーがあるため、GitHub が拒否しました。Claude Code はそこで停止し、ポリシーを示すメッセージを表示します。

IP 許可リストがアクセスをブロックしている場合、メッセージは次のとおりです。

```text theme={null}
Your GitHub organization has an IP allowlist that is blocking Claude. Add Claude's IP ranges to your GitHub allowlist.
```

シングルサインオンがブロックしている場合、メッセージは次のとおりです。

```text theme={null}
Your GitHub organization requires single sign-on. Disconnect and reconnect GitHub on the Connectors page in Claude on the web, click Authorize next to your organization when GitHub asks, then try again.
```

Microsoft Entra ID の条件付きアクセスポリシーがブロックしている場合、メッセージは次のとおりです。

```text theme={null}
Your GitHub organization's identity provider (Microsoft Entra ID) has a Conditional Access policy that is blocking Claude. Ask your GitHub Enterprise or Entra ID admin to allow Claude in that policy.
```

**対処方法:**

* **IP 許可リスト**: GitHub 組織または Enterprise のオーナーに、Anthropic の送信 IP アドレスを許可するよう依頼します。アドレスと変更する GitHub の設定については、[GitHub の許可リストとファイアウォール](https://code.claude.com/docs/ja/network-config.md#github-allow-lists-and-firewalls)を参照してください。
* **シングルサインオン**: [claude.ai/customize/connectors](https://claude.ai/customize/connectors) で GitHub の接続を解除してから、再度接続します。GitHub から求められたら、組織の横にある **Authorize** をクリックして、新しい接続がその組織のシングルサインオンに対して認可されるようにします。
* **条件付きアクセスポリシー**: GitHub Enterprise または Microsoft Entra ID の管理者に、そのポリシーで Claude を許可するよう依頼します
* 変更後、コマンドを再度実行します

### Single sign-on authorization needed

[`/install-github-app`](https://code.claude.com/docs/ja/github-actions#quick-setup) を実行し、SAML シングルサインオンを強制している組織のリポジトリを選択しました。セットアップの前に、Claude Code は GitHub CLI でリポジトリへのアクセスを確認しますが、`gh` トークンがまだその組織に対して認可されていないため、GitHub がその確認を拒否しました。ウィザードは、認可の手順とともに警告を表示します。

```text theme={null}
Single sign-on authorization needed
<owner>/<repo> belongs to an organization that enforces SAML single sign-on, and your GitHub CLI token isn't authorized for it yet.
```

**対処方法:**

* `gh auth refresh -h github.com -s repo,workflow` を実行して `repo` と `workflow` スコープで GitHub CLI のログインを再認可し、GitHub からシングルサインオンを求められたら組織を認可します
* `GH_TOKEN` の個人用アクセストークンで認証している場合は、[github.com/settings/tokens](https://github.com/settings/tokens) を開き、トークンの **Configure SSO** を選択して組織を認可します
* `/install-github-app` を再度実行します

v2.1.273 より前は、この状況では代わりに `Admin permissions required` の警告が表示されていました。

### Failed to resume the conversation

Claude Code は、[`claude --resume` ピッカー](https://code.claude.com/docs/ja/sessions#use-the-session-picker)で選択したセッションの保存済みトランスクリプトを読み取るか処理できなかったため、部分的に読み込まれた状態で続行せずにプロセスを終了します。メッセージには再試行用のコマンドが含まれます。

```text theme={null}
Failed to resume the conversation.
Run claude --resume <session-id> to retry, or claude to start a new session.
```

Claude Code はメッセージを表示した後、コード 1 で終了します。実行中のセッション内の `/resume` ピッカーでは、代わりに会話内に `Failed to resume conversation` と報告され、現在のセッションは実行を続けます。v2.1.216 より前は、`claude --resume` ピッカーからの再開に失敗すると、このメッセージを表示せずに `Resuming conversation…` スピナーのまま無期限に止まっていました。

**対処方法:**

* メッセージにあるセッション ID を指定して `claude --resume <session-id>` を実行し、再試行します
* v2.1.285 より前のバージョンで再試行が同じように失敗する場合は、`claude update` を実行してから再度再開します。これらのバージョンでは、保存済みトランスクリプトに読み取れないエントリが含まれていると再開に失敗します。
* 再試行が再び失敗する場合は、`claude` を実行して新しいセッションを開始します

### No conversation found with the session ID

`claude --resume <session-id>` にセッション ID を渡しましたが、一致する保存済みトランスクリプトがありませんでした。

```text theme={null}
No conversation found with session ID: <session-id>
```

Claude Code はメッセージを表示した後、コード 1 で終了します。Claude Code は、その ID を[まず現在のプロジェクトで検索し、次にこのマシン上の他のすべてのプロジェクトで検索します](https://code.claude.com/docs/ja/sessions.md#where-the-session-picker-looks)。v2.1.223 より前は、検索は現在のプロジェクトディレクトリとその git worktree で止まっていたため、セッションが最後に作業していたディレクトリから再開してください。

よくある原因:

* **ID の入力ミス**: 非対話的な実行の場合、ID は [`--output-format json` の出力](https://code.claude.com/docs/ja/headless#get-structured-output)の `session_id` フィールドです
* **トランスクリプトの削除**: Claude Code は、[保持期間による削除のルール](https://code.claude.com/docs/ja/claude-directory.md#cleaned-up-automatically)に従い、[保持期間](https://code.claude.com/docs/ja/sessions.md#where-transcripts-are-stored)（デフォルトでは 30 日）が過ぎるとトランスクリプトを削除します
* **別のマシン**: Claude Code はトランスクリプトをローカルに保存するため、セッションを実行したマシン上で再開してください
* **重複したコピー**: `~/.claude/projects` 配下のプロジェクトディレクトリをコピーして 2 つのトランスクリプトが同じ ID を持つようになった場合、Claude Code は一方のコピーを任意に再開するのではなく、このメッセージを報告します

**対処方法:**

* 対話セッションの場合は、`claude --resume` で[セッションピッカー](https://code.claude.com/docs/ja/sessions.md#use-the-session-picker)を開き、`Ctrl+A` を押してこのマシン上のすべてのプロジェクトに範囲を広げてから、セッションを選択します
* `claude -p` や [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) で作成されたセッションはピッカーに表示されないため、元の実行で出力された `session_id` と ID を照合し直してください

### Windows reported an error (EBADF) when Claude Code read this session's transcript file

Windows でセッションを再開したところ、保存済みの[トランスクリプトファイル](https://code.claude.com/docs/ja/sessions.md#where-transcripts-are-stored)は正常に開かれたものの、その後の読み取りがシステムエラー EBADF で失敗しました。システムエラーは読み取りが失敗した理由を示さないため、メッセージでは考えられる原因と試すべきことが提案されます。

```text theme={null}
Windows reported an error (EBADF) when Claude Code read this session's transcript file, although the file had opened normally. This can happen when other software intercepts file reads — security, encryption or endpoint-management tools, for example. If it keeps happening for this conversation, try excluding the folder that holds Claude Code's session transcripts from such software (the .claude folder in your user profile, unless the app or CLAUDE_CONFIG_DIR points Claude Code elsewhere), or adding Claude Code to its allowed applications, then resume again.
```

このメッセージは、`Failed to resume session <session-id>` のようなコマンド自体の失敗行の後に続きます。`claude --resume` または [`claude -p`](https://code.claude.com/docs/ja/headless) コマンドは、メッセージを表示した後にコード 1 で終了します。セッション内で `/resume` を実行した場合は、現在のセッションが実行を続けます。

**対処方法:**

* セキュリティ、暗号化、エンドポイント管理ツールなど、ファイルの読み取りをスキャンまたはインターセプトするソフトウェアの対象から、セッションのトランスクリプトを保存するフォルダーを除外します。トランスクリプトはデフォルトでは `%USERPROFILE%\.claude\projects` 配下、または [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/ja/env-vars) が指定するディレクトリ配下に保存されます
* 除外を追加できない場合は、代わりにそのソフトウェアの許可されたアプリケーションに Claude Code を追加します
* セッションを再度再開します

v2.1.282 より前は、失敗に説明がありませんでした。`claude --resume <session-id>` は `Failed to resume session <session-id>` で終わり、`-p` での実行では `Failed to resume session: EBADF: bad file descriptor, read` のようにシステムエラーのテキストのみが出力されていました。

### Cannot switch renderers in this session

レンダラーを切り替えると、Claude Code はプロセスを再起動します。Claude Code が再起動を拒否するセッションで [`/tui`](https://code.claude.com/docs/ja/fullscreen#enable-fullscreen-rendering) を実行したため、切り替えは行われず、何も保存されません。表示されるメッセージによって原因がわかります。

* `Cannot switch renderers while work is running in the background`: バックグラウンドシェルやサブエージェントなど、再起動によって放棄されることになるバックグラウンド作業が実行中です。作業が終わるのを待つか [`/tasks`](https://code.claude.com/docs/ja/commands) で停止してから、`/tui fullscreen` または `/tui default` を再度実行します
* `Cannot switch renderers in this session`: セッションに、Claude Code が再起動後のプロセスに引き継げない制限があります。v2.1.234 より前は、Claude Code はそれでも再起動し、再起動されたセッションはそれらの制限なしで実行されていました

制限に関するメッセージでは、括弧内の部分に Claude Code が検出した制限が示されます。

```text theme={null}
Cannot switch renderers in this session — it has restrictions a restart can't carry over (permission rules set for this session only). Nothing was changed. Running /tui fullscreen in a session started without them switches every later session too.
```

メッセージの括弧内に表示される可能性のある各理由は次のとおりです。

* `launch flags: a custom system prompt, a tool allowlist, or restricted settings`: Claude Code が再起動後のプロセスに引き継がないフラグを指定してセッションを開始しました。これらのフラグには、[`--system-prompt`](https://code.claude.com/docs/ja/cli-reference#cli-flags)、`--system-prompt-file`、`--append-system-prompt-file`、[`--tools`](https://code.claude.com/docs/ja/cli-reference#cli-flags) の許可リスト、[`--setting-sources`](https://code.claude.com/docs/ja/cli-reference#cli-flags)、[`--permission-prompt-tool`](https://code.claude.com/docs/ja/cli-reference#cli-flags) が含まれます
* `permission rules set for this session only`: フックまたは SDK の呼び出し元からの[権限の更新](https://code.claude.com/docs/ja/hooks.md#permission-update-entries)によって、`session` を宛先とする拒否ルールまたは確認ルールが追加されました。セッションスコープの許可ルールでは拒否は発生しません。再起動によってそれらは削除され、Claude Code は代わりに再度確認を求めます
* `ask-before-running rules with no command-line form`: フックまたは SDK の呼び出し元からの権限の更新によって、Claude Code が `--allowed-tools` と `--disallowed-tools` として引き継ぐルールとともに、確認ルールが追加されました。確認ルール用のフラグは存在しません
* `permission rules a command line cannot carry intact` と `added directories a command line cannot carry intact`: 権限の更新によって、セッションの途中でルールまたはディレクトリパスが追加されました。再起動後のプロセスのコマンドラインでは、そのテキストを同じ値として引き継ぐことができません

**対処方法:**

* それらの制限なしで開始したセッションで `/tui fullscreen` を実行するか、元に戻す場合は `/tui default` を実行します。Claude Code はそのセッションで [`tui` 設定](https://code.claude.com/docs/ja/settings-reference#tui)を保存します

### Can't restart while work is running or Remote Control is connected

Claude Code は再起動せず、セッションはそのまま実行を続けます。メッセージに示された修正方法に従ってください。

### Claude Code couldn't restart

このメッセージで会話が保存されていると示されている場合、会話はディスク上にあり、中断したところから再開できます。Claude Code は、たとえば [`/tui`](https://code.claude.com/docs/ja/fullscreen#enable-fullscreen-rendering) の実行後にフルスクリーンレンダリングへの切り替えまたはその解除を行うために自身を再起動しようとしましたが、新しいプロセスを開始できなかったため、ステータス 1 で終了しました。

```text theme={null}
Claude Code couldn't restart. Your conversation is saved. Start Claude Code again and run /resume to pick it up.
```

新しいセッションで最初の入力が `/tui` だった場合など、再起動時に再開する会話がなかった場合、メッセージは `Claude Code couldn't restart. Start Claude Code again.` となります。

**対処方法:**

* シェルで `claude` を再度実行します。メッセージで会話が保存されていると示されていた場合は、新しいセッションで [`/resume`](https://code.claude.com/docs/ja/sessions#resume-a-session) を実行し、その会話を選択します。一覧にない場合は、[セッションピッカーの範囲を広げます](https://code.claude.com/docs/ja/sessions.md#where-the-session-picker-looks)
* 再起動が失敗し続ける場合は、シェルから [`claude --debug-file claude-debug.log`](https://code.claude.com/docs/ja/cli-reference#cli-flags) で Claude Code を起動します。そのセッションからの再起動が失敗すると、起動したディレクトリの `claude-debug.log` に、オペレーティングシステムのエラーを含む `Failed to relaunch:` 行が記録されます。[問題を報告する](#report-an-error)際には、その行を含めてください

### Couldn't open Claude Desktop

セッションで [`/desktop`](https://code.claude.com/docs/ja/desktop#coming-from-the-cli) またはそのエイリアス `/app` を実行したか、シェルで [`claude --desktop`](https://code.claude.com/docs/ja/cli-reference#cli-flags) を実行しましたが、Claude Code が Claude Desktop を開くために使用するシステムコマンドが失敗しました。`/desktop` の場合、セッションはターミナルにとどまります。`claude --desktop` は `Error:` プレフィックスなしでメッセージを出力し、ステータス 1 で終了します。

括弧内のテキストには失敗したコマンドが示され、終了ステータスとエラー出力の 1 行目が生成された場合は、それらも示されます。macOS では、この例のようにコマンドは `open` です。Windows では `rundll32` です。

```text theme={null}
Error: Couldn't open Claude Desktop (`open` exited 1: LSOpenURLsWithRole() failed for the URL claude://resume?session=<session-id> with error -10814). Open Claude Desktop and try again.
```

**対処方法:**

* Claude Desktop を自分で開いてから、`/desktop` または `claude --desktop` を再度実行します
* 失敗したコマンドのエラー出力全体を確認するには、`/debug` でデバッグログをオンにして `/desktop` を再度実行するか、`claude --desktop --debug-file <path>` を実行してから、デバッグログを確認します

v2.1.285 より前は、メッセージは `Open Claude Desktop and run /desktop again.` で終わっていました。v2.1.275 より前は、メッセージは `Failed to open Claude Desktop. Please try opening it manually.` で、何が失敗したかは示されていませんでした。

### /terminal-setup left your Zed keymap unchanged

Zed で [`/terminal-setup`](https://code.claude.com/docs/ja/terminal-config#enter-multiline-prompts) を実行しましたが、Claude Code は Zed の `keymap.json` の更新を完了できなかったため、ファイルを元のままにしました。

各メッセージには、キーマップへのパスと、自分で追加するためのキーボードショートカットのブロックが含まれます:

```text theme={null}
Couldn't update your Zed keymap, so it was left unchanged.
To add the binding yourself, add this block to the keymap array in <path to keymap.json>:
{ "context": "Terminal", "bindings": { "shift-enter": ["terminal::SendText", "\u001b\r"] } }
```

メッセージの 1 行目に原因が示されます。

* `Couldn't read your Zed keymap, so it was left unchanged.`: ファイルの権限などの理由で、Claude Code がファイルを読み取れませんでした
* `Your Zed keymap isn't a readable list of keybindings, so it was left unchanged.`: ファイルは読み取れましたが、`//` コメントと末尾のカンマを許容しても、キーボードショートカットのブロックの配列として解析できません
* `Your Zed keymap is a symbolic link, so it was left unchanged.`: `keymap.json` が別のファイルにリンクしています
* `Couldn't back up your Zed keymap; not modifying it.`: Claude Code がファイルを同じ場所の `.bak` バックアップにコピーできなかったため、何も変更しませんでした
* `Couldn't update your Zed keymap, so it was left unchanged.`: マージした結果が、キーボードショートカットを含む有効なキーマップとして検証されなかったため、Claude Code は書き込まずに破棄しました。キーボードショートカットのブロックでキーが重複していると、これが発生することがあります

**対処方法:**

* メッセージにあるブロックを、メッセージに示されたパスにある `keymap.json` のトップレベルの配列にコピーします
* `isn't a readable list of keybindings` の場合は、構文エラーを修正するか、ファイルのトップレベルの値を配列にしてから、`/terminal-setup` を再度実行します

v2.1.247 より前は、`/terminal-setup` は `//` コメントや末尾のカンマを使用する Zed のキーマップを解析できず、キーボードショートカットがインストールされたと報告しながら、ファイル全体を自身のキーボードショートカットのみで置き換えていました。以前のバージョンで置き換えられたキーマップを復元するには、[複数行のプロンプトを入力する](https://code.claude.com/docs/ja/terminal-config.md#enter-multiline-prompts)で説明されている `.bak` バックアップファイルを使用します。

### Skill usage reports are not available on this connection

スマートフォンやブラウザーから [Remote Control](https://code.claude.com/docs/ja/remote-control.md) 経由で [`/skill-doctor`](https://code.claude.com/docs/ja/skills#find-unused-skills) を実行しました。Claude Code は Remote Control 経由ではスキル使用状況レポートを送信せず、代わりにこのメッセージを返します。

```text theme={null}
Skill usage reports are not available on this connection.
```

**対処方法:**

* セッションが実行されているマシン上のターミナルで `/skill-doctor` を実行するか、そこで `claude -p "/skill-doctor"` を実行します

### Custom output styles can't be selected over Remote Control

[Remote Control](https://code.claude.com/docs/ja/remote-control.md) 経由でモバイルアプリまたは Web から [`/output-style`](https://code.claude.com/docs/ja/output-styles#change-your-output-style) を実行したか、セッションに中継されたメッセージでコマンドが届きました。このようなターンはアカウント所有者からのものではない可能性があるため、Claude Code はそのターンでは[組み込みスタイル](https://code.claude.com/docs/ja/output-styles.md#built-in-output-styles)のみを一覧表示・選択し、コマンドがスタイルを一覧表示するとき、または指定した名前を認識しないときには常にこの通知を追加します。[カスタムスタイル](https://code.claude.com/docs/ja/output-styles.md#create-a-custom-output-style)の名前には、存在しない名前と同じ応答が返されます。

```text theme={null}
Custom output styles can't be selected over Remote Control or from a relayed message. Select one in the session itself, or pick a built-in style here.
```

**対処方法:**

* 組み込みスタイルを選択します。例: `/output-style concise`
* カスタムスタイルを使用するには、プロジェクトの `.claude/settings.local.json` で [`outputStyle`](https://code.claude.com/docs/ja/settings-reference#outputstyle) を設定するか、セッション自体のターミナルがある場合はそこで `/output-style <style>` を実行します

### Output styles are saved to local settings which this session doesn't load

設定ソースに `local` が含まれていないセッションで、`/output-style <style>` または `/config outputStyle=<style>` を使って[出力スタイル](https://code.claude.com/docs/ja/output-styles.md)を切り替えようとしました。たとえば、[`settingSources`](https://code.claude.com/docs/ja/agent-sdk/typescript#options) から `"local"` が除外されている [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/typescript.md) セッションや、`local` を除外した [`--setting-sources`](https://code.claude.com/docs/ja/cli-reference#cli-flags) の値で開始された CLI セッションです。どちらのコマンドもスタイルを `.claude/settings.local.json` に保存しますが、このようなセッションはこのファイルを読み込まないため、Claude Code は効果のない設定を書き込む代わりに拒否します。

```text theme={null}
Output styles are saved to local settings (.claude/settings.local.json), which this session doesn't load, so the style can't be changed here.
```

**対処方法:**

* セッションの設定ソースに `local` を追加してから、再度切り替えます
* プロジェクトの `.claude/settings.json` や `~/.claude/settings.json` など、セッションが読み込む設定ファイルで [`outputStyle`](https://code.claude.com/docs/ja/settings-reference#outputstyle) キーを設定します。TypeScript SDK では、代わりにインラインの `settings` オブジェクト内で `outputStyle` を設定します。[出力スタイルを有効にする](https://code.claude.com/docs/ja/agent-sdk/modifying-system-prompts.md#activate-an-output-style)を参照してください

### /recap only runs when you ask for it yourself

[`/recap`](https://code.claude.com/docs/ja/interactive-mode#session-recap) のリクエストが、自分自身の入力から送られたものではありません。Slack、Teams、または[プロジェクト](https://code.claude.com/docs/ja/claude-projects.md)のスレッドからセッションに中継されたメッセージ、あるいは[クラウドスケジュールタスク](https://code.claude.com/docs/ja/routines.md)や別のプログラムが送信したプロンプトで届きました。

中継されたメッセージは、自分で書いたものであっても通知の対象になります。Claude Code は、中継されたメッセージや自動化されたメッセージが、セッションを実行しているアカウントの所有者から送られたものかどうかを判断できないため、要約の代わりにこの通知で応答します。

```text theme={null}
/recap only runs when you ask for it yourself in this session: from the terminal, the Claude app or claude.ai/code, or over Remote Control. A message relayed from Slack, Teams or a project thread, or sent by a routine or another program, can't request it.
```

`claude -p` に渡した `/recap`、または自分の [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) アプリケーションが起動したセッションに送信する `/recap` は、自分自身の入力として扱われます。

**対処方法:**

* 自分でセッションを開き、そこで `/recap` を実行します。実行場所は、そのセッションのターミナル、[デスクトップアプリ](https://code.claude.com/docs/ja/desktop.md)や[モバイルアプリ](https://code.claude.com/docs/ja/mobile.md)、[claude.ai/code](https://claude.ai/code)、または [Remote Control](https://code.claude.com/docs/ja/remote-control.md) 経由です
* クラウドスケジュールタスクや別のプログラムが送信した場合は、そのプロンプトから `/recap` を削除します

### /feedback is disabled by your organization's policy

このメッセージは、製品フィードバックがオフになっているため、入力したコマンドでフィードバックダイアログが開かないことを意味します。このメッセージは、組織のポリシーと以前の拒否のどちらによっても表示されます。

* **組織のポリシー**: 組織のポリシーで Claude Code からの製品フィードバックが許可されていません。`/feedback`、`/bug`、`/share` のいずれもこのメッセージで応答します。
* **以前の拒否**: フィードバックサービスが、送信したレポートを [`Couldn't send feedback: Feedback has not been enabled for your organization.`](#couldnt-send-feedback) などで拒否しました。その後、`/feedback` と `/bug` がこのメッセージで応答することがあります。この状態は、このマシン上でその拒否から 7 日間続きます。これは Pro や Max を含むすべてのプランに当てはまります。

メッセージには、Claude Code のプロンプトで入力したコマンドが示されます。

```text wrap theme={null}
/feedback is disabled by your organization's policy. To report a bug, open an issue at https://github.com/anthropics/claude-code/issues. Issues are public, so leave out anything confidential.
```

メッセージが最初の文だけの場合もあります。

**対処方法:**

* バグを報告するには、[github.com/anthropics/claude-code/issues](https://github.com/anthropics/claude-code/issues) で issue を作成します。そこにある issue は誰でも読めるため、コード、トランスクリプト、その他の機密情報は含めないでください。
* 以前の拒否の後は、7 日間が経過するのを待ってから再度レポートを送信し、サービスがまだ拒否するかどうかを確認します

v2.1.319 より前は、以前の拒否によってこのメッセージが表示されることはありませんでした。

v2.1.302 より前は、完全なメッセージは `/feedback is disabled by your organization's policy. Contact your organization admin to enable it.` でした。

## プラグインエラー

これらのエラーは、[プラグイン](https://code.claude.com/docs/ja/plugins/overview.md)と[マーケットプレイス](https://code.claude.com/docs/ja/plugins/overview.md)の設定から発生します。このページのメッセージを生成しないプラグインの問題（マーケットプレイス URL が読み込まれない、またはプラグインがインストールされても表示されないなど）については、[プラグインのトラブルシューティング](https://code.claude.com/docs/ja/plugins/troubleshooting.md)を参照してください。

### plugin eval は現在早期アクセス中です

[`claude plugin eval`](https://code.claude.com/docs/ja/plugin-evals)または `claude plugin eval init` を実行し、何もする前に終了コード 1 で以下のいずれかのメッセージで終了しました：

```text theme={null}
`plugin eval` is currently in early access
```

```text theme={null}
`plugin eval` is currently unavailable
```

最初のメッセージは、ビルドが v2.1.269 より古いことを意味します。これはコマンドが一般的に利用可能になった最初のバージョンです。2 番目のメッセージは、Anthropic がサーバー側でコマンドをオフにしたことを意味します。マシン上の何もそれをオンに戻しません。

**対処方法：**

* `claude --version` を実行してから `claude update` を実行し、新しいセッションでコマンドを再度実行してください。[プラグイン eval の要件](https://code.claude.com/docs/ja/plugin-evals.md#requirements)を参照してください
* 現在のビルドで 2 番目のメッセージが表示される場合は、別の `claude update` の後で後で再度試してください

### マーケットプレイスが信頼されていないソースから登録されています

原因と修正方法については、[プラグインのトラブルシューティングにおけるこのメッセージ](https://code.claude.com/docs/ja/plugins/troubleshooting.md#marketplace-is-registered-from-an-untrusted-source)を参照してください。

### マーケットプレイス名は予約名の別のスペルです

マーケットプレイスの名前自体は予約名ではありませんが、Claude Code はそれを予約名の別のスペルとして扱います。[予約名](https://code.claude.com/docs/ja/plugins/marketplace-reference.md#reserved-name-spellings)は、どのスペルが予約名として数えられるかをリストします。Claude Code は、マーケットプレイスを追加するときにそのような名前を拒否します：

```text theme={null}
Failed to add marketplace: "claude.code.plugins" is another spelling of "claude-code-plugins", a reserved marketplace name.
```

マーケットプレイスが既にそのような名前で登録されている場合、そのエントリは読み込みを停止し、`/plugin`、`claude plugin install`、および `claude plugin update` は警告します：

```text wrap theme={null}
known_marketplaces.json has an entry named "claude.code.plugins", another spelling of the reserved marketplace name "claude-code-plugins", so it is ignored. Remove it with: claude plugin marketplace remove claude.code.plugins
```

名前がシェルクォートを必要とする場合、追加時の拒否は `This marketplace's name is another spelling of "<reserved>", a reserved marketplace name. It is not exactly the reserved name it appears to be.` と読みます。

**対処方法：**

* マーケットプレイスの名前を予約名のスペルではない名前に変更し、再度追加してください
* 無視されたエントリの警告については、提供される `claude plugin marketplace remove` コマンドを実行するか、`~/.claude/plugins/known_marketplaces.json` からエントリを削除してください

### Claude Code がマーケットプレイス名を拒否します

登録されたマーケットプレイスの名前は、[公式 Anthropic マーケットプレイスを偽装します](https://code.claude.com/docs/ja/plugins/marketplace-reference.md#reserved-names)。そのセクションがリストするルールの下で。

マーケットプレイスがチェックがそれをブロックする前にそのような名前で登録された場合、マーケットプレイスとそこからインストールされたプラグインは読み込みを停止します。Claude Code はマーケットプレイスのカタログを読むたびに名前をチェックするためです。名前が公式のものを模倣する場合、`claude plugin list` と `/plugin` **Errors** タブは、以下で始まるメッセージで影響を受けた各プラグインを報告します：

```text theme={null}
Claude Code refuses the marketplace name "anthropic-plugins-v2"
```

模倣する名前の場合、マーケットプレイス自体のエラーは `Claude Code refuses this marketplace's name: it looks like one of Anthropic's own` と読みます。`claude plugin marketplace add` は、`Marketplace name impersonates an official Anthropic/Claude marketplace` で任意の偽装名を拒否します。

v2.1.282 より前では、`claude plugin list` と `/plugin` は、マーケットプレイスの名前が原因として名前を付けずに、模倣する名前のプラグインを読み込みに失敗したものとして報告していました。

**対処方法：**

* 設定ファイルが `"source": "settings"` でインライン宣言しているマーケットプレイスを保持するには、古い名前を削除する前に名前を変更してください。マーケットプレイスを削除すると、設定ファイルからもそのエントリが削除されるためです。Claude Code v2.1.292 以降では、メッセージに次の手順が表示されます：
  1. `extraKnownMarketplaces` にそのマーケットプレイスを記載している各設定ファイルで、エントリのキーとその `source.name` に、公式のものに見えない新しいプレーン ASCII の名前を 1 つ付けます。管理者が組織の管理設定を通じてマーケットプレイスを追加している場合は、この手順は管理者が行います
  2. `claude plugin marketplace remove <old-name>` を実行するか、`/plugin` の **Marketplaces** タブで古い名前を削除します。これにより、そのプラグインもアンインストールされ、それらのデータ、オプション、シークレットが削除されます
  3. Claude Code を再起動します。ファイルがプロジェクトの設定ファイルである場合は、プロジェクトのフォルダで起動します。その後、名前を変更したマーケットプレイスからプラグインをインストールします
* その他のマーケットプレイスを保持するには、メンテナーが名前を変更するまで待ってから、`claude plugin marketplace update <name>` を実行してください
* マーケットプレイスを削除するには、`claude plugin marketplace remove <name>` を実行してください。これにより、マーケットプレイスからインストールされたプラグインもアンインストールされ、それらのデータ、オプション、シークレットが削除されます
* マーケットプレイスを公開する場合は、`marketplace.json` で名前を変更してください。ユーザーはマーケットプレイスを削除する代わりに更新します

### マーケットプレイスは既に別のソースから追加されています

セッション内またはシェルから、[インストールコマンドの `--marketplace <source>`](https://code.claude.com/docs/ja/plugins/install#add-a-marketplace-and-install-in-one-command) で新しいマーケットプレイスソースを指定しました。Claude Code がそのソースから取得したカタログは、既に別のソースから追加したマーケットプレイスと同じ名前を持っています。Claude Code は既存のマーケットプレイスを置き換えずに保持し、プラグインはインストールされません。

```text theme={null}
Marketplace "acme-tools" is already added from a different source (github:acme/plugins). To use this source instead, remove that marketplace first with /plugin marketplace remove acme-tools.
```

**対処方法：**

* 既に追加したマーケットプレイスが必要なものである場合は、名前でそこからインストールしてください：`/plugin install <plugin>@<name>`
* 新しいソースに切り替えるには、`/plugin marketplace remove <name>` を実行してから、インストールを再試行してください

### プラグインコマンドがシェルコマンドで user\_config を参照しています

プラグインフック、[monitor](https://code.claude.com/docs/ja/plugins/components.md#monitors)、または MCP [`headersHelper`](https://code.claude.com/docs/ja/mcp#use-dynamic-headers-for-custom-authentication)コマンドは、`${user_config.KEY}` [プラグインオプション](https://code.claude.com/docs/ja/plugins/manifest-reference.md#user-configuration)を参照し、置換された文字列はシェルに渡されます。`$(...)` を含む設定値、バックティック、または `;` はそこでコードとして実行されるため、Claude Code は値を置換する代わりにコンポーネントの開始を拒否します。チェックはコマンドテンプレートで実行されるため、値がまだ設定されていない場合でもエラーが表示されます。v2.1.207 より前では、値はシェルコマンドに置換されていました。

表現は、どの表面がオプションを参照したかによって異なります。シェル形式フックは以下を報告します：

```text theme={null}
Hook from plugin formatter@acme-tools references ${user_config.*} in a shell-form command. The substituted value would be re-parsed by the shell. Use exec form instead — {"command": "<executable>", "args": ["${user_config.KEY}", ...]} — or read $CLAUDE_PLUGIN_OPTION_<KEY> from the hook's environment. Command: ./scripts/notify.sh ${user_config.webhook_url}
```

モニターは以下を報告します：

```text theme={null}
Monitor "deploy-status" from plugin deploy-tools references ${user_config.*} in its command. The substituted value would be passed to a shell. Monitor commands cannot safely reference ${user_config.*}; have the monitor script read the value from a config file or prompt instead.
```

MCP `headersHelper` は以下を報告します：

```text theme={null}
headersHelper for MCP server 'internal-api' references ${user_config.*}. The substituted value would be passed to a shell; read the value inside the helper script instead (e.g. from an env var set in the server's "env" block).
```

**対処方法：**

* フックの場合、`args` 配列を追加して、[exec 形式](https://code.claude.com/docs/ja/hooks.md#exec-form-and-shell-form)で実行されるようにします。ここで、各 `${user_config.KEY}` は、その間にシェルがない 1 つの引数になります。または参照をドロップし、スクリプト内から `$CLAUDE_PLUGIN_OPTION_<KEY>` 環境変数を読み取ります
* モニターの場合、参照をドロップし、モニタースクリプトに設定ファイルから値を読み取らせます
* `headersHelper` の場合、`${user_config.KEY}` をサーバーの `headers` フィールドに移動します。これはシェル解析されません。または、ヘルパースクリプト内から値を読み取ります

### プラグインアーカイブの整合性チェックが失敗しました

原因と修正方法については、[プラグインのトラブルシューティングにおけるこのメッセージ](https://code.claude.com/docs/ja/plugins/troubleshooting.md#plugin-archive-integrity-check-failed)を参照してください。

### パスがプラグインディレクトリをエスケープします

プラグインのコンポーネントパスの 1 つがプラグインディレクトリの外を指しているか、ディレクトリ内にあることを確認できなかったため、Claude Code はそのパスをドロップし、プラグインの残りを読み込みます。プラグインが `plugin.json` またはその[マーケットプレイスエントリ](https://code.claude.com/docs/ja/plugins/marketplace-reference.md#plugin-entries)で宣言したパスの場合、メッセージ内のコンポーネント名（`commands` や `hooks` など）は、そのパスを宣言したフィールドを示します。

```text theme={null}
commands path escapes plugin directory: ./../shared.md
```

`claude plugin` コマンド出力では、同じエラーは `Path escapes plugin directory: ./../shared.md (commands)` と読みます。

Claude Code は、`../shared-utils` のように書かれたプラグイン外を指すパスと、プラグイン外に導くシンボリックリンク（[マーケットプレイスシンボリックリンクルール](https://code.claude.com/docs/ja/plugins/host-marketplace.md#share-files-within-a-marketplace-with-symlinks)が許可するものではない）の両方を拒否します。シンボリックリンクの場合、メッセージはパスが解決される場所も示します：

```text theme={null}
commands path escapes plugin directory: ./commands/deploy.md — it resolves to /home/user/shared/deploy.md, outside the plugin directory
```

マーケットプレイスプラグイン自身のファイルのいずれか（`hooks/hooks.json` など）のフルパスを示すメッセージは、Claude Code がそのファイルをスキップしたことを意味します。Claude Code は、ファイルがプラグイン内にあること、または[ローカルマーケットプレイス](https://code.claude.com/docs/ja/plugins/loading.md#in-place-and-copied-plugins)内のプラグインの場合はそのマーケットプレイス内にあることを確認できない場合、そのファイルをスキップします。メッセージでは、これらのファイルが次に示すコンポーネント名の下に報告されます:

* `hooks/hooks.json`：`hooks`
* `monitors/monitors.json`：`monitors`
* プラグインルートの `SKILL.md`：`skills`

例えば、次のメッセージは、プラグインとそのローカルマーケットプレイスの両方の外に解決される `hooks/hooks.json` に対するものです：

```text theme={null}
hooks path escapes plugin directory: /home/user/my-marketplace/my-plugin/hooks/hooks.json — it resolves to /home/user/dotfiles/hooks.json, outside the plugin directory and its marketplace directory
```

macOS と Linux では、Claude Code はコンポーネントパスにバックスラッシュが含まれているパスも拒否します。パスがプラグイン内に留まる場合でも。Windows スタイルのセパレータを使用するコンポーネントパスを持つプラグインは Windows で読み込まれ、他のプラットフォームでこの拒否をトリガーします：

```text theme={null}
commands path escapes plugin directory: ./commands\deploy.md — its path contains a backslash, which is not resolved reliably on this platform
```

v2.1.251 より前では、Claude Code はマーケットプレイスエントリで宣言された `commands` パスを、プラグインディレクトリの外を指していても読み込みました。

v2.1.257 より前では、プラグインが宣言するパスに対するチェックはパスのスペルのみを調べ、シンボリックリンクが導く場所は調べませんでした。

**対処方法：**

* プラグインをインストールしただけでメンテナンスしていない場合は、メッセージをその作成者に報告してください
* プラグインが宣言するパスの場合は、参照されたファイルをプラグインディレクトリ内に移動し、`./` 相対パスでそれを指してください
* パス、またはプラグイン内でその上位にあるフォルダが、プラグイン外に導くシンボリックリンクである場合は、シンボリックリンクをそのリンク先のコピーに置き換えてください
* プラグインが宣言するパスにバックスラッシュが含まれているとメッセージが示す場合は、パスをスラッシュで書いてください。例えば `./commands/deploy.md`
* メッセージが `EACCES` で終わる場合は、パスが示すファイルまたはフォルダに至るすべてのディレクトリに対する実行権限を復元してください。パスの上位のディレクトリを確認し、次に到達した各シンボリックリンクをたどって、そのリンク先に至るディレクトリを確認します。その他のエラーコードについては、[チェックできなかったパスの原因と手順](#path-could-not-be-checked)で確認してください。
* 同じマーケットプレイス内の他のプラグインとファイルを共有するには、プラグインディレクトリ内のシンボリックリンクでそれらをリンクし、[シンボリックリンクルール](https://code.claude.com/docs/ja/plugins/host-marketplace.md#share-files-within-a-marketplace-with-symlinks)に従ってください

### サーバーファイルのパスが読み取られませんでした

`path not read` メッセージは、プラグインが指定する MCP または LSP サーバーファイルを、そのファイルのパスが原因で Claude Code が読み取らなかったことを意味します。プラグインの残りの部分は、そのファイルが定義するサーバーを除いて読み込まれます。

次の例のように、パスがプラグイン内に留まる場合でも、`..` を含む部分は対象になります：

```text theme={null}
mcp-servers path not read: ./sub/../x.json is absolute or has a ".." part
```

**対処方法：**

* プラグインをインストールしただけでメンテナンスしていない場合は、メッセージをその作成者に報告してください
* プラグインをメンテナンスしている場合は、サーバーファイルをプラグインディレクトリ内に置いてください。マニフェストまたはマーケットプレイスエントリでは、`./` で始まり `..` を含まないパス（例：`./servers/x.json`）で指定してください
* 同じマーケットプレイス内のプラグイン間で 1 つのサーバーファイルを共有するには、[シンボリックリンクルール](https://code.claude.com/docs/ja/plugins/host-marketplace.md#share-files-within-a-marketplace-with-symlinks)に従い、シンボリックリンクでそのファイルを各プラグインにリンクしてください

### Plugin not loaded: its manifest was not read

Claude Code は、マーケットプレイスプラグインの `.claude-plugin/plugin.json` にある[マニフェスト](https://code.claude.com/docs/ja/plugins/manifest-reference.md)がプラグイン内にあることを確認できなかったため、そのプラグインから何も読み込みません。[ローカルマーケットプレイス](https://code.claude.com/docs/ja/plugins/loading.md#in-place-and-copied-plugins)内のプラグインの場合、Claude Code はマニフェストがそのマーケットプレイス内にあることも確認できませんでした。メッセージは `/plugin` の **Errors** タブに表示され、末尾の理由が Claude Code の検出内容を示します。

例えば、次のメッセージは、`.claude-plugin` フォルダがマーケットプレイス外に導くシンボリックリンクになっている、ローカルマーケットプレイス内のプラグインに対するものです：

```text theme={null}
Plugin not loaded: its manifest /home/user/my-marketplace/my-plugin/.claude-plugin/plugin.json was not read, because it resolves to /home/user/dotfiles/my-plugin/.claude-plugin/plugin.json, outside the plugin directory and its marketplace directory
```

**対処方法：**

* 理由が `EACCES` で終わる場合は、マニフェストに至るすべてのディレクトリに対する実行権限を復元してください。マニフェストの上位のディレクトリを確認し、次に到達した各シンボリックリンクをたどって、そのリンク先に至るディレクトリを確認します。その他のエラーコードについては、[チェックできなかったパスの原因と手順](#path-could-not-be-checked)で確認してください。
* プラグインをメンテナンスしていて、理由にマニフェストの解決先が示されている場合、`.claude-plugin` フォルダまたは `plugin.json` 自体が、そこへ導くシンボリックリンクです。そのリンクをリンク先のコピーに置き換えてください。
* プラグインをインストールしただけでメンテナンスしていない場合は、メッセージをその作成者に報告してください

### パスをチェックできませんでした

Claude Code はプラグインパスが存在するかどうかをオペレーティングシステムに尋ね、「見つかりません」以外のエラーを取得したため、パスが名前を付けるものを読み込みません。プラグインの読み込み量は、どのパスが失敗したかによって異なります：

* プラグインの[デフォルトコンポーネント位置](https://code.claude.com/docs/ja/plugins/manifest-reference.md#standard-layout)の 1 つ（`skills/` フォルダ、`monitors/monitors.json` ファイル、またはプラグインルートの [`SKILL.md`](https://code.claude.com/docs/ja/plugins/components#skills)）：プラグインの他のコンポーネントは引き続き読み込まれます
* プラグイン自体のディレクトリ：そのプラグインから何も読み込まれません

`/plugin` では、エラーにパスとオペレーティングシステムが返したコードが示されます：

```text theme={null}
skills path couldn't be checked: /home/user/my-plugin/skills (ELOOP)
```

`claude plugin list` では、同じエラーは `Path not found: /home/user/my-plugin/skills (skills, ELOOP)` と読みます。

このエラーを生成する原因には以下が含まれます：

* `ELOOP`：パス内のシンボリックリンクが自分自身を指すか、ループを形成します
* `EIO` または `ESTALE`：パスは壊れているか古いネットワークマウント上にあります
* `EACCES`：パスの上のディレクトリの 1 つがそれを横断する権限を拒否します

**対処方法：**

* 自分自身を指すシンボリックリンクを実フォルダに置き換えるか、削除してください
* パスがネットワークマウント上にある場合は、共有を再マウントしてください
* コードが `EACCES` の場合は、パスの上のディレクトリに対する実行権限を復元してください
* パスを修正した後、`/reload-plugins` を実行するか、Claude Code を再起動して、プラグインまたはコンポーネントを読み込んでください

v2.1.265 より前では、Claude Code はチェックできないデフォルトコンポーネントフォルダを存在しないものとして扱い、エラーなしでそのコンポーネントなしでプラグインを読み込みました。

### マーケットプレイスエントリパスはマーケットプレイスディレクトリ内に留まりません

プラグインの[マーケットプレイスエントリ](https://code.claude.com/docs/ja/plugins/marketplace-reference.md#plugin-entries)は、Claude Code がマーケットプレイス自体のディレクトリ内の位置に解決できないソースパスを宣言するため、プラグインはインストールまたは読み込まれません。拒否は以下をカバーします：

* 絶対的なエントリパス、`..` でマーケットプレイスから登ります、またはネットワークパスのようにスペルされています
* macOS と Linux では、先頭の `./` の後のどこかにバックスラッシュを含むエントリパス
* git または URL などのリモートソースから取得されたマーケットプレイス内のエントリ。マーケットプレイスディレクトリの外に解決するシンボリックリンクを通じてターゲットに到達します
* マーケットプレイスの `marketplace.json` への直接 URL から追加された相対エントリ：Claude Code はそのファイルのみをダウンロードするため、パスが名前を付けるローカルプラグインファイルは存在しません。[相対パスを持つプラグインが URL ベースのマーケットプレイスで失敗します](https://code.claude.com/docs/ja/plugins/troubleshooting.md#plugins-with-relative-paths-fail-in-url-based-marketplaces)を参照してください

`claude plugin install` は拒否を次のように報告します：

```text theme={null}
Cannot install my-plugin@my-marketplace: its marketplace entry path does not stay inside the marketplace directory (an absolute, climbing, network-shaped, backslash-containing or link-traversing entry, an entry of a fetched marketplace that resolves or opens outside its tree — or a relative entry in a url-catalog marketplace, which has no local directory)
```

既にインストールされているプラグインのエントリが同じチェックに失敗する場合、`claude plugin list` はプラグインを `failed to load` として表示します：

```text theme={null}
Plugin source path refused: ./my-plugin does not stay inside its marketplace directory. Check that the marketplace entry has a plain relative path.
```

**対処方法：**

* マーケットプレイスを維持する場合は、エントリの `source` を `./plugins/my-plugin` などの単純な相対パスとして書き、それが横断するシンボリックリンクをマーケットプレイスディレクトリ内を指すようにしてください
* マーケットプレイスを直接 URL から追加した場合、相対エントリは解決できません。マーケットプレイス作成者に[別のプラグインソース](https://code.claude.com/docs/ja/plugins/marketplace-reference.md#plugin-sources)を使用するよう依頼するか、代わりに git リポジトリからマーケットプレイスを追加してください

### マーケットプレイス設定の読み込みに失敗しました

Claude Code は、`~/.claude/plugins/known_marketplaces.json` のレジストリファイルに追加したプラグインマーケットプレイスを保持します。`claude plugin install` などのレジストリが必要なプラグインコマンドは、Claude Code がファイルを使用できない場合、2 つのメッセージのいずれかで失敗します：

* `Failed to load marketplace configuration`：ファイルは存在しますが、有効な JSON ではないか、読み取ることができません。空のファイルもこの方法で失敗します。
* `Marketplace configuration file is corrupted`：ファイルは有効な JSON ですが、その内容はレジストリスキーマと一致しません。

空のファイルの場合、`claude plugin install` は以下を報告します：

```text theme={null}
✘ Failed to install plugin "my-plugin": Failed to load marketplace configuration: JSON Parse error: Unexpected EOF
```

v2.1.246 より前では、`claude plugin install` はこの失敗を報告しませんでした。

**対処方法：**

* `~/.claude/plugins/known_marketplaces.json` を開き、JSON を修復するか、メッセージが名前を付けるエントリをレジストリスキーマと一致するように修正してください
* 修復できない場合は、ファイルを削除するか、その内容を `{}` に置き換えてから、`claude plugin marketplace add <source>` で各マーケットプレイスを再度追加してください。Claude Code は、信頼したフォルダで次回起動するときに、ユーザーまたは管理設定が [`extraKnownMarketplaces`](https://code.claude.com/docs/ja/settings-reference#extraknownmarketplaces) で宣言するマーケットプレイスを再登録します。

### プラグインは組織で必須です

`claude plugin disable` を実行するか、`/plugin` **Installed** タブを使用して、組織が必須としてマークする [claude.ai から同期されたプラグイン](https://code.claude.com/docs/ja/plugins/loading.md#synced-plugins)をオフにしました：

```text theme={null}
Plugin "<name>@synced" is required by your organization and can't be disabled here. Contact your admin to change it.
```

Claude Code は何も保存せず、プラグインは有効なままです。

必須プラグインが依存するプラグインを無効にしようとすると、Claude Code は同じ方法で拒否し、それを必要とする必須プラグインに名前を付けるメッセージを表示します。

**対処方法：**

* claude.ai 組織の管理者に、プラグインの必須ステータスを claude.ai で変更するよう依頼してください

### プラグインはアンインストールされませんでした

[`claude plugin uninstall`](https://code.claude.com/docs/ja/plugins/cli-reference#plugin-uninstall)を実行するか、`/plugin` **Installed** タブで **Uninstall** を選択し、アンインストールは `"<plugin>" was not uninstalled:` で始まるメッセージで停止しました。そのコロンの後のテキストが設定ファイルの名前ではなく `installed_plugins.json` で始まる場合、原因は `installed_plugins.json` 内のこのバージョンの Claude Code が読み取ることができないコンテンツです。その形式については、[`installed_plugins.json` はこのバージョンが読み取ることができないレコードを保持しています](https://code.claude.com/docs/ja/plugins/troubleshooting#installed-plugins-json-holds-a-record-this-version-cannot-read)を参照してください。

Claude Code がプラグインのエントリを `enabledPlugins` から削除し、そのスコープの設定ファイルを読み直したとき、プラグインはそこでまだオンに切り替えられたか、それをオンに切り替えることができるファイルを読み取ったり確認したりできませんでした。プラグインの保存されたオプション、シークレット、およびデータを削除しながら、設定エントリがそれをオンに切り替えることができるのは、それらを失うことになるため、アンインストールは代わりに停止します：プラグインはインストールされたままで、保存されたものは削除されません。

```text theme={null}
✘ Failed to uninstall plugin "formatter": "formatter" was not uninstalled: it is still switched on in /home/user/project/.claude/settings.local.json, although the settings change reported no error. It is still installed. Take it out of "enabledPlugins" in that file yourself, then uninstall it again.
```

メッセージの中央はファイルと原因に名前を付けます：

* `it is still switched on in <file>, although the settings change reported no error`：設定の書き込みは成功を報告しましたが、エントリはファイルを読み直すときにまだそこにあります
* `it is still switched on in <file>, and the settings change failed (<error>)`：ファイルを保存できませんでした。括弧内の理由のため
* `<file> is there and could not be read`：ファイルは存在しますが、設定として読み取ることができませんでした。例えば、有効な JSON ではないため、プラグインを有効にしたままの可能性があります
* `<file> (not read: it is on a network path or is a link to one, or could not be checked)`：Claude Code はプロジェクトまたはローカル設定ファイルを読み取りませんでした。ファイル、またはそれを保持する `.claude` フォルダは、ネットワークの場所にリンクしているか、そのパスを調べることができなかったためです

`claude plugin uninstall` は終了コード 1 で、`--json` を使用すると結果は `failureCode: "settings_still_on"` を含みます。`/plugin` は同じメッセージを表示します。

**対処方法：**

* メッセージの最後の文に従ってください：それが名前を付ける設定ファイルを修復または置き換えるか、そのファイルの `enabledPlugins` からプラグインのエントリを自分で削除してから、アンインストールを再度実行してください

### Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)

このメッセージは、Claude Code が stdio の[プラグインが提供する MCP サーバー](https://code.claude.com/docs/ja/mcp.md#plugin-provided-mcp-servers)を起動しなかったことを意味します。そのサーバーへの接続が 15 分以内に失敗していたためです：

```text theme={null}
Skipping connection (recent failure cached; retries automatically in 15 min, or edit the plugin config to retry now)
```

セッションはそのサーバーのツールなしで続行され、15 分が経過しても Claude Code はそのセッション内でサーバーへの接続を再試行しません。直近の接続失敗から 15 分以上経ってから新しいセッションまたは [`claude -p`](https://code.claude.com/docs/ja/headless) の実行を開始すると、Claude Code はサーバーへの接続を再試行します。

**対処方法：**

待たずに Claude Code にサーバーへの接続を再試行させるには：

* **対話型セッションの場合**：`/mcp` を実行し、サーバーを選択して **Reconnect** を選択します
* **[Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) アプリケーションの場合**：TypeScript では [`reconnectMcpServer()`](https://code.claude.com/docs/ja/agent-sdk/typescript#methods)、Python では [`ClaudeSDKClient.reconnect_mcp_server()`](https://code.claude.com/docs/ja/agent-sdk/python#methods) を、サーバー名を指定して呼び出します
* **`claude -p` の場合**：実行時と同じマシン、同じオペレーティングシステムアカウント、同じ [`CLAUDE_CONFIG_DIR`](https://code.claude.com/docs/ja/env-vars) の値で、同じプラグインを読み込む対話型セッションを開始します。そこで `/mcp` からサーバーを再接続します。接続できたら、Claude Code は次回の実行で接続を試みます。
* **プラグインを開発している場合**：プラグインの `.mcp.json` または `plugin.json` で、サーバーの `command`、`args`、または `env` を変更します。Claude Code は、変更されたエントリを読み込む次のセッションまたは `claude -p` の実行で接続を試みます。

このメッセージは、失敗した接続のエラーの代わりに表示されます。新しい試行も失敗した場合、Claude Code はこのメッセージではなく、その試行のエラーを報告します。

## ツールエラー

これらのエラーは Claude のツール呼び出しから発生します。Claude はほとんどのツールエラーを自動的に修正します。変更が必要な場合、そのエラーの **What to do** リストに何を変更するかが記載されています。

### No such tool available

Claude が、セッションのツールリストにない名前でツールを呼び出しました。Claude Code はそのエラーをツール呼び出しの結果として Claude に返し、ターンは続行します。ツールが存在しない理由を Claude Code が判断できる場合は、2 行目のように、ツール名の後に理由や代わりに呼び出すべきツールを示す文を追加します。

```text theme={null}
Error: No such tool available: <tool name>
Error: No such tool available: read. Tool names are case-sensitive: call Read instead.
```

セッションを再開した直後は、Claude が MCP サーバーのツールを呼び出した時点で、そのサーバーがまだ最初の接続試行中である場合があります。その場合、Claude Code は [サーバーを待機](https://code.claude.com/docs/ja/mcp.md#tool-availability) し、待機が終了してもツールが利用できない場合にこのエラーを返します。v2.1.284 より前は、このような呼び出しは待機せずにすぐに失敗していました。

Claude Code が [200 文字に切り詰めた](#tool-use-name-over-200-characters) ツール名での呼び出しも、このエラーで失敗します。

**What to do:**

* 1 回だけ発生した場合は、何もする必要はありません。Claude がエラーを読み取り、ターンは続行します。
* MCP サーバーのツールへの呼び出しがこのエラーで失敗し続ける場合は、セッション内で `/mcp` を実行するか、シェルで `claude mcp list` を実行してサーバーの [ステータス](https://code.claude.com/docs/ja/mcp.md#server-status) を確認し、失敗したサーバーを `/mcp` から再接続します。Agent SDK では、[エラー処理](https://code.claude.com/docs/ja/agent-sdk/mcp.md#error-handling) を参照してください。

### MCP server connection closed before the tool call was answered

HTTP [MCP サーバー](https://code.claude.com/docs/ja/mcp.md) または [claude.ai コネクタ](https://code.claude.com/docs/ja/mcp.md#use-mcp-servers-from-claude-ai) へのツール呼び出しで、サーバーが応答する前に接続が失われたため、Claude Code はツールが実行されたかどうかを判断できません。

```text theme={null}
MCP server "<name>" connection closed before the tool call was answered. The tool may have run: check whether it did before running it again.
```

呼び出しを繰り返すと、2 つ目の issue の作成など、ツールのアクションが繰り返される可能性があります。そのため Claude Code は、サーバーがそのツールを繰り返しても安全であるとマークしている場合に限り、呼び出しを自動的に 1 回だけ繰り返します。

**What to do:**

* ツールが操作するサービスで、アクションが実行されたかどうかを確認します。例えば、作成されるはずだった issue やレコードが存在するかどうかを確認します
* アクションが実行されていた場合は、ツールを再度実行しないでください。Claude はツールの結果の代わりにこのメッセージを受け取ったため、結果を Claude に伝えてください。
* アクションが実行されていなかった場合は、Claude にツールを再度実行するよう依頼します。Claude Code はそのサーバーのツールへの次の呼び出し時にサーバーへ再度接続するため、事前にサーバーを再接続する必要はありません。その接続も失敗する場合は、[リモートサーバーのセッション中の切断](https://code.claude.com/docs/ja/mcp.md#mid-session-drops-of-a-remote-server) を参照してください。
* サーバーを自分でビルドしていて、ツールを 2 回呼び出しても安全な場合は、[繰り返しても安全であるとマーク](https://code.claude.com/docs/ja/mcp.md#tool-calls-pending-when-a-connection-closes) して、Claude Code が失われた呼び出しを繰り返せるようにします

### MCP server is disabled

ツール結果にこのメッセージが含まれている場合、Claude が [オフになっている](https://code.claude.com/docs/ja/mcp.md#disable-a-server-without-removing-it) [MCP サーバー](https://code.claude.com/docs/ja/mcp.md) のツールを呼び出したことを意味します。Claude Code はサーバーに接続しなかったため、ツールは実行されず、Claude は結果の代わりにこのテキストを受け取りました。

```text wrap theme={null}
MCP server "<name>" is disabled — re-enable it via /mcp to use its tools
```

**What to do:**

* サーバーを意図的にオフにした場合は、何もする必要はありません
* Claude がサーバーのツールを必要とする場合は、Claude Code のプロンプトで `/mcp` からサーバーをオンに戻します
* [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) アプリケーションでは、TypeScript では `enabled` を `true` に設定して [`toggleMcpServer()`](https://code.claude.com/docs/ja/agent-sdk/typescript#togglemcpserver) を呼び出し、Python では `enabled` を `True` に設定して [`toggle_mcp_server()`](https://code.claude.com/docs/ja/agent-sdk/python#claudesdkclient) を呼び出して、サーバーをオンに戻します

### MCP tool call timed out with the server's question unanswered

[非対話モード](https://code.claude.com/docs/ja/headless.md) で、[MCP サーバー](https://code.claude.com/docs/ja/mcp.md) がツール呼び出し中に [elicitation](https://code.claude.com/docs/ja/mcp.md#respond-to-mcp-elicitation-requests) を通じて入力を求めましたが、回答が届く前に呼び出しの制限時間が切れました。

```text theme={null}
MCP server "<name>" tool "<tool>" timed out after <N>s. The server asked the user a question, and no answer came before the time limit. Do not call this tool again in this turn. Tell the user that the server's question got no answer, and wait for their reply.
```

v2.1.310 より前は、結果は `timed out after <N>s` で終わり、質問については何も示されませんでした。

**What to do:**

* サーバーのリクエストに回答する [`Elicitation` フック](https://code.claude.com/docs/ja/hooks#elicitation) を設定します
* TypeScript Agent SDK アプリケーションでは、[`onElicitation`](https://code.claude.com/docs/ja/agent-sdk/typescript#options) コールバックが制限時間内に回答を返すようにします
* 回答までの時間を延ばすには、サーバーの設定エントリでより長い [`timeout`](https://code.claude.com/docs/ja/mcp#time-limits-on-mcp-tool-calls) をミリ秒単位で設定します（例えば、10 分の場合は `"timeout": 600000`）
* 代わりに対話セッションでタスクを実行し、サーバーの [ダイアログ](https://code.claude.com/docs/ja/mcp.md#respond-to-mcp-elicitation-requests) に自分で回答します

### Permission prompt tool returned an invalid result

[`--permission-prompt-tool`](https://code.claude.com/docs/ja/cli-reference#cli-flags) に渡したツールが Claude Code で読み取れない回答を返したため、その回答を待っていたツール呼び出しは、回答が呼び出しを許可していた場合でも実行されませんでした。

```text wrap theme={null}
Permission prompt tool returned an invalid result. Expected a single text block param with type="text" and a string text value.
```

**What to do:**

* テキストが `{"behavior": "allow"}` または `{"behavior": "deny", "message": "<reason>"}` であるテキストブロックを 1 つ返します。入力を変更するには、`allow` オブジェクトに `updatedInput` を追加します。v2.1.86 から v2.1.206 までは、入力を保持するために `allow` に `"updatedInput": {}` が必要でした。
* [`structuredContent`](https://code.claude.com/docs/ja/agent-sdk/custom-tools#return-structured-data) を返さないでください。これは使用している MCP SDK が自動的に追加する場合があります。例えば、ツールを次のように登録します。
  * **`mcp.server` の `FastMCP` または `MCPServer`**: `structured_output=False` を指定します
  * **`fastmcp` の `FastMCP`**: `output_schema=None` を指定し、文字列を返します
  * **MCP TypeScript SDK**: `outputSchema` を指定しません
* 約 40 KB 以上の入力でのみエラーが発生する場合は、入力を `updatedInput` や拒否の `message` にコピーしないでください。それほど大きな入力を変更するには、[プロンプトツールの出力制限を引き上げます](https://code.claude.com/docs/ja/mcp.md#raise-the-limit-for-a-specific-tool)。

### Agent would be spawned with zero tools

サブエージェントの [`tools` リスト](https://code.claude.com/docs/ja/sub-agents#supported-frontmatter-fields) のすべてのエントリが使用可能なツールと一致しなかったため、Claude Code はサブエージェントの起動を拒否しました。ツールがないと、サブエージェントは動作できません。メッセージはエントリを何が問題かでグループ化します。

* **Unrecognized**: エントリがツール名と一致しません。通常は `Grpe` のような `Grep` のタイプミスです。
* **Not available to subagents**: エントリが [サブエージェントが使用できない](https://code.claude.com/docs/ja/sub-agents.md#available-tools) 実際のツールを指定しています。バックグラウンドサブエージェントはより小さい組み込みツールセットを保持しているため、フォアグラウンドサブエージェントのみが使用できるエントリは、サブエージェントがバックグラウンドで実行される場合（これがデフォルトです）、ここに表示されます。`Agent` をリストする場合、メッセージは代わりに次のグループの下に報告します。
* **Matched no tools in this session**: エントリは有効ですが、現在のセッションのツールが今すぐそれと一致しません。例えば、GitHub MCP サーバーが接続されていない `mcp__github__*` や、[深さ制限](https://code.claude.com/docs/ja/sub-agents.md#let-subagents-spawn-their-own-subagents) にあるサブエージェントの `Agent` などです。

`tools` フィールドを省略することは、この拒否をトリガーしません。`tools` リストを空のままにするか、`disallowedTools` がそれ内のすべてのエントリを削除する場合、Claude Code も拒否をスキップし、ツールなしでサブエージェントを起動します。

v2.1.208 より前は、サブエージェントはツールなしで起動し、空または混乱した結果を返す可能性がありました。

```text theme={null}
Agent 'code-reviewer' would be spawned with zero tools — refusing. Its tools list resolved to nothing: unrecognized [Grpe]. Fix the agent's tools frontmatter or pass a different subagent_type.
```

**What to do:**

* エラーが指定する各エントリを [サブエージェントが利用可能なツール](https://code.claude.com/docs/ja/sub-agents.md#available-tools) に対して修正します
* セッションが持たないツールのエントリを削除します。例えば、接続されていないサーバーからの MCP ツール
* エントリが接続済みの MCP サーバーを指定している場合は、エントリを、そのサーバーの [ツール名](https://code.claude.com/docs/ja/permissions.md#mcp) に綴られているサーバー名（例えば `mcp__reports__v2__get_totals` の `reports__v2`）と比較します。そのサーバーには、`mcp__reports__v2__*`、つまり `mcp__` の後に名前全体と `__*` を続けたものを記述します。`reports` という名前のサーバーを指す短い `mcp__reports` では、サブエージェントは `reports__v2` のツールを 1 つも取得しません
* [バックグラウンドサブエージェントが削除する](https://code.claude.com/docs/ja/sub-agents.md#available-tools) ツール（例えば `CronCreate`）の場合、エントリを削除します
* 代わりに `CronCreate` などのツールを保持するには、[Claude にサブエージェントを待機させます](https://code.claude.com/docs/ja/sub-agents.md#let-claude-wait-for-a-subagent)。Claude が待機するサブエージェントはフォアグラウンドで実行され、ツールを保持するためです。定義で `background: true` が設定されている場合は、サブエージェントがバックグラウンドのままになるため、先にそのフィールドを削除します
* `tools` フィールドを削除して、サブエージェントに [サブエージェントが利用可能なすべてのツール](https://code.claude.com/docs/ja/sub-agents.md#available-tools) を与えます
* `Agent` のみを含む `tools` リストの場合、[深さ制限](https://code.claude.com/docs/ja/sub-agents.md#let-subagents-spawn-their-own-subagents) を上げるか、エージェントに少なくとも 1 つの他のツールを与えます。Claude Code はその制限で `Agent` を保留するため、リストに他に何もない場合、ツールに解決されません

### File is covered by a Read deny rule

Edit または Write ツールが [`Read` 拒否ルール](https://code.claude.com/docs/ja/permissions#read-and-edit) と一致するパスで呼び出されました。これには、そのパスで新しいファイルを作成することも含まれます。両方のツールは Claude が読み戻す必要があるコンテンツを変更するため、Claude Code はファイルアクセスの前に呼び出しを拒否します。NotebookEdit は `Read` 拒否ルールの対象ではありません。v2.1.228 より前は、ルールは Edit ツールのみをブロックし、v2.1.208 より前は、`Edit` 拒否ルールのみが編集をブロックしました。

```text theme={null}
File is covered by a Read deny rule in your permission settings and cannot be edited.
```

Claude Code が Write ツールを拒否する場合、メッセージは代わりに `and cannot be written` で終わります。

**What to do:**

* Claude がファイルを変更できるべき場合、`/permissions` または [設定](https://code.claude.com/docs/ja/settings-reference.md#permission-settings) の `Read` 拒否ルールを削除または縮小します
* ファイルが変更されないままである必要がある場合、ルールを保持し、NotebookEdit ツールもブロックするために同じパスの `Edit` 拒否ルールを追加します

### Setting blocks writes outside the working directories

Claude がファイルを書き込もうとしてツール呼び出しがこのメッセージで失敗した場合、そのパスはセッションの [作業ディレクトリ](https://code.claude.com/docs/ja/permissions.md#working-directories) の外にあり、[`permissions.blockWritesOutsideWorkingDirectories`](https://code.claude.com/docs/ja/settings-reference#permissions-blockwritesoutsideworkingdirectories) がオンになっています。

```text wrap theme={null}
<path> is outside <dirs>; the permissions.blockWritesOutsideWorkingDirectories setting blocks writes outside the working directories. Ask the user to add the directory with /add-dir, or to remove that setting.
```

Claude Code はどの権限モードでもその書き込みを拒否します。拒否メッセージは次のようになる場合もあります。

```text wrap theme={null}
<path>: Writes outside the working directories are blocked (permissions.blockWritesOutsideWorkingDirectories). Add the directory with /add-dir, or remove that setting.
```

**What to do:**

* Claude がそこに書き込むべきでない場合は、何もしません
* パスを含む既存のディレクトリへの書き込みを Claude に許可するには、Claude Code のプロンプトで `/add-dir <directory>` を実行するか、Claude Code の起動時に `--add-dir <directory>` を渡します
* パスが `~/.claude/settings.json` などの Claude Code の設定ファイルである場合は、自分で編集します。`/add-dir` でそのディレクトリを追加しても解決しません。その場合、Claude Code はその書き込みを [設定ファイルとして](#writes-to-claude-code-settings-files-are-blocked) 拒否するためです。
* すべてのセッションでディレクトリを書き込み可能にしておくには、ユーザー設定または管理設定の [`permissions.additionalDirectories`](https://code.claude.com/docs/ja/settings-reference#permissions-additionaldirectories) にそのディレクトリを記載します
* `permissions.blockWritesOutsideWorkingDirectories` をオフにするには、それを設定しているすべての設定ファイルから削除してから、Claude Code を再起動します
* どの設定ファイルにも `permissions.blockWritesOutsideWorkingDirectories` がない場合は、`--settings` またはホストアプリケーションから設定されている可能性があります。また、Claude Code は [管理設定](https://code.claude.com/docs/ja/managed-settings.md#keys-that-fail-closed) の `permissions` を読み取れない間も、これらの書き込みを拒否します。セッションを起動または管理している担当者に問い合わせてください。

### Writes to Claude Code settings files are blocked

Claude がファイルを書き込もうとしてツール呼び出しがこのメッセージで失敗した場合、Claude Code はそのファイルを自身の設定ファイルの 1 つとして扱っており、[`permissions.blockWritesOutsideWorkingDirectories`](https://code.claude.com/docs/ja/settings-reference#permissions-blockwritesoutsideworkingdirectories) がオンになっています。

```text wrap theme={null}
<path>: Writes to Claude Code settings files are blocked while permissions.blockWritesOutsideWorkingDirectories is on, because a settings file can lift that block. While a managed settings folder cannot be resolved, any .json file counts as one.
```

**What to do:**

* 設定を変更するには、設定ファイルを自分で編集します
* Claude が再び設定ファイルを編集できるようにするには、`permissions.blockWritesOutsideWorkingDirectories` を設定しているすべての設定ファイルからそれを削除してから、Claude Code を再起動します
* ファイルが自分の設定ファイルではない場合は、Claude Code が設定ファイルとして扱う他のファイルの中から探します。
  * **`--agents` または `--mcp-config` に渡したファイル**: 自分で編集します
  * **[サーバー管理設定](https://code.claude.com/docs/ja/server-managed-settings.md#security-considerations) の保存されたコピーと、それと一緒に保持されるファイル**: サーバー管理設定で設定を変更するよう [Owner](https://code.claude.com/docs/ja/server-managed-settings.md#access-control) に依頼します。
  * **Claude Code が [`managed-settings.d/`](https://code.claude.com/docs/ja/managed-settings#split-a-file-based-policy-across-teams) フォルダの参照先を特定できない間の、任意の `.json` ファイル**: そのフォルダを確認するよう管理者に依頼します

### Path cannot contain null bytes

ファイルツール呼び出しのパスまたはパターン引数に null バイトが含まれていました。ファイルシステムと検索ツールはこれを受け入れることができません。Read、Write、Edit、NotebookEdit、Glob、Grep はこれをチェックし、メッセージはツールと引数を指定します。

```text theme={null}
Read file_path cannot contain null bytes (\0). Remove the null byte and try again.
```

ツール呼び出しは失敗し、Claude はエラーを見て、ターンは続きます。

**What to do:**

* ユーザー側で行う必要のある操作はありません。エラーはツールの結果として Claude に返され、メッセージ自体が Claude に null バイトを削除して再度試すよう指示します

v2.1.281 より前は、Read、Write、Edit、または NotebookEdit パスの null バイトがターン全体を `Path contains null bytes` という名前のエラーで終了し、ツールは実行されませんでした。

### Command contains an invisible character

[PowerShell ツール](https://code.claude.com/docs/ja/tools-reference.md#powershell-tool) が、U+FEFF または U+180E を含むコマンドの実行を拒否しました。

```text theme={null}
Error: command contains the invisible character U+FEFF (byte order mark) or U+180E (Mongolian vowel separator), and was not run. Remove the character, keep the text that needs it in a file that the command reads, or write it as $([char]0xFEFF) or $([char]0x180E) inside a double-quoted string
```

**What to do:**

* **Claude が書いたコマンドの場合**: 修正する必要はありません。メッセージが Claude にコマンドの書き直し方を伝えます。
* **スキルまたはコマンドファイルの場合**: メッセージは `No shell command in <name> was run` の後に続きます。[文字の場所と削除方法](#no-shell-command-was-run) を参照してください。

### Claude Code の再起動後、承認済みのコマンドが実行されなかった

承認したシェルコマンドが実行されず、Claude はこのメッセージをコマンドの結果として受け取ります。

```text wrap theme={null}
This call was not run. Claude Code could not confirm that the shell is back in the directory where it was approved. That directory may be gone or replaced, lie outside the directory where the session started, or be one that Claude Code needs approval to enter or is not allowed to examine. The shell's directory is <directory>. If the command still makes sense, cd to the directory it was meant for and make the call again; it may need approval again.
```

メッセージの 3 番目の文は、代わりに `It does not keep track of that directory across a restart in a session that has been in a worktree.` となる場合もあります。

**What to do:**

* Claude に処理を続行させ、コマンドの再承認を求められた場合はプロンプトに応答します。

### File is too large to read as an image

Claude が [Read ツール](https://code.claude.com/docs/ja/tools-reference.md#read-tool-behavior) でファイルを画像として読み取ろうとしましたが、そのファイルは Read が画像ファイルから読み込める上限である 128 MB を超えています。何も読み取られず、Claude はこのエラーをツール結果として受け取ります。

```text wrap theme={null}
File is too large to read as an image (the limit is 128MB): <path>. If it is an image, resize it or export a smaller copy, then read that.
```

パスが通常のファイルではなくパイプまたはデバイスである場合、Read は 128 MB を超えるデータが届いた時点で読み取りを停止し、代わりに次のエラーを返します。

```text wrap theme={null}
Cannot read this as an image: <path> is a pipe or a device, not a regular file, and it sent more than 128MB without ending.
```

**What to do:**

* Claude が `File is too large` メッセージに従って、画像のサイズを変更したり、より小さいコピーを読み取ったりした場合は、何もする必要はありません
* Claude がエラーで停止した場合は、解像度を下げるなどして 128 MB 未満のコピーを自分でエクスポートし、そのファイルを Claude に指定します
* パスがパイプまたはデバイスだった場合は、代わりに通常の画像ファイルを Claude に指定します

### subagent\_type is required

```text theme={null}
subagent_type is required: the general-purpose agent is not available in this session. Available agents: ...
```

Claude は `subagent_type` なしで [Agent ツール](https://code.claude.com/docs/ja/tools-reference.md#agent-tool-behavior) を呼び出し、このセッションにはフォールバックする [汎用サブエージェント](https://code.claude.com/docs/ja/sub-agents.md#built-in-subagents) がありません。これは 2 つのセットアップの場合です。

* [`CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS=1`](https://code.claude.com/docs/ja/env-vars) は非対話モードで設定されており、すべての組み込みサブエージェントを削除します
* セッションのメインスレッドエージェントには [`tools: Agent(...)` 許可リスト](https://code.claude.com/docs/ja/sub-agents#restrict-which-subagents-can-be-spawned) があり、`general-purpose` を除外しています

**What to do:**

* 通常は何もしません。メッセージはセッションが持つサブエージェントをリストするため、Claude はそのうちの 1 つで再試行できます
* Claude が失敗し続ける場合、`tools: Agent(...)` 許可リストに `general-purpose` を追加するか、`CLAUDE_AGENT_SDK_DISABLE_BUILTIN_AGENTS` を設定解除します

v2.1.235 より前は、同じ呼び出しが `Agent type 'general-purpose' not found` で失敗しました。

### Memory index is over its read limit

Claude は [自動メモリ](https://code.claude.com/docs/ja/memory.md#auto-memory) インデックス `MEMORY.md` に書き込み、その読み取り制限の 1 つを超えたままにしました。200 行または 25KB です。書き込みは成功しましたが、最初の 200 行または 25KB のみ（どちらか先に来た方）がセッションの開始時に読み込まれるため、制限を超えるすべてのものはインデックスが読み込まれるたびに削除されます。v2.1.210 より前は、制限を超えたインデックスは書き込み時の信号なしで次の読み込み時に静かに切り詰められました。

```text theme={null}
Error: this write left the memory index at MEMORY.md at 214 lines, over its 200-line read limit. The write succeeded, but everything past the limit is silently dropped each time the index is loaded — entries at the end are already invisible to readers. Rewrite it to under 140 lines now: keep one line per entry, move detail into topic files, and merge or drop stale entries.
```

読み込まれるコンテンツのみが制限にカウントされます。YAML フロントマターとブロックレベルの HTML コメントはインデックスが読み込まれる前に削除されるため、測定から除外されます。v2.1.211 より前は、Claude Code は生ファイルを測定し、フロントマターまたはコメントは読み込まれたコンテンツが適合しても、このエラーをトリガーする可能性がありました。

Claude Code はエラーを書き込み後に Claude に配信するため、ターミナルにバナーとして出力されず、トランスクリプトでのみ気付く可能性があります。

Claude の書き込みがファイルを制限に近づけても超えない場合、Claude Code はこのエラーの代わりにインデックスをコンパクトにするための穏やかなリマインダーを返します。

**What to do:**

* Claude に `MEMORY.md` を書き直させるか、依頼します。エントリごとに 1 行を保持し、詳細をトピックファイルに移動し、古いエントリをマージまたは削除します
* インデックスを自分でトリミングするには、[メモリの監査と編集](https://code.claude.com/docs/ja/memory.md#audit-and-edit-your-memory) を参照してください

### pkill pattern matches the Claude Code process

Bash ツール呼び出しの `pkill` コマンドは、通常 `-f` を使用して、Claude Code プロセス自体と一致するパターンを使用したため、Claude Code はコマンドを実行してセッションを終了させるのではなく、コマンドを拒否します。Claude Code は `pkill` を実行する前に `pgrep` でパターンをテストし、独自のプロセス ID が結果に含まれている場合は拒否します。チェックは Linux でのみ実行されます。macOS では、`pkill` は変更されずに実行されます。v2.1.214 より前は、コマンドが実行され、一致するパターンが Claude Code セッションをターン中に終了しました。

```text theme={null}
pkill: refusing to run — this pattern matches the Claude CLI process (PID 12345). Narrow the pattern, or target your own children with `pkill -P $$ ...`.
```

拒否はターミナルのバナーではなく、Bash ツール結果に表示され、Claude は通常、コマンドを自動的に調整します。

**What to do:**

* パターンを絞り込んで、意図したプロセスのみと一致するようにします。例えば、短い部分文字列ではなく、ターゲットバイナリの完全なパスです
* 現在のシェルで開始されたプロセスを停止するには、パターンで `pkill -P $$` を使用します。これにより、マッチをシェルの独自の子プロセスに制限します

### Failed to write to a teammate's inbox

Claude Code は `~/.claude/teams/{team-name}/inboxes/` の下のチームメイトのメールボックスファイルにメッセージを書き込むことができなかったため、受信者は何も受け取りませんでした。書き込みは、Claude Code がファイルを作成または更新できない場合に失敗します。例えば、ディスクがいっぱいである、ディレクトリが書き込み可能でない、または別のエージェントがインボックスロックを長時間保持している場合です。v2.1.224 より前は、Claude Code は書き込みが失敗した場合でも、メッセージが送信されたと報告していました。

エラーはターミナルのバナーではなく、送信エージェントのツール結果に表示され、テキストは Claude に再度試すよう指示します。

```text theme={null}
Failed to write to researcher's inbox — nothing was sent. Try again, or message the lead.
```

構造化された [エージェントチーム](https://code.claude.com/docs/ja/agent-teams.md) プロトコルメッセージは同じ方法で失敗し、エラーは配信されなかったメッセージを指定します。Claude Code が計画承認、計画却下、シャットダウン要求、またはシャットダウン却下を書き込むことができない場合、エラーは `Failed to write the <message> to <name>'s inbox — nothing was sent` と読みます。そのリストの `plan approval` はチームリーダーの決定であり、チームメイトの計画を承認します。チームメイトの計画提出は別の `plan approval request` メッセージです。そのメッセージと他の 2 つのプロトコルメッセージは、独自のメッセージテキストと結果を持ちます。

* `Failed to write the plan approval request to the lead's inbox — plan not submitted; try again`: チームメイトの計画がチームリーダーに到達せず、チームメイトは再提出が成功するまで plan モードのままです
* `The permission request could not be delivered to the team lead (mailbox write failed)`: チームメイトの権限要求がチームリーダーに到達しなかったため、誰もツール呼び出しを承認しませんでした
* `The confirmation could not be written to team-lead's inbox.`: シャットダウン承認自体が有効になり、チームメイトは終了します。チームリーダーへの確認のみが不足しています

チームリーダーのセッションで `@name` に続けてメッセージを入力し、自分でチームメイトにメッセージを送信する場合、同じ失敗は通知 `Couldn't write to @name's inbox — message not sent. Try again.` として表示され、Claude Code はテキストをプロンプトボックスに保持して、再度送信できるようにします。

**What to do:**

* 送信者にメッセージを再送信するよう依頼します。インボックスロックの競合は一時的であり、再試行時にクリアされます
* 空きディスク容量を確認し、`~/.claude/teams` とその下のファイルがユーザーによって書き込み可能であることを確認します

### Teammate's agent definition was not restored

Claude が停止した [エージェントチーム](https://code.claude.com/docs/ja/agent-teams.md) のチームメイトにメッセージを送信し、Claude Code はそのチームメイトを復帰させましたが、生成元の [サブエージェント定義](https://code.claude.com/docs/ja/agent-teams.md#use-subagent-definitions-for-teammates) を再適用しませんでした。通知は、送信エージェントのツール結果の再開レポートに続いて表示され、理由を示します。定義ファイルが信頼の保存されていないフォルダから来た場合、通知は次のようになります。

```text wrap theme={null}
Its agent definition was not restored: the folder its definition file came from is not trusted (source: projectSettings), so the teammate is running with the team-essential tools and no custom instructions. To restore it, the user needs to run Claude Code in that folder once and accept the trust dialog (the --debug log names the folder); do not change trust settings on the user's behalf.
```

チェックは、プロジェクトまたは `--add-dir` ディレクトリの `.claude/agents/` ディレクトリ内の定義に適用され、親フォルダの信頼ダイアログを受け入れることはそれを満たしません。

**What to do:**

* [デバッグログ](https://code.claude.com/docs/ja/debug-your-config.md) が指定するフォルダで `claude` を実行し、信頼ダイアログを受け入れます。定義は Claude Code がチームメイトを次に復帰させるときに再適用されます。チームリーダーのセッションを再起動する必要はありません
* または、`~/.claude.json` の `hasTrustDialogAccepted` エントリを `true` に設定します。デバッグログが出力する正確な `projects["<path>"]` キーを使用します

### Only a teammate can approve a shutdown request

送信したセッションがチームメイトとして実行されていないため、Claude Code は [エージェントチーム](https://code.claude.com/docs/ja/agent-teams.md) のシャットダウン承認を拒否しました。何も送信されず、何もシャットダウンされていません。拒否は送信セッションのツール結果に表示されます。

```text wrap theme={null}
Only a teammate can approve a shutdown request, and this session is not running as one. Nothing was sent. To shut down a teammate, send that teammate a shutdown_request message. The teammate is the one that approves it.
```

**What to do:**

* 拒否がチームリーダーのセッションに表示された場合は、まずチームメイトがその後シャットダウンしたかどうかを確認します。拒否は代わりに `shutdown_request` を送信するよう指示とともに Claude に返され、ターンは続行します。対話型のチームリーダーセッションでは、チームメイトがシャットダウン要求を承認すると `<name> has shut down.` が表示されます。
* チームメイトがまだ実行中の場合は、チームリーダーのプロンプトでチームメイトをシャットダウンするよう依頼します（例: `Ask the researcher teammate to shut down`）。[チームメイトをシャットダウンする](https://code.claude.com/docs/ja/agent-teams.md#shut-down-teammates) を参照してください。
* `claude --resume` で自分で再開した元チームメイトがこの拒否を受け取った場合、何も送信されていません。そのセッションを終了するには、そのプロンプトで `/exit` を実行します。

### A command-line deny rule cannot be handed to a teammate intact

このメッセージは、Claude Code が [エージェントチーム](https://code.claude.com/docs/ja/agent-teams.md) の [分割ペイン](https://code.claude.com/docs/ja/agent-teams.md#choose-a-display-mode) チームメイトを起動しなかったことを意味します。Claude Code はチームリーダーのコマンドライン拒否ルールを、分割ペインのチームメイト自身のコマンドラインで渡しますが、チームメイトがそのいずれかを異なる意味で読み取ってしまう場合は停止します。

```text wrap theme={null}
The deny rule "<rule>" cannot be handed to a teammate intact, so the teammate was not started. Remove that rule or move it to permissions.deny in settings, then try again.
```

**What to do:**

* チームリーダーのセッションで `/config` を実行し、**Teammate mode** を `in-process` に設定します。その行に `overridden` と表示され、すでに `in-process` が表示されている場合は、値を順に切り替えて `in-process` に戻します。その後、Claude にチームメイトを再度起動するよう依頼します。インプロセスのチームメイトは [チームリーダーの現在の拒否ルールの下で実行されます](https://code.claude.com/docs/ja/agent-teams.md#permissions)。
* `/config` はこの選択をユーザー設定に保存するため、ユーザー設定から [`teammateMode`](https://code.claude.com/docs/ja/settings-reference#teammatemode) を取得する以降のセッションでも、チームメイトはインプロセスで起動します。以降のセッションで分割ペインに戻すには、**Teammate mode** を以前使用していた `auto`、`tmux`、`iterm2` のいずれかに設定します。

### Message too large for cross-session delivery

Claude の [クロスセッションメッセージ](https://code.claude.com/docs/ja/cross-session-messaging.md) は、このマシン上の別のセッションに対して長すぎて送信できませんでした。Claude Code はそれを拒否し、受信セッションは何も受け取りませんでした。拒否はターミナルのバナーではなく、送信セッションのツール結果に表示されます。両方のサイズとメッセージを適合させる方法を指定します。

```text wrap theme={null}
Failed to send to api-worker: Message too large for cross-session delivery: the serialized message is 1,203,844 characters and the limit is 1,048,576. Shorten the message text — put bulk content in a file the recipient can read rather than in the message — or split it into smaller messages.
```

同じテキストを再送信すると、同じ方法で失敗します。

**What to do:**

* Claude にメッセージを要約するか、バルクコンテンツをファイルに入れてそのファイルのパスを送信するよう依頼します
* Claude にコンテンツを複数の短いメッセージに分割するよう依頼します

v2.1.235 より前は、Claude Code は超過サイズのメッセージが送信されたと報告していました。受信セッションはそれを未読で削除しました。

### Too many messages to this session just now

Claude は [クロスセッションメッセージ](https://code.claude.com/docs/ja/cross-session-messaging.md) の急速なバーストをこのマシン上の 1 つのセッションに送信し、バーストはそのセッションのインボックスが受け入れるものに達しました。Claude Code は次の送信を拒否し、受信セッションはそれから何も受け取りませんでした。拒否はターミナルのバナーではなく、送信セッションのツール結果に表示されます。

```text wrap theme={null}
Failed to send to api-worker: Too many messages to this session just now: 30 were sent recently and more would be dropped by its rate limit, so this one was not sent. Batch what remains into one message, or wait a little before sending more.
```

**What to do:**

* 通常は何もしません。Claude は残りのコンテンツを 1 つのメッセージにバッチ処理するか、さらに送信する前に少し待ちます
* バースト自体をプロンプトした場合、Claude に残りのものを 1 つのメッセージに結合するよう依頼します

v2.1.236 より前は、Claude Code はこれらの送信が送信されたと報告していました。受信セッションはそれらを未読で削除しました。

### Cross-session message was dropped at the recipient session's inbox

Claude は [クロスセッションメッセージ](https://code.claude.com/docs/ja/cross-session-messaging.md) をこのマシン上の別のセッションに送信し、そのセッションのインボックスは Claude がそのセッションで読む前にそれを破棄しました。行は受信者のアドレスを指定し、受信者が理由を与えた場合、ダッシュの後に理由を追加します。

```text wrap theme={null}
Cross-session message was dropped at the recipient session's inbox (recipient: uds:/tmp/cc-socks/13605.sock) and not delivered — its queue of undelivered peer messages was full. Claude was told not to resend right away.
```

1 行は複数の削除されたメッセージをカバーできます。その場合、行は複数形で始まります。例えば `Cross-session messages (12) were dropped`。アドレスがどのセッションに属しているかを見つけるには、各セッションで `/status` が表示する [`Peer address` 行](https://code.claude.com/docs/ja/cross-session-messaging#the-sessions-inbox-socket) と比較します。

ダッシュの後、行は以下の 1 つ以上の理由を与えます。

* `its queue of undelivered peer messages was full`: 受信者は既に他のセッションから配信されていないメッセージを多く保持しており、そのキューが許可する限りです
* `you sent faster than that session accepts`: 送信セッションのメッセージは受信者が 1 つの送信者から受け入れるより速く到着しました
* `it repeated your previous message`: メッセージは送信セッションが最近この受信者に送信したものと同じでした
* `a relay loop between sessions was cut`: メッセージが、このマシンの外のセッションを含むものなど、[途中で打ち切られる可能性がある返信の長いチェーン](https://code.claude.com/docs/ja/cross-session-messaging.md#limitations) の続きでした

**What to do:**

* 削除されたメッセージを受信者が見たことがないと仮定します。Claude Code は同じことを Claude に伝え、それでも重要なものを 1 つの後のメッセージに含めるよう指示し、すぐに再送信しないよう指示します
* セッションが互いに頻繁に更新を送信する場合、Claude にセッションが作業を完了したときなど、より少なく、より大きなメッセージを送信するよう依頼します
* `a relay loop between sessions was cut` の場合、セッションの 1 つに自分で次の指示を入力します。Claude が自分のプロンプトに応答して送信するメッセージは新しいチェーンを開始します

v2.1.238 より前は、受信者のインボックスがメッセージを破棄したときに送信セッションはレポートを受け取りませんでした。

### Refusing to send a cross-session message

Claude Code が [クロスセッションメッセージ](https://code.claude.com/docs/ja/cross-session-messaging.md) をこのマシン上の別のセッションに書き込む前に、ターゲットセッションのインボックスソケットがメッセージが宛てられたエンドポイントであることを確認します。チェックが失敗すると、Claude Code は送信セッションで送信を拒否し、ターゲットセッションは何も受け取りません。Claude が送信するメッセージの場合、拒否は送信セッションのツール結果に表示されます。

```text theme={null}
Failed to send to api-worker: Refusing to send: reply target is a symlink
```

`Refusing to send:` の後のテキストは、失敗したチェックを指定します。

* `reply target is a symlink`: シンボリックリンクがターゲットセッションのソケットパスにあります。Claude Code はそれを通じて配信しません。リンクがそこにあると、メッセージをターゲットセッションが作成しなかったエンドポイントにリダイレクトする可能性があるためです。
* `cannot vet reply target`: Claude Code はターゲットパスをまったく検査できませんでした。例えば、権限エラーで読み取りが失敗したためです。

**What to do:**

* 通常は何もしません。チェックはメッセージが宛てられたセッション以外のエンドポイントに到達するのを防ぎ、何も送信されませんでした
* `reply target is a symlink` がセッションで繰り返される場合、そのセッションのソケットパスにリンクを作成したものを確認します。これは `/status` の `Peer address` に表示されます

### Refusing to read, write, or search a path

Claude Code はファイルパスの [権限ルール](https://code.claude.com/docs/ja/permissions.md#read-and-edit) をチェックし、ツールがファイルを開くか検索を開始するときに解決を再度確認します。パスがチェックが承認した場所にまだ導いていることを確認できない場合、Claude Code はパスをたどらずに操作を拒否します。拒否はツール結果に表示されます。

```text wrap theme={null}
Refusing to read /path/to/file: its symlink resolution changed after permission was checked (a link on the way now leads somewhere the check did not see). If a link in the working directory is being rewritten concurrently, stop that and retry.
```

各拒否はその理由を指定します。

* `its symlink resolution changed after permission was checked`: パスに沿ったシンボリックリンク、または Grep または Glob 検索ルートが、権限チェックと操作の間に置き換えられました。読み取り拒否では、括弧内のフレーズはどの比較が失敗したかを指定します。
* `its parent-directory symlink resolution changed after permission was checked`: 書き込みパスが通過するディレクトリは、承認された場所に解決されなくなりました
* `where it leads on disk could not be determined (a link on the way could not be examined, or the links do not resolve)`: Claude Code はパスをディスク上の最終的な場所まで追跡できませんでした。例えば、パス上のシンボリックリンクがループを形成しているためです
* `it is a symbolic link. Write to the link's target path instead`: シンボリックリンクが要求された書き込み場所自体にあります。例えば、`CLAUDE.md` が `AGENTS.md` へのシンボリックリンクです。メッセージは Claude をリンクのターゲットに指示します
* `Refusing to write through symlink: <path>. Resolve the symlink and pass the real target path explicitly.`: 別のライターがファイルを開くときに捕捉された同じ条件。例えば、シンボリックリンクされた `.mcp.json` への書き込み
* `Refusing to write into symlinked directory: <path>`: ファイルを保持するディレクトリ自体がシンボリックリンクです。例えば、プロジェクトの `.claude/` ディレクトリが別の場所にリンクされています
* `a path one of its Read deny rules is written through changed while the search was being prepared. Retry.`: 検索の `Read` 拒否ルールはシンボリックリンクを通過するパスを指定し、そのリンクは Claude Code が検索を準備している間に変更されました
* `it could not be opened (EACCES) — it is unreadable, or is being replaced concurrently.`: 検索ルートは存在しますが、開くことができませんでした。括弧内のコードはオペレーティングシステムエラーです
* `its permission check expired before it ran (too many concurrent file operations). Retry.`: Claude Code は多くの同時ファイル操作の下で、ツールが使用する前に承認レコードを削除しました。再試行は新しい権限チェックを実行します
* `ripgrep was found only by name on PATH, and a search outside the working directory cannot apply your Read deny rules in that configuration`: Claude Code は `rg` バイナリを絶対パスに解決できなかったため、拒否ルールをカバーしない検索を実行するのではなく、作業ディレクトリの外の検索を拒否します

**What to do:**

* 通常は何もしません。拒否は Claude にツール結果として到達し、拒否された操作は実行されません
* シンボリックリンク拒否が 1 つのパスで繰り返される場合、ビルドツールやファイルウォッチャーなど、リンクをそこで書き直し続けるものを見つけるか、Claude にファイルのリンクされたパスではなく解決されたパスを使用するよう依頼します
* Windows 上の AppContainer または制限されたトークンサンドボックス内で Claude Code を実行しているときに、すべてのファイルでこの拒否が表示される場合、v2.1.265 以降にアップグレードします
* プロンプトにドラッグしたスクリーンショットなど、何も書き直していないファイルに対して macOS で読み取り拒否が表示される場合、v2.1.273 以降にアップグレードします
* ripgrep 拒否の場合、パッケージマネージャーで ripgrep をインストールして、`rg` が `PATH` 上の絶対パスに解決されるようにするか、作業ディレクトリの下で検索を保持します

v2.1.251 より前は、Claude Code はファイル書き込みに対してのみパスの解決を再チェックしたため、権限チェック後に置き換えられたリンクは、メッセージなしで読み取りまたは検索を別の場所にリダイレクトする可能性がありました。これらのうち、親ディレクトリ、シンボリックリンク経由、およびシンボリックリンクされたディレクトリ書き込み拒否のみが以前のバージョンに表示されます。

v2.1.280 より前は、`where it leads on disk could not be determined` 拒否は表示されませんでした。

### The search failed, so this is not a "no matches" result

Claude が実行した [Grep](https://code.claude.com/docs/ja/tools-reference.md#grep-tool-behavior) または [Glob](https://code.claude.com/docs/ja/tools-reference.md#glob-tool-behavior) 検索が結果を返す前に失敗したため、一致が存在するかどうかは不明です。Claude が結果の代わりに受け取るメッセージは次のように始まります。

```text wrap theme={null}
The search failed, so this is not a "no matches" result: matches may exist. What happened to the search program (ripgrep) is not known, and no results were read. Run the search once more. If it fails again, tell the user that searches are failing.
```

**What to do:**

* **初めて表示された場合**: 何もする必要はありません。メッセージはまず再度検索するよう Claude に求めます。
* **Claude が検索が失敗していると伝えた場合**: バグレポート用に ripgrep のエラーを取得します。
  1. シェルから、検索が失敗したセッションと同じフラグに [`--debug-file claude-debug.log`](https://code.claude.com/docs/ja/cli-reference#cli-flags) を加えてセッションを開始します
  2. 検索の失敗につながったリクエストを Claude に送信します
  3. 検索が再び失敗した場合は、`claude-debug.log` 内で `rg error (signal=` を含む行を見つけます
  4. [問題を報告する](#report-an-error) ときにその行を含めます

### Task output swap refused

Claude Code は各 Bash コマンドの出力を一時ディレクトリの下のファイルに保存します。これらのファイルの 1 つを開くたびに、シンボリックリンク、追加のハードリンク、または移動されたディレクトリによってリダイレクトされることなく、パスがまだ作成したファイルに導いていることを確認します。このメッセージは、そのチェックが失敗したことを意味するため、Claude Code はそのパスを通じて出力を書き込みまたは読み取るのではなく、操作を拒否しました。メッセージは Bash ツール結果に表示されます。

```text wrap theme={null}
task output swap refused (tasks dir moved or linked): /private/tmp/claude-501/-Users-you-my-project/1f0e62dc-4b0a-4f5e-9c2d-8a7b6c5d4e3f/tasks/b7k2f9m3q.output. To recover: restart Claude Code with CLAUDE_CODE_TMPDIR set to a fresh directory; or, if /private/tmp/claude-501/-Users-you-my-project is a stray directory or a symbolic link that should not be there, remove that entry itself (not what it points to) and restart.
```

括弧内のテキストは失敗したチェックを指定します。`output symlink was re-pointed`、`output file identity changed`、`not a regular file` などの理由はすべて同じ条件を報告します。出力パスにある、またはパスに沿ったものが、Claude Code が作成したファイルではなくなっています。一部の理由のみが `To recover:` 文を持ちます。

コマンドがまだ実行中にチェックが失敗する場合、Claude Code はコマンドを停止し、その結果は以下を報告します。

```text theme={null}
Command killed: its output file was replaced or could no longer be verified
```

**What to do:**

* v2.1.260 以降にアップグレードします。以前のバージョンは、リンクまたは移動されたディレクトリが存在しない場合でも、このメッセージを表示することがありました
* [`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/ja/env-vars) を新しいディレクトリに設定して Claude Code を再起動します
* または、Claude Code の一時ディレクトリの下にあるプロジェクトのディレクトリ（例のメッセージでは `/private/tmp/claude-501/-Users-you-my-project`）を確認します。そのパスがシンボリックリンクである場合、またはそこにあるべきではないディレクトリである場合、リンクのターゲットではなく、リンクまたはディレクトリ自体を削除して、Claude Code を再起動します
* 拒否が繰り返される場合、プロセスはセッションの実行中に Claude Code の一時ディレクトリの下のエントリを置き換え、リンク、または削除しています。[`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/ja/env-vars) を他に何も管理しないディレクトリに設定して再起動します

### Disk full or disk quota used up

Claude Code の一時ディレクトリを保持するボリュームで、空き容量、アイノード、またはディスク割り当てを確保します。コマンドの結果に含まれる `Disk full:`、`Disk quota used up:`、または `Nearly out of inodes:` で始まる行に、そのディレクトリが示されます。

Claude Code は各 Bash および PowerShell コマンドの出力をそのディレクトリの下のファイルに保存します。ボリュームまたはそれに対するユーザーの割り当てが満杯であるためにそのファイルを作成できない場合、コマンドは開始されず、Claude が読み取る結果は次のようになります。

```text wrap theme={null}
The command was not started: this computer's disk is full (ENOSPC) on the volume holding /tmp/claude-501 (Claude Code's temporary directory), so the file that captures command output could not be created there and nothing ran. Free space on that volume, or restart Claude Code with CLAUDE_CODE_TMPDIR set to a directory on another one, then retry. If this is the user's own computer, tell them before deleting anything to make room.
```

`Disk full:`、`Disk quota used up:`、`Nearly out of inodes:` の各メッセージは、実行されてゼロ以外のコードで終了したコマンドの後に表示されます。例えば次のとおりです。

```text wrap theme={null}
Disk full: this computer's volume holding /tmp/claude-501 (Claude Code's temporary directory) has 3 MB free, so whatever this command printed was lost and its own writes may have failed with "No space left on device". Free space on that volume, or restart Claude Code with CLAUDE_CODE_TMPDIR set to a directory on another one, then retry. If this is the user's own computer, tell them before deleting anything to make room.
```

**What to do:**

* macOS および Linux では、シェルで `df -h <dir>` を実行して、そのディレクトリを保持するボリュームとその使用状況を確認します。`df -i <dir>` は空きアイノードの数を表示します。`<dir>` はメッセージに示されたディレクトリです（例: `df -i /tmp/claude-501`）
* **`Disk full: this computer's volume` または `disk is full (ENOSPC)`**: そのボリューム上のどこでも構わないので、不要なファイルを削除します
* **`Disk quota used up:`、`disk quota is used up (EDQUOT)`、または `Disk full: a test write`**: ボリュームにまだ空き容量が表示されている場合でも、そのボリューム上の自分のファイルを削除します
* **`Nearly out of inodes:`**: そのボリューム上の多数のファイルを削除します。各ファイルはサイズに関係なく 1 つのアイノードを使用するため、重要なのはサイズではなくファイルの数です
* または、[`CLAUDE_CODE_TMPDIR`](https://code.claude.com/docs/ja/env-vars) を容量のあるボリューム上のディレクトリに設定して Claude Code を再起動します
* その後、Claude にコマンドを再度実行させます

v2.1.309 より前は、メッセージは次のとおりで、同じ手順が適用されます。

* `Your disk quota is full on the filesystem with Claude Code's temp directory <dir> (EDQUOT)`
* `The filesystem with Claude Code's temp directory <dir>, or your disk quota on it, is full (ENOSPC)`
* `Command output was lost: the temp filesystem at <dir> is full` または `... is out of inodes`
* `The command was not started: this computer's disk is full (ENOSPC), so the file that captures command output could not be created. Nothing ran.`、または `(EDQUOT)` を含む同じメッセージ。この形式はディレクトリを示さないため、`/tmp` などのシステムの一時ディレクトリ、または `CLAUDE_CODE_TMPDIR` で設定したディレクトリを保持するボリュームを確認します

v2.1.305 より前は、ディスクが満杯のために Claude Code が開始できなかったコマンドは、オペレーティングシステムのエラーテキストのみを返していました。そのテキストは、例えば `ENOSPC: no space left on device, open <path>.output` のようなものでした。

### git is not installed on this Mac

このメッセージは、Claude Code のある手順で git が必要になり、見つかった git が `/usr/bin/git` にある Apple の代替スタブであったことを意味します。git を提供する開発者ツールはインストールされていません。

Claude Code はこの代替スタブを起動せず、代わりにこのテキストを表示します。例えば、より長いメッセージの中に表示されることがあります。

```text wrap theme={null}
git is not installed on this Mac. To install it, run xcode-select --install, then try again.
```

**What to do:**

* ターミナルで `xcode-select --install` を実行し、開始されるインストールを完了してから、Claude Code で行っていた操作を再試行します

### File is not valid UTF-8

Claude が、バイトを UTF-8 としてデコードできないファイルに対して Edit または NotebookEdit ツールを使用したため、Claude Code は変更を拒否しました。何も書き込まれていないため、ファイルは元のままです。これらのツールはファイル全体を UTF-8 として保存し直すため、デコードできなかったすべてのバイトが置換文字 `U+FFFD` に変わってしまうところでした。メッセージはツール結果に表示されます。

```text wrap theme={null}
File is not valid UTF-8. It may use a legacy encoding such as Windows-1252, Shift-JIS or GBK, or be binary. This tool saves the whole file as UTF-8, which would replace every byte it cannot decode with U+FFFD. Nothing was written. Make the change with a shell command that reads and writes the file in its own encoding, or ask the user whether to convert the file to UTF-8 first.
```

UTF-8 であるはずのファイルでも、無効なバイトシーケンスが 1 つでも含まれていればこのメッセージが表示されます。チェックはファイルのバイト全体を対象とするためです。

**What to do:**

* ファイルを現在のエンコーディングのまま保持するには、メッセージが指示するとおり、そのエンコーディングでファイルを読み書きするシェルコマンドで Claude に変更を行わせます
* Edit ツールでファイルの編集を続けるには、ファイルを UTF-8 に変換するか、UTF-8 であるはずのファイルの場合は無効なバイトを修正してから、Claude に再度編集を依頼します

v2.1.296 より前は、Edit と NotebookEdit はこのような編集を適用し、デコードできなかったすべてのバイトを `U+FFFD` として保存していました。これらのバージョンを使用している場合は、Claude Code をアップデートしてください。

### Refusing to apply edits: a hook is configured for file edits in this session

Claude が [アーティファクト](https://code.claude.com/docs/ja/artifacts.md) を [ワンステップ更新](https://code.claude.com/docs/ja/artifacts.md#turn-off-one-step-artifact-updates)（公開に含まれる、アーティファクトのファイルへの小さな変更）で公開しようとしましたが、Claude Code が拒否しました。何も公開されておらず、ファイルも変更されていません。メッセージは Artifact ツール結果に表示されます。

```text wrap theme={null}
Refusing to apply edits to <path>: a hook is configured for file edits in this session, so a publish can't apply edits here. Edit the file, then publish it without edits. Nothing was published.
```

セッションに `Edit` または `Write` を対象とする [`PreToolUse` フック](https://code.claude.com/docs/ja/hooks#pretooluse) または [mod](https://code.claude.com/docs/ja/plugins/mods/overview.md) がある間、Claude Code はワンステップ更新を許可しません。

**What to do:**

* Claude がその後ファイルを編集して公開した場合は、何もする必要はありません
* Claude がメッセージで停止した場合は、ファイルを編集して公開するよう Claude に依頼します
* メッセージが繰り返し表示される場合は、Claude Code を終了して再起動します
* 再起動後もメッセージが表示される場合は、[ワンステップ更新をオフにします](https://code.claude.com/docs/ja/artifacts.md#turn-off-one-step-artifact-updates)

### The source file is not valid UTF-8 text

Claude は、バイトがテキストとしてデコードされないか、テキストが既に置換文字 `U+FFFD` を含むファイルから [アーティファクト](https://code.claude.com/docs/ja/artifacts.md) を公開しようとしたため、Claude Code は何もアップロードする前に公開を拒否しました。メッセージは Artifact ツール結果に表示され、修正する最初の位置を指定します。

```text wrap theme={null}
file_path: the source file is not valid UTF-8 text (first invalid byte at line 12, column 40). It may be saved in another encoding or contain binary data. Rewrite it as UTF-8, then publish again. Nothing was published.

file_path: the source file has the replacement character U+FFFD at line 12, column 40, usually left where an earlier edit or paste lost a character. Replace it with the intended text (in HTML, write an intended U+FFFD as &#xFFFD;), then publish again. Nothing was published.
```

Claude Code はファイルを UTF-8 としてデコードするか、リトルエンディアン UTF-16 バイトオーダーマークで始まる場合は UTF-16 としてデコードします。そのような UTF-16 ファイルがデコードされない場合、最初のメッセージは `UTF-16` を指定し、それでもファイルを UTF-8 として書き直すよう指示します。指定された位置の後にさらに位置が続く場合、メッセージは位置の後に `(+2 more)` などのカウントを追加します。

**What to do:**

* 通常は何もしません。Claude はファイルを書き直して再度公開します
* ファイルが自分で書いたものまたはエクスポートしたものである場合、UTF-8 として再度保存し、各 `U+FFFD` を以前の編集、貼り付け、または変換が失った文字に置き換えます
* ページに意図的な `U+FFFD` を表示するには、リテラル文字ではなく HTML で `&#xFFFD;` として書き込みます

v2.1.267 より前は、Claude Code はそのようなファイルをチェックなしでアップロードし、代わりにサーバーが公開を拒否していました。

### Not published: that file is on a network share

Claude が、ネットワークホストを指定するパスにあるファイルから [アーティファクト](https://code.claude.com/docs/ja/artifacts.md) を公開しようとしました。

* Windows では、起動時に [`--add-dir`](https://code.claude.com/docs/ja/cli-reference#cli-flags) で渡したマップ済みネットワークドライブの下にない `\\server\share` パス
* macOS または Linux では、`/net/<host>/page.html` などの自動マウントパス

このようなパスを参照すると、パスが指定するホストへの接続が発生し、Windows ではその接続によってホストに認証情報が送信される可能性があります。Claude Code はファイルの公開を拒否し、ファイルを読み取りません。拒否は Artifact ツール結果に表示されます。

```text theme={null}
Not published: that file is on a network share. Publish a file from this session's folders instead.
```

**What to do:**

* そのファイル自体が必要でない場合は、何もする必要はありません。メッセージは Claude に、代わりにセッション自身のフォルダからファイルを公開するよう指示します
* そのファイル自体を公開するには、ローカルディスク上のフォルダにコピーして、再度依頼します
* Windows で Claude が共有から直接公開できるようにするには、共有をドライブ文字にマップし、Claude Code の起動時にそのドライブを渡します。たとえば PowerShell では、`net use Z: \\server\share` を実行してから `claude --add-dir Z:\` を実行します。これで Claude はそのドライブからファイルを公開できます。セッション中に `/add-dir` でドライブを追加するだけでは不十分です。
* macOS または Linux では、`/mnt` や `/Volumes` の下などのディレクトリに共有をマウントし、自動マウントパスではなくそのパスから公開します

### Not published: Claude sent the same content again after a newer version of the artifact turned it away

Artifact 呼び出しの下に表示されるこの赤い行は、Claude Code が繰り返しの公開を停止したことを意味します。[アーティファクト](https://code.claude.com/docs/ja/artifacts.md) は更新されず、Claude が公開元とするファイルにも何も書き込まれていません。Claude が公開せずに停止しない限り、何もする必要はありません。

セッションの前半に、アーティファクトに新しいバージョンがあったため、Claude Code は公開を拒否しました。新しいバージョンとは、たとえば [編集者](https://code.claude.com/docs/ja/artifacts.md#let-someone-edit-with-you) や別のセッションが公開したものです。行の末尾に、Claude が次に行う必要があることが示されます。

```text wrap theme={null}
Not published: Claude sent the same content again after a newer version of the artifact turned it away. Claude needs to work from that newer version first.
Not published: Claude sent the same content again after a newer version of the artifact turned it away. The artifact hasn't changed since, so publishing it once more should go through.
Not published: Claude sent its changes again over the same file after a newer version of the artifact turned them away. Claude needs to work from that newer version first.
Not published: Claude sent its changes again over the same file after a newer version of the artifact turned them away. The artifact hasn't changed since, so publishing once more should go through.
```

**What to do:**

* **`Claude needs to work from that newer version first` で終わる場合**: Claude がそこで停止したら、アーティファクトの現在のバージョンを取得し、変更をマージして、再度公開するよう依頼します
* **`should go through` で終わる場合**: Claude がそこで停止したら、再度公開するよう依頼します

### Reading a local file from outside the connected folders in a Cowork session

Claude Desktop アプリでマシン上で実行されている [Cowork](https://claude.com/docs/cowork/overview) セッションで、Claude が [アーティファクト](https://code.claude.com/docs/ja/artifacts.md) 用のローカルファイルを指定しました。Claude Code はファイルがセッションの接続されたフォルダ内のプレーンファイルであることを確認できませんでした。パスはそれらのフォルダの外にあるか、シンボリックリンクを通過するか、見た目とは異なるファイルを指定しうる方法で記述されています。そのようなファイルを読み取るには承認が必要であり、すべての承認をスキップするように設定されたセッションなど、承認カードを表示できないセッションでは、Claude Code は読み取りを拒否します。

拒否は Artifact ツール結果に表示されます。ファイルをまったく検査できない場合、代わりにその失敗を指定します。

```text wrap theme={null}
Reading a local file from outside this session's connected folders, or through a link, needs the approval card, and no one can answer it in this Cowork session. Use a plain file inside the connected folders; do not retry this file in this session.

cannot read file_path (ENOENT) — the file could not be examined, and no one can answer the approval card in this Cowork session. Check that the file exists as a plain file inside the connected folders, then retry with that path.
```

**What to do:**

* 通常は何もしません。メッセージは Claude に接続されたフォルダ内のプレーンファイルを代わりに使用するよう指示します
* そのファイル自体をアーティファクトに入れるには、シンボリックリンクではなく通常のファイルとして、セッションの接続されたフォルダの 1 つにコピーして、再度依頼します

### WebFetch cannot fetch localhost

Claude は [WebFetch](https://code.claude.com/docs/ja/tools-reference.md#webfetch-tool-behavior) を、`http://localhost:3000` や `http://wiki/` のような単独のイントラネット名など、ドットのないホスト名を持つ URL で呼び出しました。WebFetch はリクエストを行う前にこれらの URL を拒否します。

```text wrap theme={null}
WebFetch cannot fetch localhost or other hostnames without a dot. To reach a local server, use Bash with curl instead.
```

**What to do:**

* 通常は何もしません。メッセージは Claude を Bash ツール経由の `curl` に指示します。これはローカルおよびイントラネットサーバーに到達できます

v2.1.268 より前は、WebFetch はこれらの URL を汎用 `Invalid URL` エラーで報告していました。

### Claude Code is unable to fetch from a host

WebFetch は、ページをリクエストする前に URL のホスト名を `api.anthropic.com` に送信し、Anthropic のドメイン安全ブロックリストと照合します。このメッセージは、そのホスト名はフェッチできないとチェックが回答したことを意味します。

```text wrap theme={null}
Claude Code is unable to fetch from example.com
```

チェックはリクエストの前に実行されるため、Claude Code はホストに接続していません。

チェックが送信する内容については、[WebFetch ドメイン安全チェック](https://code.claude.com/docs/ja/data-usage.md#webfetch-domain-safety-check) を参照してください。

### WebFetch domain safety check failed

URL をフェッチする前に、WebFetch は URL のホスト名を `api.anthropic.com` に送信して、Anthropic の [ドメイン安全ブロックリスト](https://code.claude.com/docs/ja/data-usage.md#webfetch-domain-safety-check) に対してチェックします。チェックが完了できない場合、WebFetch はドメインが安全であることを確認できないため、ページをフェッチせず、ツール結果は代わりにこれらのメッセージの 1 つを持ちます。

```text wrap theme={null}
The safety check for domain example.com is rate-limited (too many domain checks from this network; the limit is shared and can stay exhausted for minutes). Do not retry WebFetch in a loop or sleep to wait it out; continue without this page and report that its safety check was rate-limited. A single later attempt is fine; if that is rate-limited too, stop.

Unable to verify if domain example.com is safe to fetch. This may be due to network restrictions or enterprise security policies blocking claude.ai.
```

* `rate-limited`: チェックエンドポイントは HTTP `429` で応答しました。メッセージは Claude にページなしで続行し、後で最大 1 回だけ再度試すよう指示します。Claude Code は失敗したチェックをキャッシュしないため、そのドメインの後の取得はチェックを再度実行します。ネットワーク上のセッションがこれに頻繁に該当する場合、設定で [`skipWebFetchPreflight: true`](https://code.claude.com/docs/ja/settings-reference#skipwebfetchpreflight) を指定してチェックをスキップできます。
* `Unable to verify`: チェックリクエストが失敗した、タイムアウトした、または別のエラーステータスを受け取りました。ネットワークが `api.anthropic.com` をブロックする場合、そのドメインを許可リストに追加するか、設定で [`skipWebFetchPreflight: true`](https://code.claude.com/docs/ja/settings-reference#skipwebfetchpreflight) を指定してチェックをスキップします。

v2.1.286 より前は、レート制限メッセージは `The safety check for domain example.com is temporarily rate-limited (too many domain checks from this network). Retry after about a minute; retrying sooner will fail the same way.` と読みました。
v2.1.285 より前は、レート制限されたチェックは代わりに `Unable to verify` メッセージで報告されました。

## バックグラウンドセッションのエラー

[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)は専用の対話型ターミナルを持たずに実行されるため、ターミナルを必要とするコマンドはそこでは異なる動作をします。これらのメッセージは、バックグラウンドセッションのトランスクリプト、そのセッションにアタッチしたターミナル、ディスパッチ元のセッションまたはシェルに表示されます。また、以下の [worktree ガードの項目](#write-or-command-blocked-because-the-path-cannot-be-safely-resolved)については、worktree で分離された任意のセッション、または worktree で分離されたサブエージェントを実行している任意のセッションに表示されます。メッセージが 1 つのサーフェスに固有の場合は、その項目にその旨を記載しています。

### バックグラウンドセッションで拒否されるコマンド

対話型ダイアログを開くコマンドは、バックグラウンドセッションにターミナルがアタッチされていない間はダイアログを開けません。`/install-github-app`、`/mcp` の設定リスト、MCP サーバーメニューの認証アクションは、メッセージを返します。`/install-github-app` と `/mcp` の設定リストの場合、セッションは [エージェントビュー](https://code.claude.com/docs/ja/agent-view.md)の **Needs input** の下にも表示されるため、そこで見つけてアタッチし、コマンドを再度実行できます。ターミナルがアタッチされている間は、これらのコマンドは通常どおり動作します。

v2.1.216 より前は、`/install-github-app` または `/mcp` の設定リストが拒否された後、セッションは **Needs input** の下に表示されませんでした。v2.1.213 から v2.1.215 では、ターミナルがアタッチされている間はコマンドは引き続き動作し、拒否メッセージはアタッチしてコマンドを再度実行するよう案内していました。v2.1.208 から v2.1.212 では、Claude Code はターミナルがアタッチされている間もこれらを拒否し、`Can't open MCP settings in a background session` などのメッセージを表示していました。これらのバージョンでは、代わりに通常の `claude` セッションからコマンドを実行するか、アップグレードしてください。v2.1.208 より前は、これらのコマンドはバックグラウンドセッション内でダイアログを開いていました。v2.1.208 のみ、Claude Code はバックグラウンドセッションで `/model` ピッカーも拒否し、`/upgrade` はブラウザを開く代わりにアップグレード URL を出力していました。

メッセージの文言にはコマンド名が含まれます。`/mcp` の設定リストでは次のように表示されます。

```text theme={null}
Can't open MCP settings while no terminal is attached to this background session. This session now shows "needs input" in agent view — open it and run /mcp to manage servers, or use `/mcp enable|disable|reconnect <server>` to steer without the panel.
```

**対処方法:**

* エージェントビューからセッションにアタッチし、コマンドを再度実行します
* または、`/mcp reconnect <server>`、`/mcp enable`、`/mcp disable` など、メッセージに示されている形式を使用します。これらはアタッチせずに動作します

### パスを安全に解決できないため書き込みまたはコマンドがブロックされた

Claude が、[worktree 分離ガード](https://code.claude.com/docs/ja/agent-view.md#how-file-edits-are-isolated)が検証可能な 1 つの場所に解決できない表記で、ファイルまたは作業ディレクトリを指定しました。このガードは、対話型かバックグラウンドかを問わず [worktree で分離された任意のセッション](https://code.claude.com/docs/ja/worktrees.md#how-claude-code-enforces-isolation)と、[worktree で分離されたサブエージェント](https://code.claude.com/docs/ja/worktrees.md#isolate-subagents-with-worktrees)において、書き込みとコマンドの作業ディレクトリをチェックします。ガードは、操作が共有チェックアウトに及ばないことを確認する前にシンボリックリンクを解決し、解決に失敗した場合は、操作が共有チェックアウトに到達するのを許すのではなく、操作をブロックします。メッセージには、拒否されるパスの形式と再試行の方法が示されます。

```text theme={null}
This write was blocked because the path is spelled in a form that cannot be safely resolved (for example through a symlink storing a raw dot segment, a network-share or device-namespace shape, or an unreadable ancestor directory). If the file is inside the worktree /path/to/worktree, address it by its direct symlink-free path instead.
```

ブロックされたコマンドは、作業ディレクトリについて同じ原因を報告し、`re-run the command from its direct symlink-free path` で終わります。v2.1.217 より前は、ガードはシンボリックリンクを解決せずにパスの表記を比較していたため、これらの表記はブロックされず、シンボリックリンクを経由した書き込みが共有チェックアウトに到達する可能性がありました。

**対処方法:**

* 通常は何もする必要はありません。完全なメッセージはツールエラーとして Claude に渡され、Claude はメッセージに示された直接パスで再試行します。ファイル編集がブロックされた場合、会話ビューには短い `Error editing file` の行のみが表示されます。完全なメッセージはトランスクリプトビューに表示され、`Ctrl+O` で開けます。ブロックされたコマンドは、コマンド出力にメッセージを出力します。
* 同じファイルでブロックが繰り返される場合、パスはおそらく、`docs/current -> ../README.md` のように、ターゲットに `..` を含むコミット済みのシンボリックリンクを経由しています。リンク経由ではなく、実際のパスでターゲットファイルを編集するよう Claude に依頼してください

### パスがネットワーク上の場所を指しているため書き込みまたはコマンドがブロックされた

セッションのチェックアウトがローカルディスク上にある状態で、Claude がマシン上にないドライブを指すパス、つまり `\\server\share\file` のような UNC 共有や `/net` の自動マウントパスを使って、ファイルまたは作業ディレクトリを指定しました。同じ [worktree 分離ガード](#write-or-command-blocked-because-the-path-cannot-be-safely-resolved)は、そのようなパスが共有チェックアウトの外にとどまることを検証できないため、操作をブロックします。セッションを worktree で分離しても、このブロックは解除されません。メッセージには、代わりに使用するパスの形式が示されます。

```text theme={null}
This write was blocked because the path is network-shaped (a UNC share or /net automount spelling) while this session's checkout is local. Isolating cannot unblock it. If the file is genuinely inside the worktree /path/to/worktree, address it by its local, plainly-spelled path instead.
```

ブロックされたコマンドは、作業ディレクトリについて同じ原因を報告し、`re-run the command from its local, plainly-spelled path` で終わります。v2.1.217 より前は、ガードはパスのテキストのみを比較していたため、UNC または `/net` のパスを通じてチェックアウト内のファイルを指定してもブロックされませんでした。

**対処方法:**

* 通常は何もする必要はありません。Claude はメッセージが求めるローカルの表記で再試行します

### worktree 分離チェックによってコマンドがブロックされた

Claude が [worktree で分離されたセッション](https://code.claude.com/docs/ja/worktrees.md#how-claude-code-enforces-isolation)で Bash、[PowerShell](https://code.claude.com/docs/ja/tools-reference.md#powershell-tool)、または [Monitor](https://code.claude.com/docs/ja/tools-reference.md#monitor-tool) コマンドを実行し、Claude Code が次のいずれかの理由でそれを拒否しました。

* コマンドがメインチェックアウトまたは別の worktree で実行されることになる。メッセージには、作業ディレクトリが `resolved to the shared checkout` または `is in a different worktree` と示されます。
* Bash または Monitor コマンドが git をメインチェックアウトに向けている。
* コマンドが実行する git がすべて worktree 内にとどまることを、Claude Code が Bash または Monitor コマンドのテキストから検証できない。git を一切含まないコマンドでも、この理由で拒否されることがあります。`${!name}` のような変数の間接参照を展開したり、`${ command; }` のような Bash 関数置換を実行したりすると、実行時に値が生成され、その値自体がコマンドになりうるためです。

メッセージは `is isolated in the worktree <path>, but this command` の後に理由が続きます。たとえば、Claude Code がテキストを検証できなかったコマンドの場合は次のようになります。

```text wrap theme={null}
This session is isolated in the worktree /path/to/worktree, but this command evaluates ${!x@P} arithmetically inside a construct too complex to verify, which can run a command hidden in a variable's value. Refusing to run it — a worktree-isolated session's git operations must target its own worktree. Split it into plain, separate commands and run them from /path/to/worktree.
```

**対処方法:**

* **git がメインチェックアウトに向けられている場合、またはコマンドテキストを検証できない場合**: 何もする必要はありません。Claude はメッセージを読み、最後の文が求める方法でコマンドを書き直します。依頼したコマンドがテキスト内の展開を理由に拒否され続ける場合は、指摘された値をリテラルで記述し、worktree 内から git を単独のシンプルなコマンドとして実行してください
* 意図的にメインチェックアウトに対して操作するには、セッション外のターミナルで自分でコマンドを実行してください

### This session has no saved transcript

`←` または `/background` で[バックグラウンドに移動](https://code.claude.com/docs/ja/agent-view.md#from-inside-a-session)し、自身のターンを実行する前に停止したセッションにアタッチしました。Claude Code は移動元の会話を見つけられなかったため、このセッションには再開するものがありません。メッセージの末尾には、このセッションの `claude respawn` コマンドが示されます。

```text theme={null}
This session has no saved transcript — it was stopped before its first response finished. If it was backgrounded from another conversation, that one is still intact; `claude respawn <id>` starts this one fresh.
```

[エージェントビュー](https://code.claude.com/docs/ja/agent-view.md)で同じセッションの行を開くと、代わりにリストの下に `Press enter again to restart this session fresh` が表示され、その行でもう一度 `Enter` を押すと、空の会話でセッションが再起動されます。

**対処方法:**

* 停止したセッションを新たに開始するには、メッセージに示された ID を使って `claude respawn <id>` を実行するか、エージェントビューでその行の `Enter` を 2 回押します
* セッションが応答を完了していたにもかかわらず、v2.1.214 より前のバージョンでこの拒否が表示される場合、`~/.claude/projects` 内の読み取れないフォルダーが原因で、トランスクリプトのスキャンが保存された会話を見落としている可能性があります。スキャン中に読み取れないフォルダーを許容する v2.1.214 以降に更新してください

### This session is running in another terminal

[エージェントビュー](https://code.claude.com/docs/ja/agent-view.md)で停止したセッションの行を開きましたが、その保存された会話はこのマシン上の別の実行中の Claude Code プロセスですでに開かれているため、Claude Code は同じトランスクリプトに書き込む 2 つ目のプロセスの起動を拒否します。表示されるメッセージは、[会話を保持しているもの](https://code.claude.com/docs/ja/agent-view.md#opening-a-session-says-the-conversation-is-already-open)によって異なります。

```text theme={null}
Can't open — this session is running in another terminal
This conversation is already open in another running Claude session — use that one, or close it and try again
```

* **`running in another terminal`**: バックグラウンドセッション以外のプロセスが会話を保持しています。たとえば、`claude -p` の実行や、`claude --resume` または `/resume` で会話を再開したターミナルです。行には `Open in a terminal` も表示されます。
* **`already open in another running Claude session`**: 別の[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md#the-supervisor-process)が会話を保持しています。

**対処方法:**

* `running in another terminal` の場合: そのターミナルで続行するか、そのプロセスを終了するか完了を待ってから、再試行します
* `already open in another running Claude session` の場合: そのセッションを使用するか、そのセッションを停止してから再試行します

v2.1.248 より前は、`already open in another running Claude session` の拒否のみが存在していました。ターミナルで再開された会話は開かれているとみなされず、行を開くと同じ会話に書き込む 2 つ目の Claude Code プロセスが起動していました。

### This session's saved conversation is no longer on disk

バックグラウンドサービスがオフの間に終了した[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)を開きましたが、その後[トランスクリプトのクリーンアップ](https://code.claude.com/docs/ja/settings-reference.md#cleanupperioddays)によって保存された会話が削除されています。たとえば、マシンが数週間オフだった場合などです。このような行を開くと、通常は[保存された会話が再開されます](https://code.claude.com/docs/ja/agent-view.md#sessions-show-as-failed-after-shutdown)。再開するものが何も残っていないため、Claude Code は確認なしにセッションの元のプロンプトを再実行するのではなく、拒否します。

```text theme={null}
This session's saved conversation is no longer on disk (it ended while the background service was off, and old transcripts are cleaned up), so there is nothing to resume. `claude rm 7c5dcf5d` removes the row; `claude respawn 7c5dcf5d` runs its original prompt again instead.
```

`claude attach <id>` はこのテキストを出力します。エージェントビューでは、フッターはより短く、`ctrl+x removes the row` で終わります。

**対処方法:**

* `claude rm <id>` を実行して行を削除します。[保持されるケース](https://code.claude.com/docs/ja/agent-view.md#what-deleting-a-session-removes)のいずれかに該当する場合、`claude rm` は代わりに行と worktree を保持し、その理由を示します
* セッションの元のプロンプトを新しい会話として再度実行するには、`claude respawn <id>` を実行します

v2.1.248 より前は、このような行を開くと拒否されずにセッションの元のプロンプトが再実行され、数週間前のタスクがフォアグラウンドに戻ってきていました。

### Worktree has commits that are not pushed anywhere

worktree に、他の場所に保存されていることを Claude Code が確認できないコミットを含む[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md#what-deleting-a-session-removes)を削除しようとしました。`claude rm` は次の進め方を示します。

```text theme={null}
kept 7c5dcf5d — its worktree is still at “/home/you/project/.claude/worktrees/fix-login”
  2 unpushed commits on “claude/fix-login”: a1b2c3d “Fix login flow” and 1 more. They exist on no remote, so deleting the worktree would lose them.
  push them and run 'claude rm 7c5dcf5d' again, or discard the worktree and its commits: claude rm 7c5dcf5d --discard-unpushed a1b2c3d000000000000000000000000000000000@0123456789abcdef0123456789abcdef
```

Claude Code がコミットを要約できない場合、詳細行は代わりに `The worktree has unpushed commits` となります。[エージェントビュー](https://code.claude.com/docs/ja/agent-view.md)では、セッションの行に同じ理由とともに `not removed` が表示されます。

**対処方法:**

* コミットを保持するには、プッシュしてください。プッシュによってコミットが `origin/claude/fix-login` などのリモート追跡ブランチに載ったら、セッションの削除を再試行します。
* メッセージがコミットの破棄を提案している場合は、まず worktree、コミット、およびコミットされていない変更が不要であることを確認してください。その後、メッセージに示された手順を実行します。エージェントビューでセッションの行の `Ctrl+X` を 2 回押すか、`claude rm` が出力した `claude rm <id> --discard-unpushed <commit>@<worktree-id>` コマンドを実行します。Claude Code が再び拒否した場合は、新しいメッセージに従ってください。
* worktree が別の終了済みセッションにも記録されているとメッセージに示されている場合、再度削除しても破棄されません。コミットをプッシュしてから、セッションの削除を再試行してください

v2.1.268 より前は、`claude rm` はコミットの要約を `kept` 行自体に表示していました。`claude rm` がコミットを要約できなかった場合、`kept` 行には要約の代わりに `worktree has commits that are not pushed anywhere` と表示されていました。

v2.1.260 より前は、メッセージにブランチやコミットは示されず、破棄の手段もありませんでした。その場合でもセッションは削除できますが、コミットされていない変更は失われ、ブランチとコミットは保持されます。拒否メッセージに出力されたパスを使って `git worktree remove --force --force <path>` を実行し、その後 `claude rm <id>` を実行します。ロックされた worktree では、Git は `--force` を 2 回必要とします。

### Terminal host process died

各[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)のターミナルは、バックグラウンドサービス配下のホストプロセスで実行されます。サービスが接続を保持したままそのプロセスが終了したため、セッションに到達できませんでした。

Linux と WSL では、バックグラウンドサービスが数秒ごとに各ホストプロセスをチェックし、プロセスが終了しているのにサービスへの接続が閉じられていない場合にセッションを失敗としてマークし、[エージェントビュー](https://code.claude.com/docs/ja/agent-view.md#read-session-state)の行に理由を表示します。

```text theme={null}
terminal host process died — press Enter to restart
```

シェルからは、ホストの終了によってすでに失敗としてマークされたセッションを `claude attach <id>` で再起動できます。それ以外の場合は、原因を出力して終了します。

```text theme={null}
Couldn't attach to <id> — This session's terminal host process died (the conversation is saved) — run `claude attach <id>` again to restart it on a fresh host.
```

いずれの場合も会話は保存されています。

[シェルコマンド](https://code.claude.com/docs/ja/agent-view.md#run-a-shell-command)を実行している行では、代わりに `terminal host process died — its output is gone; the command was not run again` が表示され、`claude attach` は `This command's terminal host process died — its output is gone and the command was not run again` を出力します。Claude Code がコマンドを自動的に再実行することはありません。

**対処方法:**

* エージェントビューで、失敗した行の `Enter` を押します。セッションは新しいホストプロセスで再起動され、会話が再開されます
* シェルから、`claude attach <id>` を再度実行します。Claude Code は `Session <id>'s terminal host died — restarting it on a fresh one…` を出力し、セッションを再度開きます
* シェルコマンドの行はこの方法では再起動できません。再実行するには、コマンドを再度ディスパッチしてください

v2.1.247 より前は、終了したホストプロセスがバックグラウンドサービスの実行するすべての生存確認を通過してしまうことがあり、セッションを開くと `opening… · esc to cancel` が無期限に表示され、`claude attach <id>` はエラーを報告せずに待機し続けていました。

### Session isn't responding

[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)を開き、バックグラウンドサービスがそのオープンを受け付けましたが、約 10 秒間出力が届きませんでした。そのため Claude Code は、セッションのターミナルを中継するプロセスが出力を配信できないと判断し、待機を続けずに試行を終了します。

エージェントビューでは、Claude Code はフッターで再起動を提案します。

```text theme={null}
Press enter again to restart this session — it isn't responding (its conversation is saved and resumes).
```

シェルからは、`claude attach <id>` が原因を出力して終了します。

```text theme={null}
Couldn't attach to <id> — Session isn't responding — `claude stop <id>`, then `claude attach <id>` restarts it (the conversation is saved).
```

[シェルコマンド](https://code.claude.com/docs/ja/agent-view.md#run-a-shell-command)を実行している行は、再起動するとコマンドが再度実行されるため、Claude Code が自動的に再起動することはありません。

**対処方法:**

* エージェントビューで、同じ行の `Enter` をもう一度押します。Claude Code は応答しないプロセスを停止してセッションを再起動し、会話が再開されます。この 2 回目の押下がない限り、何も停止されません
* シェルから、`claude stop <id>` を実行し、その後 `claude attach <id>` を実行します
* シェルコマンドの行の場合は、エージェントビューで `Ctrl+X` を押すか、`claude stop <id>` を実行して停止します。再実行するには、コマンドを再度ディスパッチしてください

### Session was stopped while the respawn was in flight

プロセスが実行されていない[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)を開き、Claude Code がそれを再起動している間に、別の Claude Code プロセスがそのセッションを停止しました。たとえば、別のターミナルでの `claude stop` です。Claude Code はセッションを停止したままにします。

```text theme={null}
Session <id> was stopped while the respawn was in flight
```

ディスパッチしたばかりのセッションを、プロセスがまだ起動中の間に開いた場合は、代わりにプロセスを待機します。v2.1.246 より前は、そのタイミングで開くとセッションが停止し、このメッセージが表示されることがありました。

**対処方法:**

* セッションを停止していない場合は、エージェントビューでその行を再度開くか、`claude respawn <id>` を実行して再起動します
* 自分で停止した場合は、何もする必要はありません。セッションは停止したままになります

### セッションのエージェントが利用できなくなった

`--agent` または `agent` 設定で起動され、[カスタムエージェント](https://code.claude.com/docs/ja/sub-agents.md#invoke-subagents-explicitly)を実行していたセッションを再開しましたが、Claude Code はその名前のエージェントを見つけられませんでした。Claude Code は、[そのワークスペースを信頼している](https://code.claude.com/docs/ja/permissions.md#project-allow-rules-and-workspace-trust)場合はまずセッションの元のディレクトリを検索し、次に再開元のディレクトリを検索します。セッションは引き続き再開されますが、デフォルトのツールが使用されるため、エージェントのツール制限は適用されなくなります。

```text theme={null}
This session was running agent 'code-reviewer', which is no longer available (no agent by that name in /home/you/project). Continuing with the default tools and system prompt — the agent's tool restrictions no longer apply. To restore it, re-create the agent, or resume with an explicit --agent <name>.
```

この警告には Claude Code が検索したディレクトリのみが示されます。[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)を起こす場合、`/resume` または `claude --resume` を実行する場合、[非対話モード](https://code.claude.com/docs/ja/headless.md)で再開する場合のいずれでも、再開された会話に表示されます。非対話モードでは stderr にも出力されます。`--input-format stream-json` を使用するセッションでは表示されません。Agent SDK が起動後にエージェントを提供するためです。

Claude Code はフォールバックをセッションに保存しないため、対処するまで再開のたびに警告が繰り返し表示されます。組み込みの `claude` エージェントでは、デフォルトのツールセットにフォールバックしても何も変わらないため、警告は表示されません。v2.1.216 より前は、Claude Code はデフォルトのエージェントとして何も通知せずに続行し、検索対象も再開元のディレクトリのみだったため、別のディレクトリから再開するとプロジェクトスコープのエージェントが失われていました。

**対処方法:**

* セッションのプロジェクト内の `.claude/agents/<name>.md`、または個人用エージェントの場合は `~/.claude/agents/<name>.md` にエージェントファイルを再作成してから、再度再開します
* または、実在するエージェントを指定して `--agent <name>` で再開し、代わりにそのエージェントとしてセッションを実行します
* エージェントがプロジェクトスコープで、セッションの元のディレクトリを信頼していない場合は、そのディレクトリで Claude Code を一度実行して信頼ダイアログを承認してから、再度再開します

### This session restarted after its next /loop wakeup was due

[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)内の[自己ペースの `/loop`](https://code.claude.com/docs/ja/scheduled-tasks#let-claude-choose-the-interval) が停止しました。ループが次のウェイクアップを待機している間にセッションのプロセスが終了し、セッションの[次のプロセス](https://code.claude.com/docs/ja/agent-view.md#the-supervisor-process)が起動する前にそのウェイクアップの予定時刻が来ました。見逃したウェイクアップが遅れて実行されることはありません。通知には、セッションが再起動した時点でウェイクアップがどれだけ遅れていたかが示されます。

```text theme={null}
This session restarted 12m after its next /loop wakeup was due, so that wakeup will not fire. The loop stays stopped until Claude schedules it again: reply to continue it.
```

v2.1.295 より前は、この状況ではループが通知なしに停止していました。

**対処方法:**

* ループを続行するには、[セッションに返信](https://code.claude.com/docs/ja/agent-view.md#peek-and-reply)し、`keep the loop running` のように続行する旨を伝えます。Claude は返信とともに通知を読み、次のウェイクアップをスケジュールできます
* ループが不要になった場合は、何もする必要はありません。ループはすでに停止しています

### No LLM gateway: a gateway set in your shell isn't passed to a session opened from another folder

このメッセージを表示している[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)は、[LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)を使用していません。ゲートウェイのアドレスを受け取らなかったため、リクエストが失敗します。このメッセージは会話内で Claude の応答の代わりに表示され、セッションの ID とフォルダーが埋め込まれています。

```text wrap theme={null}
No LLM gateway: a gateway set in your shell isn't passed to a session opened from another folder. To fix, run `claude respawn abc12345` from ~/project in another terminal where your gateway is set, or set ANTHROPIC_BASE_URL and its API key or token in a settings file's env block.
```

セッションにアタッチしている間は、プロンプトの下の通知に短い形式の `No LLM gateway: opened from another folder · respawn from ~/project` が表示されます。

`ANTHROPIC_BASE_URL` がゲートウェイに設定されている状態で、メッセージに示されたフォルダー以外のフォルダーからセッションをディスパッチ、起動、または再起動しました。シェルでエクスポートしたゲートウェイがバックグラウンドセッションに届くケースについては、[LLM ゲートウェイ](https://code.claude.com/docs/ja/agent-view.md#llm-gateway)を参照してください。

**対処方法:**

* **ゲートウェイを設定するプロジェクトでエージェントビューを使用した場合**: `ANTHROPIC_BASE_URL` とその API キーまたはトークンを [設定ファイルの `env` ブロック](https://code.claude.com/docs/ja/llm-gateway-connect#set-in-a-settings-file)に記述します。`~/.claude/settings.json`、またはセッション自身のプロジェクト内の `.claude/settings.local.json` を使用してください。どちらも再起動されたセッションが読み込みます。その後、任意のフォルダーからシェルで `claude respawn <id>` を実行します。
* **ターミナルでゲートウェイをエクスポートした場合**: ゲートウェイ変数をエクスポートしたターミナルで、メッセージに示されたフォルダーに `cd` し、メッセージの `claude respawn <id>` コマンドを実行します。セッションは保存された会話から再起動されます。
  * ゲートウェイがセッションに届くのは、[スーパーバイザー](https://code.claude.com/docs/ja/agent-view.md#the-supervisor-process)自体が同じゲートウェイをエクスポートしたシェルから起動された場合のみです。そうでない場合は、[Dispatch fails with `Could not resolve authentication method`](https://code.claude.com/docs/ja/agent-view#dispatch-fails-with-could-not-resolve-authentication-method) の説明に従ってそのターミナルからスーパーバイザーを再起動し、その後 respawn コマンドを再度実行します。

v2.1.302 より前は、この状況のバックグラウンドセッションでは、代わりに [`Not logged in · Please run /login`](#not-logged-in) などのサインインエラーが表示され、フォルダーは示されませんでした。

### CLAUDE\_CODE\_PROCESS\_WRAPPER ランチャーのエラー

[`CLAUDE_CODE_PROCESS_WRAPPER`](https://code.claude.com/docs/ja/corporate-launcher) が設定されていますが、その値を使用できないため、Claude Code はランチャーなしで実行するのではなく、影響を受けるプロセスの起動を拒否します。設定の問題は、変数名で始まり理由を示すメッセージで報告されます。たとえば次のとおりです。

```text theme={null}
CLAUDE_CODE_PROCESS_WRAPPER: launcher `/opt/corp/launcher` is not an executable regular file
```

起動はするものの、自身を Claude Code に置き換えずに終了するランチャーは、起動しようとしていたセッションを失敗させます。エージェントビューのそのセッションの行には、ランチャーが `must exec, not daemonize` であることが報告され、その後にランチャーが出力した内容が続きます。ランチャーが原因で起動できない、またはバックグラウンドサービスに到達できないセッションは、`Couldn't reach the background service (...)` 内の理由としてランチャーの問題を報告します。

**対処方法:**

* 変数を、最後に `exec "$@"` を呼び出す実行可能ファイルの絶対パスに設定します。完全な規約については、[ランチャーの規約](https://code.claude.com/docs/ja/corporate-launcher.md#the-launcher-contract)を参照してください
* `/status` を確認します。Self-exec の項目に解決済みの起動コマンドが表示され、実行中のバックグラウンドサービスがそれと一致しない場合は警告が表示されます。または、シェルから `claude daemon status` を実行します
* [設定](https://code.claude.com/docs/ja/corporate-launcher.md#set-up-the-launcher)の `env` ブロックで値を修正した後、`claude daemon stop --any` でバックグラウンドサービスを再起動し、次のディスパッチでラップされたサービスが起動されるようにします

### バックグラウンドセッション開始時の EUNKNOWN

Windows が標準名のないエラーコードでプログラムの起動を拒否したため、失敗が `EUNKNOWN` として表示されます。通常の原因は、グループポリシーや AppLocker などのソフトウェア制限ポリシーが、起動しようとしているプログラムをブロックしていることです。このエラーは、`/background` または `claude --bg` で[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)を開始したときに表示されます。

```text theme={null}
Couldn't reach the background service (spawn background service: EUNKNOWN: unknown error, uv_spawn) — run 'claude daemon status'
```

一部のアカウントでは、メッセージに `background service` の代わりに `daemon` と表示されます。

npm インストールでは、`npm install -g @anthropic-ai/claude-code` がバイナリを置き換えている間に表示される `EUNKNOWN` は、[再インストール中の `EACCES`](#eacces-when-starting-a-background-session) と同じ原因であり、インストール完了後に再試行すると解消します。

Claude Code は、ターミナルを閉じてもサービスが存続するように、PowerShell を介してバックグラウンドサービスを起動します。PowerShell 7 がインストールされている場合はそれを使用し、インストールされていない場合は Windows PowerShell 5.1 を使用します。どちらの PowerShell も実行できない場合、Claude Code は代わりにサービスを直接起動するため、PowerShell のみをブロックするポリシーではこのエラーは発生しません。

v2.1.212 より前は、Claude Code はサービスの起動に Windows PowerShell 5.1 のみを使用していたため、グループポリシーが PowerShell 5.1 をブロックしているマシンでは、PowerShell 7 がインストールされていても `Couldn't start the session — EUNKNOWN: unknown error, uv_spawn` で失敗していました。

**対処方法:**

* メッセージが `Couldn't start the session` となっている場合は、v2.1.212 以降にアップグレードしてください。それより前のバージョンでは、先に別のターミナルで `claude daemon run` を実行してから、バックグラウンドセッションを再度開始することもできます。このコマンドはバックグラウンドサービスをターミナルのフォアグラウンドで実行するため、サービスはそのターミナルが開いている間のみ存続します。
* npm インストールがバイナリを置き換えていた場合は、完了を待ってから、バックグラウンドセッションを再度開始します
* npm インストールが実行されていないにもかかわらず v2.1.212 以降でエラーが表示される場合は、制限ポリシーが Claude Code の実行可能ファイルをブロックしていないか、Windows 管理者に確認してください
* ターミナルを閉じるとバックグラウンドサービスが停止する場合、Claude Code は PowerShell を使わずにサービスを起動しています。サービスがターミナルより長く存続できるように、PowerShell 7 をインストールするか、PowerShell のブロックを解除するよう管理者に依頼してください。

### バックグラウンドセッション開始時の EACCES

Claude Code は、バックグラウンドセッションをホストする[バックグラウンドサービス](https://code.claude.com/docs/ja/agent-view.md#the-supervisor-process)を起動するために自身のバイナリを実行できませんでした。npm インストールでは、通常これは、その時点で `npm install -g @anthropic-ai/claude-code` がバイナリを置き換えていたことを意味します。ユーザー自身が実行した場合も、[自動アップデーター](https://code.claude.com/docs/ja/setup.md#auto-updates)が実行した場合もあります。このエラーは、[エージェントビュー](https://code.claude.com/docs/ja/agent-view.md)からセッションを開いたときに表示されます。

```text theme={null}
Couldn't start the background service — spawn background service: EACCES: permission denied, posix_spawn '/usr/local/lib/node_modules/@anthropic-ai/claude-code/bin/claude'
```

`/background` または `claude --bg` でセッションを開始した場合は、同じ理由が `Couldn't reach the background service (...)` 内に表示されます。同じ再インストールの時間帯には、代わりに `ENOENT` や `ENOEXEC`、Windows では `EUNKNOWN` や `EPERM` など、別のコードがエラーに示されることがあります。再試行しても続く `EUNKNOWN` は、[別の原因](#eunknown-when-starting-a-background-session)によるものです。

npm インストールでは、Claude Code は再インストールの完了を待ち、自動的に再試行します。待機は最大 10 秒ですが、Claude Code の npm インストールがマシン上でまだ実行中であることが確認できる間は最大 2 分で、これは別の Claude Code プロセスが更新をダウンロードしている場合にも対応します。インストールがその待機時間を超えた場合、失敗メッセージには単なるエラーコードではなく更新の旨が示されます。

```text theme={null}
Claude Code is being updated by npm on this machine (still not runnable after 2 min, EACCES) — try again when the update finishes
```

v2.1.257 より前は、待機はすべてのケースで 10 秒で打ち切られていたため、別の Claude Code プロセスがまだ更新をダウンロードしている間にこのエラーが表示されていました。v2.1.246 より前は、Claude Code は待機せずに即座に失敗していました。

**対処方法:**

* 数秒待ってから、セッションを開くかディスパッチを再度実行します。Claude Code が更新中であるとメッセージに示されている場合は、更新が完了してから再試行してください。
* npm インストールが実行されていないにもかかわらずエラーが続く場合、ユーザーがインストール済みのバイナリを実行できません。バイナリとそのディレクトリの権限を確認するか、Claude Code を再インストールしてください。

### Background service exited before it became reachable

Claude Code が[バックグラウンドサービス](https://code.claude.com/docs/ja/agent-view.md#the-supervisor-process)として起動したプロセスが、接続を受け付ける前に終了したため、Claude Code はセッションを開けませんでした。サービスが終了前にエラーを出力した場合、括弧内の理由には終了コードまたはシグナルと、サービスが出力した最初の行が示され、その行が停止の原因を示しています。

```text theme={null}
Couldn't reach the background service (background service exited before it became reachable (exit code N): <the service's first error line>) — run 'claude daemon status'
```

[エージェントビュー](https://code.claude.com/docs/ja/agent-view.md)からセッションを開いた場合は、同じ理由が `Couldn't start the background service —` の後に続きます。サービスが終了前に何も出力しなかった場合、メッセージには代わりに `nothing on stderr` と示されます。

Claude Code は、サービスのエラー行とともに失敗を報告します。v2.1.246 より前は、失敗は 45 秒の待機後に `background service did not become reachable within 45s` としてのみ表示され、サービスのエラー行は含まれていませんでした。

引用される理由のうち 2 つは、原因がわかっています。

* `Error: claude native binary not installed.`: その時点で npm インストールが Claude Code のバイナリを置き換えていたため、サービスが npm のプレースホルダーを実行しました。インストールの完了後に再試行してください。インストールが実行されていないのにこの行が続く場合は、[npm インストールを完了してください](https://code.claude.com/docs/ja/troubleshoot-install.md#native-binary-not-found-after-npm-install)。v2.1.257 より前は、macOS の npm による自己更新では、インストール中の起動のたびにこの失敗が発生していました。
* Windows で、起動のたびに終了コード 1 とともに `nothing on stderr` が表示される場合: `daemon.lock` に記録されたプロセスに対して、Claude Code がシグナルを送ることも、終了していることを証明することもできないため、新しいサービスはそれぞれ別のサービスがロックを保持していると判断して終了します。書き込んだプロセスが終了していることを Claude Code が証明できるロックは自動的に置き換えられ、この失敗は発生しません。起動のたびに失敗が繰り返される場合は、`~/.claude/daemon.lock` を削除してから、セッションを開くかディスパッチを再度実行してください。v2.1.257 より前は、このようなロックがあると、ファイルを削除するまですべての起動がブロックされていました。

**対処方法:**

* メッセージに行が引用されている場合は、その内容を修正してから、セッションを開くかディスパッチを再度実行します。次の試行でサービスが再度起動されます
* `claude daemon status` を実行して、現在サービスが実行中かどうかを確認します

### バックグラウンドセッション開始時に作業ディレクトリが存在しなくなった

[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)を開始したディレクトリが、セッションの起動中に削除されました。Claude Code はセッションを開始せず、メッセージには存在しないディレクトリが示されます。

```text theme={null}
Couldn't start a background session (working directory no longer exists or is not accessible: /tmp/demo)
```

v2.1.257 より前は、セッションは開始したように見え、その後エージェントビューに同じ理由の失敗した行として表示されていました。

v2.1.281 より前は、セッションを開始する前にすでにディレクトリが存在しなかった場合にも、このメッセージが表示されていました。そのケースでは [`could not be resolved on disk`](#workspace-not-trusted-when-dispatching-a-background-session) が報告されます。

**対処方法:**

* メッセージに示されたディレクトリを再作成するか、存在するディレクトリからディスパッチしてから、再試行します

### This forked session could not be started

claude.ai から [Remote Control セッションをフォーク](https://code.claude.com/docs/ja/remote-control.md#fork-a-session-from-your-browser)しましたが、Claude Code はマシン上でフォークを実行する[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)の起動を完了できませんでした。この通知は、フォークされたセッションのトランスクリプトに表示されます。

```text theme={null}
This forked session could not be started. Fork the conversation again to retry.
```

フォーク元のセッションは実行を続けます。

**対処方法:**

* フォーク元のセッションに戻り、セッションがアイドル状態になったら再度フォークします

### バックグラウンドセッションのディスパッチ時にワークスペースが信頼されていない

[信頼](https://code.claude.com/docs/ja/permissions.md#project-allow-rules-and-workspace-trust)していないディレクトリで[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)を開始または再起動しましたが、確認のためのワークスペース信頼ダイアログを表示できませんでした。Claude Code はセッションを開始しません。

```text theme={null}
Workspace not trusted. Run `claude` in /path/to/project once and accept the trust prompt, then retry.
```

セッション自身のディレクトリにあるターミナルから同じコマンドを実行すると、代わりに信頼ダイアログが表示され、承認するとセッションが開始されます。このメッセージは、スクリプト内や、セッション自身のディレクトリ以外のディレクトリからセッションを再起動する場合など、ダイアログを表示できない場所で表示されます。

2 つのバリアントは、別の原因を示します。

* **`The home directory is trusted one session at a time`**: セッションのディレクトリがホームディレクトリです。Claude Code はホームディレクトリに対する信頼を保存しないため、以前のセッションでそこでダイアログを承認していても有効になりません。
* **`<path> could not be resolved on disk`**: Claude Code がディスク上でセッションのディレクトリを見つけられませんでした。

v2.1.286 より前は、Windows では、信頼レコードがパスの大文字・小文字が異なる形で保存されていた場合、すでに信頼したディレクトリでもこのメッセージが表示されることがありました。v2.1.286 以降に更新してください。

**対処方法:**

* メッセージに示されたディレクトリで `claude` を実行して信頼ダイアログを承認してから、コマンドを再度実行します
* ホームディレクトリに関するメッセージの場合は、ダイアログを表示できるようにホームディレクトリのターミナルからコマンドを実行するか、代わりにプロジェクトディレクトリからセッションを開始します
* `could not be resolved on disk` のメッセージの場合は、ディレクトリを再作成するか、存在するディレクトリから新しいセッションを開始します

## ラッパーと IDE エラー

これらのエラーは、IDE 拡張機能や [Agent SDK](https://code.claude.com/docs/ja/agent-sdk/overview.md) アプリケーションなど、Claude Code を起動したプログラムから発生します。Claude Code 自体からではなく、ラッパーから発生するものです。

### Subprocess initialization did not complete within 60000ms

このエラーは、[VS Code 拡張機能](https://code.claude.com/docs/ja/vs-code.md) または Agent SDK アプリケーションが起動した Claude Code プロセスが、準備完了を時間内に報告しなかったことを意味します。拡張機能またはアプリケーションはその後、そのプロセスを停止しました。VS Code の会話では、このエラーは `Claude Code did not finish starting` で始まります。例：

```text theme={null}
Claude Code did not finish starting: it did not answer in time. The output logs ("View output logs") show how far it got. Slow plugins, MCP servers, hooks, disks or network can each cause this.
```

拡張機能の出力ログ、サインイン画面、および Agent SDK アプリケーションでは、エラーの文面が異なります。`Subprocess initialization did not complete within` と制限時間で始まり、続いて Claude Code が報告した内容が示されます。例：

```text theme={null}
Subprocess initialization did not complete within 60000ms. Claude Code did not answer the initialize request and reported no SessionStart or Setup hook running. Slow plugins, MCP servers, hooks that Claude Code does not report, disks or network can each cause this.
```

**対応方法：**

* VS Code でもう一度試すには、メッセージを送信してください。サインイン中にエラーが表示された場合は、代わりにサインイン方法をもう一度選択してください。
* Claude Code がどこまで進んだかを確認するには、会話のエラーの下にある **View output logs** をクリックするか、コマンドパレットから **Claude Code: Show Logs** を実行してください。[問題を報告する](https://github.com/anthropics/claude-code/issues)際は、`Subprocess initialization` の行の前後のエントリを含めてください。
* ネットワークを確認するには、[ネットワーク設定](https://code.claude.com/docs/ja/network-config.md)を参照してください。メッセージにサインインまたは認証を確認するよう書かれている場合は、[ログインと認証](https://code.claude.com/docs/ja/troubleshoot-install.md#login-and-authentication)を参照してください。
* メッセージに [SessionStart](https://code.claude.com/docs/ja/hooks.md#sessionstart) フックまたは [Setup](https://code.claude.com/docs/ja/hooks.md#setup) フックが完了していなかったと書かれている場合は、[フックの実行時間を確認](https://code.claude.com/docs/ja/hooks.md#debug-hooks)してください。VS Code では、Claude Code がこれらのフックの実行を報告している最初の 10 分間は、60 秒の制限時間にカウントされません。遅いフックがより早く完了するようにするか、非同期でないフックの [`timeout`](https://code.claude.com/docs/ja/hooks#common-fields) を下げるか、[フックを削除](https://code.claude.com/docs/ja/hooks.md#disable-or-remove-hooks)してください。
* Agent SDK アプリケーションが [`startup()`](https://code.claude.com/docs/ja/agent-sdk/typescript#startup) を呼び出す場合は、起動全体に十分な長さの `initializeTimeoutMs` を設定するか、未設定のままにして、報告されたフックの実行時間のうち最大 10 分間がカウントされないようにしてください。

VS Code 拡張機能 v2.1.304 および TypeScript Agent SDK v0.3.304 より前では、すべてのフックの実行時間が制限時間にカウントされていました。デフォルトの制限時間では、メッセージに `Subprocess initialization did not complete within 60000ms — check authentication and network connectivity` が含まれていました。この文面が表示される場合は、拡張機能または SDK を更新してください。

### Claude Code process exited with code N

基盤となる `claude` プロセスがゼロ以外のコードで終了しました。終了コードだけでは何が失敗したかは分かりません。実際のエラーはプロセス自体の出力にあり、ラッパーはキャプチャした場合はそれを追加し、そうでない場合はログに保持します。

```text theme={null}
Error: Claude Code process exited with code 1
```

Windows では、ネイティブビルドはターンが完了した直後にコード `4294967295` で終了することがあります。その終了がターン境界に着地し、待機中のメッセージがなく、バックグラウンドタスクが実行されていない場合、[VS Code 拡張機能](https://code.claude.com/docs/ja/vs-code.md) はこのエラーを表示する代わりに、セッションを静かに閉じます。次のメッセージで会話が再開されます。

v2.1.273 より前では、拡張機能は何も失われていないにもかかわらず、すべてのターン境界でそのエラーを表示していました。

**対応方法：**

* VS Code では、エラーと共に表示される **View output logs** リンクをクリックして、基盤となるエラーを確認してください
* Agent SDK アプリケーションでは、メッセージループの周りでエラーをキャッチしてください。[CLI プロセス終了](https://code.claude.com/docs/ja/agent-sdk/troubleshooting.md#cli-process-exit) の下のエントリは、各 SDK 言語でコードが受け取るものをカバーしています。
* 同じプロジェクトのターミナルで `claude` を実行してください。通常、失敗はそこで実際のエラーメッセージと共に再現され、このページで検索できます。
* ターミナルで `claude doctor` を実行して、インストールと設定を確認してください

### Could not locate the Claude CLI on PATH

[VS Code 拡張機能](https://code.claude.com/docs/ja/vs-code.md) は、Windows で統合ターミナルで Claude Code を開き、ターミナルのシェルが PowerShell で、拡張機能がインストールされた `claude` 実行ファイルを PATH で見つけられない場合、このエラーを表示します。拡張機能は、インストールされた `claude` を PATH で見つけるまで Claude Code の起動を拒否します。

```text theme={null}
Failed to run Claude Code: Error: Could not locate the Claude CLI on PATH. Launching by name in a PowerShell terminal would run a 'claude' from the open folder instead of the installed CLI, so the launch was blocked. Make sure the Claude CLI's install directory is on your system PATH (not only your PowerShell profile), then restart VS Code and try again. VS Code reads PATH when it starts, so PATH changes take effect only after a restart.
```

**対応方法：**

* VS Code の外で新しい PowerShell ウィンドウを開き、`where.exe claude` を実行してください。パスが出力されない場合、CLI は PATH にありません。[PATH を確認する](https://code.claude.com/docs/ja/troubleshoot-install.md#verify-your-path) に従ってインストールディレクトリを追加してください。パスが出力される場合、エントリは PowerShell プロファイルから、または VS Code がまだ取得していない PATH 変更から来ています。次の 2 つのステップがこれらのケースをカバーしています。
* PATH エントリを PowerShell プロファイルではなく、ユーザーまたはシステム環境変数として設定してください。拡張機能はプロファイルを実行しないため、そこにのみ存在する PATH 編集は拡張機能に到達しません。
* PATH を変更した後、VS Code を再起動してください。拡張機能は VS Code が起動時にキャプチャした PATH をチェックするため、PATH 変更は再起動後にのみ有効になります。

### The Claude Code program for this computer could not be found

[VS Code 拡張機能](https://code.claude.com/docs/ja/vs-code.md) は、内部にバンドルされている Claude Code のコピーを探しましたが、このコンピューター向けにビルドされたものが見つかりませんでした。メッセージには、このコンピューターに必要なビルドが示されます。

```text theme={null}
The Claude Code program for this computer, the Linux (linux-x64) build, could not be found.
```

**対応方法：**

* 拡張機能が保持しているビルドがメッセージに示されている場合、別のプラットフォーム向けの拡張機能パッケージがインストールされています。メッセージに示されているビルド向けに作られたパッケージをインストールしてください
* 拡張機能が保持しているビルドがメッセージに示されていない場合は、エディターの Extensions ビューから Claude Code 拡張機能を再インストールしてください
* または、いずれの場合も、[`claudeCode.claudeProcessWrapper`](https://code.claude.com/docs/ja/vs-code#extension-settings) を別途インストールした `claude` バイナリに設定してください

v2.1.290 より前では、これは `Unsupported platform: <platform>-<arch>. No compatible Claude Code binary found.` として表示されていました。

### The connection to Claude Code ended before this message completed

[VS Code 拡張機能](https://code.claude.com/docs/ja/vs-code.md) はメッセージを `claude` プロセスに送信し、プロセスが確認または完了する前に接続がエラーなしで終了しました。拡張機能はメッセージが処理されたかどうかを判断できないため、再度送信するよう求めます。

```text theme={null}
The connection to Claude Code ended before this message completed — it may not have been processed, so please send it again.
```

**対応方法：**

* メッセージを再度送信してください。次のメッセージは会話を再開する新しい `claude` プロセスを開始します。
* 繰り返される場合は、同じプロジェクトのターミナルで `claude` を実行してください。プロセスを終了し続ける失敗は通常、そこで実際のエラーメッセージと共に再現されます。

### Claude Code needs a recent sign-in

Code タブのローカル、WSL、または SSH セッションで新たに保存されたサインインが必要で、最近サインインしていない場合、[Claude Desktop アプリ](https://code.claude.com/docs/ja/desktop.md) はこのメッセージを表示します。

```text theme={null}
For security, Claude Code needs a recent sign-in.
```

これらのセッションでは、シングルサインオン（SSO）の有無にかかわらず、各コンピューターのアカウントと組織ごとに最大で月に 1 回程度サインインを求められるのは通常のことです。

**対応方法：**

* カードの **Sign in again** をクリックしてから、サインインしてください
* Code タブの上部のバナーに `Claude Code needs a recent sign-in. Signing in won’t stop sessions.` と表示されている場合は、バナーの **Sign in again** をクリックしてください
* 同じコンピューターで同じアカウントと組織を使用しているにもかかわらず、これらのセッションで 3 週間以内に再度求められる場合は、Claude Desktop の[バージョンを確認](https://code.claude.com/docs/ja/desktop.md#check-your-version)してください。v5.11492.0 より古い場合は更新してください：
  * **macOS**：**Claude > Check for Updates…** を選択します
  * **Windows**：**Help > Check for Updates…** を選択するか、Microsoft Store からアプリをインストールした場合はそこから更新します
  * **Linux**：[apt で更新](https://code.claude.com/docs/ja/desktop-linux.md#update)します
  * **管理された更新**：組織が[自動更新をオフにしている](https://code.claude.com/docs/ja/desktop.md#device-management-policies)場合は、管理者に v5.11492.0 以降を依頼してください
* v5.11492.0 以降でもこれが続く場合は、[サポートに連絡](https://code.claude.com/docs/ja/desktop.md#still-stuck)してください

Remote Control セッションでこのカードが表示される場合は、[Trusted Devices](https://code.claude.com/docs/ja/remote-control.md#trusted-devices) を参照してください。この機能により、より最近のサインインが求められることがあります。

Claude Desktop v5.11492.0 より前では、企業のプロキシまたはゲートウェイがバックグラウンドでの更新に JSON エラーで応答した場合、Code タブの保存済みサインインが失われることがありました。

## Rewind の警告とエラー

これらのメッセージは、[`/rewind`](https://code.claude.com/docs/ja/checkpointing) コード復元から発生します。`Restored the code, but skipped N files` は Claude Code が一部のパスをスキップしたことを示す警告です。`No files were restored` は何も復元されなかったことを意味するエラーです。

### Restored the code, but skipped files

`/rewind` コード復元は、1 つ以上の追跡パスをスキップしました。これらのパスに対して書き込みまたは削除を行いませんでした。Claude Code は以下の場合にパスをスキップします。

* シンボリックリンク、ハードリンク、またはその他の通常ファイル以外のファイルである、またはそうなった場合
* チェックポイント以降にそのディレクトリが変更された場合
* バックアップを安全に読み取ることができない場合

スキップされたパスは現在の内容を保持します。v2.1.216 より前では、`/rewind` は追跡パスのリンクを通じて書き込みと削除を行い、部分的な復元を報告しませんでした。

```text theme={null}
Restored the code, but skipped 2 files: the tracked path is (or became) a link or other non-regular file, its directory changed since the checkpoint, or its backup could not be safely read. Skipped files were left untouched — run with --debug for the paths.
```

**対応方法：**

* スキップされたファイルを特定して、以下の手順で各ファイルを処理してください。メッセージはカウントのみを示します。`~/.claude/debug/<session-id>.txt` のデバッグログには、復元の実行時に各スキップされたパスが記載されます。次の復元の前に `/debug` でデバッグログを有効にしてください。macOS または Linux では、代わりにリンクを直接見つけることができます。シンボリックリンクの場合は `find . -type l`、ハードリンクされたファイルの場合は `find . -type f -links +1` を実行してください。
* スキップされたファイルが、dotfile マネージャーで管理されている設定ファイルや pnpm などのツールでハードリンクされたファイルなど、意図的に作成したリンクである場合、rewind はその内容をそのままにしました。セッションの変更を元に戻すには、Claude にその編集を逆にするよう依頼するか、ファイルを自分で編集してください。
* リンクを作成していない場合は、その内容を信頼する前にパスを検査してください。

### No files were restored

[`/rewind`](https://code.claude.com/docs/ja/checkpointing) によるコード復元が少なくとも 1 つのファイルで失敗し、ファイルが 1 つも復元されなかった場合に、このメッセージが表示されます。

```text theme={null}
Failed to restore the code:
No files were restored: 1 file failed (backup missing, or the file could not be updated)
```

Claude Code は、[retention sweep](https://code.claude.com/docs/ja/claude-directory.md#cleaned-up-automatically) でセッションのバックアップを削除します。デフォルトではセッションが最後にバックアップを保存してから約 30 日後です。その後にセッションを再開した場合、`/rewind` はそのチェックポイントをリストしますが、そのいずれかに rewind すると、このエラーで失敗する可能性があります。メッセージに `N paths were skipped for link safety` も表示されている場合は、これらのパスについて [Restored the code, but skipped files](#restored-the-code-but-skipped-files) を参照してください。

セッションをフォークする場合（例えば [`--fork-session`](https://code.claude.com/docs/ja/cli-reference#cli-flags) または [`/branch`](https://code.claude.com/docs/ja/sessions#branch-a-session) を使用する場合）、Claude Code は元のセッションのバックアップをフォークにコピーします。Claude Code がバックアップをコピーできない場合（例えばディスクがいっぱいの場合）、そのバックアップはフォークに存在しません。それを必要とするチェックポイントに rewind すると、このエラーで失敗する可能性があります。

**対応方法：**

* 別の方法で変更を元に戻してください。Claude に編集を逆にするよう依頼するか、バージョン管理からファイルを復元してください。バックアップがなくなると、`/rewind` を再度実行しても同じ方法で失敗します。
* **Restore code** を選択した後に Claude Code がファイルに書き込みまたは削除できなかった場合は、ファイル権限など書き込みをブロックしているものを修正してから、`/rewind` を再度実行してください。
* 今後のセッションでバックアップをより長く保持するには、[`cleanupPeriodDays`](https://code.claude.com/docs/ja/settings-reference#cleanupperioddays) を増やしてください。

v2.1.260 より前では、Claude Code はバックアップが見つからないファイルをサイレントにスキップし、rewind が成功したように見えました。

## セッション保存の警告

Claude Code は、セッショントランスクリプトを保存していない場合、入力ボックスの下の永続的な行に以下の警告を表示します。セッションはどちらの場合でも機能し続けます。警告は、後で [`--resume`](https://code.claude.com/docs/ja/sessions) でセッションが見つからない可能性があることを示しています。

### トランスクリプト書き込みが失敗しています

Claude Code は作業中にトランスクリプトをディスクに保存し、[トランスクリプトファイル](https://code.claude.com/docs/ja/sessions.md#where-transcripts-are-stored) への書き込みが失敗しています。メッセージは原因を基になるエラーコードで示します。例えば、ディスクがいっぱいの場合：

```text theme={null}
Transcript writes are failing (disk full — ENOSPC) · recent messages may not be saved for resume
```

警告は、エラーに応じて異なるポイントで表示されます：

* 自動的にクリアされない条件での最初の失敗：ディスクがいっぱい、ディスククォータを超過、ファイルシステムが読み取り専用、パスがファイルシステムの長さ制限を超過、または macOS と Linux では権限エラー
* 少なくとも 1 分間にわたる繰り返しの失敗（Windows での権限エラーを含む、ウイルス対策スキャンが単一の書き込みに失敗してから再試行で成功する場合など）

v2.1.217 より前では、Claude Code は失敗した書き込みを警告なしにドロップし、後で `--resume` で最近のメッセージが見つからないことが最初の兆候でした。

**対応方法：**

* エラーコードが示す条件を修正します：`ENOSPC` の場合はディスク容量を解放、`EDQUOT` の場合はクォータを引き上げるかクリア、`EACCES`、`EPERM`、または `EROFS` の場合はトランスクリプト位置への書き込みアクセスを復元
* 警告は次の書き込み成功時に自動的にクリアされます
* 警告が表示されている間に送信されたメッセージは、後でセッションを再開するときに見つからない可能性があります

### CLAUDE\_CODE\_SKIP\_PROMPT\_HISTORY が設定されているため、トランスクリプト保存がオフになっています

このセッションは [`CLAUDE_CODE_SKIP_PROMPT_HISTORY`](https://code.claude.com/docs/ja/env-vars) が設定された状態で開始されたため、Claude Code はこのセッションのトランスクリプトまたはプロンプト履歴を書き込みません：

```text theme={null}
Transcript saving is off — CLAUDE_CODE_SKIP_PROMPT_HISTORY is set · --resume will not find this session; if unintended, unset it and restart
```

この変数は、一時的なスクリプト化されたセッションの意図的なオプトアウトですが、シェルプロファイル、ラッパースクリプト、またはそれをエクスポートした親プロセスを通じてセッションに到達することもあります。

**対応方法：**

* 変数を意図的に設定した場合、アクションは不要です。通知は、セッションが `--resume`、`--continue`、または上矢印履歴に表示されないことを確認します
* 設定していない場合は、`claude` を起動するシェルまたはスクリプトから変数を削除し、新しいセッションを開始します。現在のセッションからのメッセージは遡及的に保存されません。

### CLAUDE\_CODE\_CHILD\_SESSION マーカーを継承しているため、トランスクリプト保存がオフになっています

Claude Code は、生成するサブプロセスで [`CLAUDE_CODE_CHILD_SESSION`](https://code.claude.com/docs/ja/env-vars) を設定し、それを継承するインタラクティブセッションをネストされたものとして扱います：Claude Code はそのトランスクリプトを保存しないため、Claude 自体が開始するセッションは `--resume` リストを埋めません。この通知は、現在のセッションがマーカーを継承したことを意味します：

```text theme={null}
Transcript saving is off — inherited CLAUDE_CODE_CHILD_SESSION marker · restart with CLAUDE_CODE_FORCE_SESSION_PERSISTENCE=1 to keep future transcripts
```

この通知は、別の Claude Code セッション内から `claude` を実行した場合に予想されます。マーカーが長寿命の仲介者（例えば、Claude Code セッションが元々開始したターミナル、`screen` セッション、またはランチャー）を通じてリークした場合、誤分類を示します。

tmux 内では、Claude Code は tmux サーバーのグローバル環境を通じて到達したマーカーを検出し、保存を続けるため、このケースではこの通知は表示されません。

**対応方法：**

* このセッションを別の Claude Code セッション内から意図的に開始した場合、アクションは不要です
* これがトップレベルセッションの場合、終了して [`CLAUDE_CODE_FORCE_SESSION_PERSISTENCE=1`](https://code.claude.com/docs/ja/env-vars) を設定して再起動します。保存は再起動から適用されるため、その前に送信されたメッセージは保存されません。
* 同じターミナルまたはランチャーからの将来の起動を修正するには、その環境から `CLAUDE_CODE_CHILD_SESSION` を削除します

## 設定の警告

対話セッションで Claude Code が起動時に出した警告を見つけるには、まず起動バナーの下を確認し、次にデバッグログを確認します。

* **起動バナーの下の行**: [`⚠ Deny rule Bsh matches no tool · check for typos`](#matches-no-tool) など、[権限ルール](https://code.claude.com/docs/ja/permissions.md)に関する一部の警告
* **デバッグログ**: Claude Code はデバッグモードでのみこのログを保持します。ログ内の警告を読むには、シェルから `claude --debug-file <path>` で Claude Code を起動し、そのパスにあるファイルを開きます。

テキスト出力の[非対話モード](https://code.claude.com/docs/ja/headless.md)では、[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)の外であれば、起動時の警告を stderr で確認します。

v2.1.305 より前では、対話セッションでも stderr を確認してください。現在はバナーの下の行として表示される権限ルールの警告も同様です。

### Claude Code exited after an unrecoverable interface error

Claude Code は、ターミナルインターフェースが回復できないエラーに遭遇して終了したときに、使用していたレンダラーがどちらであってもこのメッセージを表示します。2 文目は、[フルスクリーン](https://code.claude.com/docs/ja/fullscreen.md)レンダラーの起動中にエラーが発生した場合にのみ表示されます。

```text theme={null}
Claude Code exited after an unrecoverable interface error (<error>). It happened while the fullscreen renderer was starting, so the next launch will use the classic renderer (CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN=1 forces that any time).
```

**対処方法:**

* Claude Code を再度起動します。会話を再開するには、同じディレクトリで `claude --resume` を実行します。
* メッセージにフルスクリーンレンダラーが示されている場合、次回の起動時の動作（フルスクリーンをどのようにオンにしたかによって異なります）と、フルスクリーンを再度試す方法やクラシックレンダラーを使い続ける方法については、[フルスクリーンレンダリング](https://code.claude.com/docs/ja/fullscreen.md#fullscreen-renderer-didnt-finish-starting)を参照してください。

v2.1.236 より前では、この種のエラーの後、Claude Code はメッセージを表示せずに終了していました。

### Agent descriptions are over the 15.0k-token limit

Claude Code はこの警告を stderr ではなく、会話ビューの起動時通知として表示します。組み込みのものを除く[サブエージェント](https://code.claude.com/docs/ja/sub-agents.md)の説明の合計が、Claude Code の推定で 15,000 トークンを超えています。各エージェントについて、名前と `description` フロントマターがカウントされます。合計が上限を超えているかどうかにかかわらず Claude Code はすべてのエージェントを読み込むため、この警告によって読み込まれる内容は変わりません。

```text theme={null}
Agent descriptions are over the 15.0k-token limit (~16.2k tokens) · ask Claude to trim agent descriptions in .claude/agents/
```

**対処方法:**

* エージェントファイルの `description` フロントマターを短くするか、Claude に短縮を依頼します。
* 使用しなくなったエージェントファイルを削除します。

### Hook needs quotes around a path with a space

会話ビューに表示されるこの通知は、フックのスクリプトのパスにスペースが含まれていて引用符で囲まれていないため、そのスクリプトが実行されなかったことを意味します。そのフックはシェル形式の [`asyncRewake`](https://code.claude.com/docs/ja/hooks#run-hooks-in-the-background) フックです。その `command` では、`python3` などのインタープリターの後に引用符で囲まれていないパスのプレースホルダーが続いており、解決されたパスにスペースが含まれています。

通知はフックのイベント名で始まり、スクリプトの名前が示されます。

```text theme={null}
Stop hook needs quotes around a path with a space (check.py)
```

**対処方法:**

* 通知に示されたスクリプトを実行するフックの `command` で、パスを二重引用符で囲みます。JSON ファイルでは、`"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/hooks/check.py\""` のように記述します。

### Instruction file not loaded

対話セッションの会話ビューに表示されるこの通知は、存在する[メモリファイル](https://code.claude.com/docs/ja/memory.md#how-claude-md-files-load)が読み込まれなかったことを意味します。読み取り制限が適用されています。

```text theme={null}
Instruction file not loaded (a Read deny rule covers it):
path: .claude/rules/shared.md
```

括弧内には理由が示されます。例:

* **`a Read deny rule covers it`**: `Read` の[拒否ルール](https://code.claude.com/docs/ja/permissions.md#read-and-edit)が、記述されたとおりのファイルのパス、またはそのファイル上のリンクの参照先に一致している
* **`it's read from outside your working directories, where reads are blocked`**: [`permissions.blockReadsOutsideWorkingDirectories`](https://code.claude.com/docs/ja/settings-reference#permissions-blockreadsoutsideworkingdirectories) がオンの状態で、ファイルが[作業ディレクトリ](https://code.claude.com/docs/ja/settings-reference.md#permissions-blockreadsoutsideworkingdirectories)の外に解決される
* **`where it leads couldn't be worked out`**: たとえば、ファイルが直接または他のリンクを介して自分自身に戻るリンクになっている

Claude がサブディレクトリ内のファイルを操作する際にそのサブディレクトリ独自のメモリファイルを読み込めない場合、同じ行がそのターン中に会話に表示されます。行に示されているよりも多くのファイルが保留された場合は、最後の行に `and 3 more instruction files not loaded` のように残りの件数が示されます。

**対処方法:**

* 制限が意図したものであれば、何もする必要はありません。セッションはそのファイルの指示なしで実行されます。
* `a Read deny rule covers it` のために保留されたファイルを読み込むには、[そのルールを削除するか範囲を狭めます](https://code.claude.com/docs/ja/permissions.md#manage-permissions)。その後、新しいセッションを開始します。
* `it's read from outside your working directories, where reads are blocked` のために保留されたファイルを読み込むには、そのファイルまたはリンク先を作業ディレクトリ内に移動します。その後、新しいセッションを開始します。
* `where it leads couldn't be worked out` のために保留されたファイルを読み込むには、そのファイルが自分自身に戻るリンクになっていないか確認します。そうなっている場合は、リンクを存在するファイルに向けるか、その場所に通常のファイルを置きます。その後、新しいセッションを開始します。

v2.1.292 より前では、通知は同じ行の理由の後の末尾にファイル名を示していました。

### 名前が予約されているため、スキル、コマンド、またはワークフローが読み込まれなかった

スキルフォルダ、フロントマターの `name`、`.claude/commands/` 内のファイルやサブフォルダ、または[保存されたワークフロー](https://code.claude.com/docs/ja/workflows.md#save-the-workflow-for-reuse)が、`anthropic-skills` という名前、または `anthropic-skills:` で始まる名前を使用しています。Claude Code は[この名前を claude.ai から同期されたスキル用に予約](https://code.claude.com/docs/ja/skills.md#names-reserved-for-synced-skills)しているため、その項目を読み込みません。

Claude Code はこの警告を stderr ではなく、会話ビューの起動時通知として表示します。

```text theme={null}
Not loaded: rename .claude/skills/anthropic-skills, then restart — its name uses "anthropic-skills", a name reserved for the skills synced from your claude.ai account
```

通知には、拒否された最初の項目について変更すべき対象が示されます。名前を変更するフォルダやファイル、編集する `name:` 行、または名前を変更するワークフローです。複数の項目が拒否された場合、通知の末尾に `· 2 more` のような件数が付き、[デバッグログ](https://code.claude.com/docs/ja/debug-your-config.md)にそれぞれの項目が記録されます。

**対処方法:**

* 通知に示された項目の名前を変更するか、通知が指す `name:` 行を編集してから、セッションを再起動します。

v2.1.282 より前では、Claude Code はこれらの名前のスキルやコマンドを読み込んでいました。

### Skill or command name refused

この起動時通知は、Claude Code が少なくとも 1 つの[スキルまたはカスタムコマンド](https://code.claude.com/docs/ja/skills.md)の名前を拒否したため、そのスキルやコマンドが読み込まれなかったか、`name` フィールドなしで読み込まれたことを意味します。

```text theme={null}
1 skill or command name refused: run with --debug to see which ([names]), rename, then restart — a name may not hold hidden, direction-changing or blank-like characters, < or >, or be over 256 characters
```

* **読み込まれなかった場合**: Claude Code が、ディレクトリ名、コマンドファイルの名前やサブフォルダなど、スキルやコマンドの呼び名となる名前を拒否しました。そのスキルやコマンドは `/` メニューに表示されず、Claude も呼び出せません。デバッグログ内の該当行は `<name> is not offered` となります。
* **`name` フィールドが無視された場合**: Claude Code がスキルのフロントマターの `name` を拒否しました。スキル自体は読み込まれますが、`/` メニューには `name` の値が表示されず、その値を入力してもスキルは呼び出されません。デバッグログ内の該当行は `<name value> is not shown for <skill>` となります。

**対処方法:**

* シェルから `claude --debug` で Claude Code を起動し、[デバッグログ](https://code.claude.com/docs/ja/debug-your-config.md)で `[names]` を検索します。通知でカウントされた名前ごとに 1 行ずつ記録されています。行内では、ゼロ幅スペースを `\u{200B}` と表すなど一部の不可視文字がコードで表記されるため、それらの位置を確認できます。
* フォルダやファイルの名前を変更するか `name:` 行を編集して、[スキル名に含められない文字](https://code.claude.com/docs/ja/skills.md#characters-a-skill-name-cant-hold)を取り除くか、256 文字を超える名前を短くします。その後、ファイルが Claude Code が[変更を監視](https://code.claude.com/docs/ja/skills.md#live-change-detection)しているディレクトリにある場合を除き、セッションを再起動します。自分が作成していないプラグインのスキルの場合は、プラグインの作成者に名前の変更を依頼してください。

### Workspace has not been trusted

Claude Code はプロジェクトの `.claude/settings.json` または `.claude/settings.local.json` に `permissions.allow` ルールまたは `permissions.additionalDirectories` エントリを見つけましたが、[プロジェクト設定の許可ルールにはワークスペースの信頼が必要](https://code.claude.com/docs/ja/permissions.md#project-allow-rules-and-workspace-trust)であるため、それらを適用しませんでした。メッセージに示される件数、設定名、ファイルは設定内容によって異なります。`deny` ルールと `ask` ルールは影響を受けません。

```text theme={null}
Ignoring 2 permissions.allow entries from .claude/settings.local.json: this workspace has not been trusted. Run Claude Code interactively here once and accept the trust dialog, or set projects["/Users/you/project"].hasTrustDialogAccepted: true in /Users/you/.claude.json.
```

**対処方法:**

* そのディレクトリで `claude` を実行し、信頼ダイアログを承認します。その承認がどのフォルダに適用されるかについては、[プロジェクトの許可ルールとワークスペースの信頼](https://code.claude.com/docs/ja/permissions.md#project-allow-rules-and-workspace-trust)を参照してください。
* `-p` を使用した[非対話モード](https://code.claude.com/docs/ja/headless.md)ではダイアログは表示されません。メッセージに表示された `projects` キーをそのまま使用して、`~/.claude.json` の `hasTrustDialogAccepted` エントリを設定します。
* メッセージに `.claude/settings.local.json` が示されていて、Git リポジトリの外またはホームディレクトリで Claude Code を起動した場合は、v2.1.200 以降に更新してください。バージョン 2.1.196 から 2.1.199 では、これらのワークスペースで自分の `.claude/settings.local.json` がリポジトリ由来のものとして扱われていました。v2.1.207 以降では、フォルダを信頼していない場合、Git リポジトリの外では更新だけでは不十分です。フォルダがリポジトリ内にないことを判定するには git を実行する必要があり、Claude Code はこのチェックを信頼ダイアログの承認後にのみ実行するため、最初の手順を使用してください。ホームディレクトリやその他の[設定ホーム](https://code.claude.com/docs/ja/permissions.md#project-allow-rules-and-workspace-trust)は対象外で、ダイアログを待ちません。[プロジェクトの許可ルールとワークスペースの信頼](https://code.claude.com/docs/ja/permissions.md#project-allow-rules-and-workspace-trust)を参照してください。

### Working directory is a network path

Claude Code はネットワークパスを作業ディレクトリとして追加しません。ネットワークパスを参照すると、そのパスが示すホストに接続する可能性があり、Windows ではその接続によってホストに認証情報が送信される場合があります。そのため、Claude Code はパスを参照せずに拒否します。

ネットワークパスを指定して `/add-dir` を実行すると、次のメッセージが表示されます。

```text theme={null}
\\server\share is a network path, which cannot be added as a working directory. On Windows, map the share to a drive letter and pass it at launch with --add-dir (a drive letter added mid-session does not yet carry remote-read trust).
```

代わりに `--add-dir` または `permissions.additionalDirectories` で起動時に渡した場合、Claude Code はそのディレクトリなしで起動します。対話セッションでは、このメッセージは他の[起動時の警告](#configuration-warnings)とともにデバッグログに書き込まれるため、起動時には表示されません。

Claude Code がこの方法で拒否するパスには次のものがあります。

* `\\server\share` などの UNC 共有
* `/net/<host>` などの自動マウントパス（そのホストの自動マウント配下のディレクトリから Claude Code を起動した場合を除く）。その自動マウント配下の読み取りは、引き続き[ネットワークパスのチェック](https://code.claude.com/docs/ja/permissions.md#network-paths)の対象になります。
* シンボリックリンクやジャンクションを介してネットワーク上の場所に到達するローカルパス

マップされたドライブ文字と `\\wsl$` パスはネットワークパスとして扱われません。

**対処方法:**

* Windows では、共有をドライブ文字にマップし、起動時にそのドライブを渡します。たとえば PowerShell では、`net use Z: \\server\share` を実行してから `claude --add-dir Z:\` を実行します。
* macOS または Linux では、共有をローカルパスにマウントし、代わりにそのパスを追加します。
* パスが `permissions.additionalDirectories` に含まれている場合は、そのパスを記載している設定ファイルから削除します。

v2.1.257 より前では、Claude Code は到達可能なネットワークパスを作業ディレクトリとして受け入れていました。

### Remote managed settings failed to load

セッションは[サーバー管理設定](https://code.claude.com/docs/ja/server-managed-settings.md)の対象ですが、Claude Code がそれらを取得できなかったか、サーバーから返された内容を適用できなかったため、対話セッションと Claude Desktop の Code タブでこの警告が表示されます。

括弧内の原因には、`network error`、`request timed out`、`authentication rejected (401)` など、失敗した内容が示されます。原因が `no setting in the server response could be applied as written` の場合は、サーバーは応答したものの、返された設定のいずれも[検証](https://code.claude.com/docs/ja/server-managed-settings.md#invalid-entries-in-delivered-settings)に合格しなかったことを意味します。v2.1.282 より前では、この原因は `server returned invalid settings` と表示されていました。

行の残りの部分には、セッションがどのポリシーで実行されるかが示されます。

* **以前の取得成功時にキャッシュされた設定がある場合**: Claude Code は、[保留される環境変数](https://code.claude.com/docs/ja/server-managed-settings.md#fetch-and-caching-behavior)を除き、そのキャッシュされたポリシーでセッションを実行し、行には `using cached policy` と表示されます。
* **適用できるキャッシュ済みの設定がない場合**: Claude Code はサーバー管理設定なしでセッションを実行し、行には `no remote policy applied` と表示されます。たとえば、そのマシンがまだ設定を取得していない場合や、最後に取得してから [24 時間](https://code.claude.com/docs/ja/server-managed-settings.md#fetch-and-caching-behavior)以上経過している場合です。

Code タブでは、メッセージを送信すると警告が会話内の行として表示され、取得の状態が変わると新しい行が表示されます。関連する 3 つのメッセージも同じように表示されます。

* `Remote managed settings are still loading`: セッションが先に進んだ時点で、取得がまだ実行中だった
* `Remote managed settings did not load`: 応答がないまま取得が終了した
* `Remote managed settings have now loaded`: これらの警告のいずれかの後に設定が読み込まれた。行の残りの部分には、リモートポリシーが適用されるかどうかが示されます

**対処方法:**

* メッセージに示された原因に対処します。ネットワークが原因の場合は、このマシンが `api.anthropic.com` に到達できるか確認します。認証が原因の場合は、`/status` でサインイン状態を確認します
* `no setting in the server response could be applied as written` の場合は、管理者にサーバー上の設定の修正を依頼します
* 完全な診断を確認するには、`/status` または `claude doctor` を実行します

v2.1.248 より前では、Claude Code は設定の取得失敗をデバッグログにのみ報告していました。

### Claude Code が組織の設定を読み込めなかった

組織の設定（[サーバー管理設定](https://code.claude.com/docs/ja/server-managed-settings.md)を含む）は最初に読み込まれる必要がありますが、Claude Code がそれらを読み込めなかったため、セッションは開始されていません。例:

```text theme={null}
Claude Code couldn't reach Anthropic to load your organization's settings (could not connect). <Organization name> requires them before a session can start.
```

メッセージが `Claude Code can't start this session yet` というタイトルのダイアログに表示されている場合、設定が読み込まれるとすぐにダイアログが閉じてセッションが開始されます。

[非対話モード](https://code.claude.com/docs/ja/headless.md)と[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)では、Claude Code は代わりにメッセージを出力し、ステータス 1 で終了します。

**対処方法:**

* **`could not connect`、または `the reply came from a network proxy, not Anthropic`**: ネットワーク接続を確認し、企業ネットワークの場合は `api.anthropic.com/api/claude_code/policy_limits` と `api.anthropic.com/api/claude_code/settings` への HTTPS を許可するよう IT 部門に依頼します。その後、**Retry now** を選択するか、コマンドを再度実行します。
* **`timed out`、`Anthropic returned an error`、または `Anthropic asked it to retry shortly`**: ダイアログに再試行させるか、後でコマンドを再度実行します。繰り返し発生する場合は [status.anthropic.com](https://status.anthropic.com) を確認してください。
* **`still loading`、または `couldn't verify your sign-in with Anthropic yet`**: ダイアログに再試行させるか、コマンドを再度実行します。サインインに関するメッセージが繰り返し表示される場合は、シェルで `claude auth login` を実行して再度サインインします。
* **`Your Claude session has expired`**: このマシンに保存されているサインインは有効ではなくなったため、再試行しても解決しません。ダイアログで **Sign in again** を選択して Claude Code を閉じてから、シェルで `claude auth login` を実行します。このコマンドはセッションを開始できない間も動作します。
* **`none of the settings the server returned could be applied as written`**: 組織の[サーバー管理設定](https://code.claude.com/docs/ja/server-managed-settings.md#invalid-entries-in-delivered-settings)の修正を管理者に依頼してから、再試行します。

### Managed settings were not approved

組織の[サーバー管理設定](https://code.claude.com/docs/ja/server-managed-settings.md)に承認が必要な設定が含まれており、[セキュリティ承認ダイアログ](https://code.claude.com/docs/ja/server-managed-settings.md#security-approval-dialogs)を拒否したため、Claude Code はそれらを適用せずに終了します。

```text theme={null}
Managed settings were not approved; exiting without applying them.
```

**対処方法:**

* Claude Code を再度起動し、ダイアログを承認して組織の設定のもとで続行します。拒否したダイアログは記憶されないため、次回の起動時にも再び表示されます。
* ダイアログに表示された設定について不明な点がある場合は、承認する前に組織の管理設定を管理している担当者に確認してください

### Managed settings need your approval

組織の[サーバー管理設定](https://code.claude.com/docs/ja/server-managed-settings.md)に、[セキュリティ承認ダイアログ](https://code.claude.com/docs/ja/server-managed-settings.md#security-approval-dialogs)での承認が必要な設定が含まれています。実行した `claude plugin` コマンドはキーボードから入力を読み取れなかったため、そのダイアログを表示できませんでした。これは、コマンドの入力をパイプまたはリダイレクトしていて、かつ macOS と Linux では `/dev/tty` も開けない場合に発生します。コマンドは変更を加える前に停止しました。

```text theme={null}
Your organization's managed settings need your approval, which couldn't be asked for here. Run `claude` in a terminal and approve them, then run this command again.
```

**対処方法:**

* ターミナルで `claude` を実行し、ダイアログが表示されたら設定を承認してから、同じ `claude plugin` コマンドを再度実行します。Claude Code は承認と承認済みの設定を[設定ディレクトリ](https://code.claude.com/docs/ja/server-managed-settings.md#approval-memory)に保持します。停止したコマンドが別のユーザーとして実行された場合や `CLAUDE_CONFIG_DIR` が設定された状態で実行された場合は、両方が同じディレクトリを使用するように、`claude` も同じ方法で実行してください。

### Managed settings block the default model

組織の[管理設定](https://code.claude.com/docs/ja/managed-settings.md)が、Default オプションが解決されるモデルと、その段階的フォールバック先となり得るすべてのモデルをブロックしています。Default オプションで開始されるはずのセッションは、ブロックされたモデルを実行する代わりに起動時に終了します。表示されるメッセージは、ブロックしている設定によって異なります。[`deniedModels`](https://code.claude.com/docs/ja/model-config#block-specific-models-or-versions) リストによってブロックされている場合、メッセージは次のようになります。

```text theme={null}
Claude Code can't start: your organization's managed settings block the default model (claude-opus-5-5) in "deniedModels", and none of the models they allow can be used as the default instead. Ask your administrator to update "deniedModels" or "availableModels".
```

[`availableModelsMatch`](https://code.claude.com/docs/ja/settings-reference#availablemodelsmatch) が `"exact"` に設定された `availableModels` リストにそのモデルが含まれていない場合、メッセージは次のようになります。

```text theme={null}
Claude Code can't start: your organization allows only the models listed in "availableModels", and none of them can be used as the default model (claude-opus-5-5 isn't listed). Ask your administrator to update "availableModels".
```

**対処方法:**

* 設定を管理している場合は、ユーザーが実行できるモデルを `availableModels` に追加するか、すべてのフォールバックをブロックしている `deniedModels` エントリの範囲を狭めます。Default オプションが段階的にフォールバックする仕組みについては、[特定のモデルまたはバージョンをブロックする](https://code.claude.com/docs/ja/model-config.md#block-specific-models-or-versions)を参照してください
* 設定を管理していない場合は、メッセージを管理者に送ってください。自分の設定ファイルでは、管理された `availableModels` リストや `deniedModels` リストを拡張できません

### 管理設定がこの API プロバイダーを許可していない

組織の[管理設定](https://code.claude.com/docs/ja/managed-settings.md)が [`allowedProviders`](https://code.claude.com/docs/ja/settings-reference#allowedproviders) リストを設定しており、セッションの API プロバイダーがそのリストに含まれていないか、セッションがそのエントリで必要とされる方法で固定されていないエンドポイントを使用しています。Claude Code は、起動時、ログイン前、またはセッションが次に API に接続するときに拒否します。メッセージは許可されたプロバイダーの一覧から始まります。

```text theme={null}
Your organization's managed settings allow Claude Code to use: Anthropic API, Amazon Bedrock.
```

リストが空の場合、メッセージは次のようになります。

```text theme={null}
Your organization's managed settings allow Claude Code to use no API provider at all (allowedProviders is an empty list), so it cannot start on this machine.
```

すべてのエントリが認識されない場合、括弧内は代わりに `(allowedProviders lists only unrecognized entries)` となります。

**対処方法:**

* メッセージの `To continue:` の手順に従います
* 設定を管理している場合は、メッセージの `Admins:` で始まる行に、追加すべきエントリまたは固定すべき値が示されています。どのソースの `env` ブロックで固定できるかについては、[`allowedProviders`](https://code.claude.com/docs/ja/settings-reference#allowedproviders) の項目を参照してください

### MCP server is blocked by enterprise managed policy

`/mcp` でサーバーの **Reconnect** を選択したか、無効化されたサーバーをそこで再度オンにしたものの、[MCP サーバーを制限する](https://code.claude.com/docs/ja/managed-mcp.md)設定がそのサーバーをブロックしています。Claude Code は接続を拒否し、次のメッセージを表示します。

```text theme={null}
MCP server <name> is blocked by enterprise managed policy
```

次のいずれの設定でもこのメッセージが表示される可能性があります。

* サーバーに一致する [`deniedMcpServers`](https://code.claude.com/docs/ja/managed-mcp#policy-based-control-with-allowlists-and-denylists) エントリ（自分の `~/.claude/settings.json` やプロジェクトの `.claude/settings.json` にあるものを含む）
* サーバーが一致しない [`allowedMcpServers`](https://code.claude.com/docs/ja/managed-mcp#policy-based-control-with-allowlists-and-denylists) リスト
* `mcp` がロックされた [`strictPluginOnlyCustomization`](https://code.claude.com/docs/ja/settings-reference#strictpluginonlycustomization)（`~/.claude.json` と `.mcp.json` で設定されたサーバーをブロックします）
* サーバーが claude.ai コネクタである場合の [`disableClaudeAiConnectors`](https://code.claude.com/docs/ja/mcp#disable-claude-ai-connectors)

**対処方法:**

* 自分のユーザー設定ファイルとプロジェクト設定ファイルにこれらの設定がないか確認し、変更または削除します
* 自分の設定でブロックの理由が説明できない場合は、どの管理設定がサーバーをブロックしているかを管理者に確認してください

v2.1.257 より前では、`/mcp` の **Reconnect** や再有効化によって、セッション中のポリシー更新でブロックされたサーバーに接続できてしまう場合がありました。

### MCP サーバー名が予約されている

このメッセージは、組み込みサーバーの名前など、Claude Code が予約している名前を持つ MCP サーバーの 1 つを示しています。

```text theme={null}
"workspace" is a reserved MCP server name and was not loaded
```

**対処方法:**

* サーバーを定義している場所でサーバーの名前を変更します。たとえば、`workspace` を `my-workspace` に変更します
* 避けるべき他の予約名については、[MCP の設定の警告](https://code.claude.com/docs/ja/mcp.md#configuration-warnings)を参照してください

### Managed settings document could not be parsed

組織が[管理設定](https://code.claude.com/docs/ja/managed-settings.md)をデプロイしており、デプロイされたドキュメントの 1 つが存在するものの JSON オブジェクトとして解析できないため、Claude Code は、そのドキュメントに含まれるポリシーなしで実行する代わりに、起動時に終了コード 1 で終了します。行のメッセージの前に、失敗したソースが示されます。

```text theme={null}
/Library/Application Support/ClaudeCode/managed-settings.json: Managed settings document could not be parsed as a JSON object; none of its settings are in effect. Fix or remove it.
```

ソースは次のいずれかです。

* `managed-settings.json` ファイルのパス、または `managed-settings.d` 配下のドロップインファイルのパス
* macOS の管理対象環境設定プロファイル（`per-user managed preferences` または `device-level managed preferences`）
* Windows レジストリの値（`Registry: HKLM\SOFTWARE\Policies\ClaudeCode\Settings`）

各ソースが解析できなくなる原因については、[Claude Code が破棄したエントリを見つける](https://code.claude.com/docs/ja/managed-settings.md#find-entries-claude-code-dropped)を参照してください。

Claude Code は、別の管理ソースが有効なポリシーを提供している場合でも起動を拒否します。このエラーは、対話セッション、`claude -p`、Agent SDK セッション、[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)、および `claude doctor` を含むほとんどのサブコマンドで表示されます。この拒否は意図的なフェイルクローズです。Claude Code が解析できないドキュメント内の設定は強制できず、それでも起動すると組織の制御なしでセッションが実行されることになります。

解析可能なドキュメント内のスキーマの問題では、このエラーは発生しません。その場合の Claude Code の動作については、[Claude Code が破棄したエントリを見つける](https://code.claude.com/docs/ja/managed-settings.md#find-entries-claude-code-dropped)を参照してください。

`managed-settings.d/` ディレクトリが存在するものの一覧を取得できない場合、Claude Code は代わりに `Managed settings drop-in directory could not be read:` に続けて根本的なエラーを報告します。読み取りの失敗によって起動時に終了する場合については、[Claude Code が破棄したエントリを見つける](https://code.claude.com/docs/ja/managed-settings.md#find-entries-claude-code-dropped)を参照してください。

**対処方法:**

* マシンを管理している場合は、示されたドキュメントを JSON オブジェクトとして解析できるように修正するか、ファイル、プロファイル、またはレジストリの値を削除します。空の `managed-settings.json` は `{}` として扱われ、起動を妨げません。
* マシンを管理していない場合は、デプロイされたドキュメントの修正を管理者に依頼してください。自分の設定ファイルの内容がこのエラーの原因になることはなく、それによってエラーを解消することもできません。

### Unable to read managed policy settings

組織が[管理設定](https://code.claude.com/docs/ja/managed-settings.md)をデプロイしており、デプロイされたソースの 1 つが存在するものの、オペレーティングシステムによる読み取り拒否ではなく I/O エラーなどの理由で読み取れませんでした。ポリシーを提供する他の管理ソースがない場合、Claude Code は、そのソースに含まれている可能性のあるポリシーなしで実行する代わりに、起動時に終了します。

```text theme={null}
Unable to read managed policy settings.
This machine may require organization login enforcement, but the policy file failed to load.
Contact your administrator.

Detail: <source>: <reason>
```

同じ状態では、サインインフロー、すでに実行中のセッションからの API リクエスト、および [`claude gateway`](https://code.claude.com/docs/ja/claude-apps-gateway) サーバーが、[`allowedProviders`](https://code.claude.com/docs/ja/settings-reference#allowedproviders) を示す 1 行目の変形版のメッセージとともに拒否されます。

root 専用ファイルなど、オペレーティングシステムによって読み取りが拒否された場合は、この終了は発生しません。[セッションはそのソースのポリシーなしで開始されます](https://code.claude.com/docs/ja/managed-settings.md#find-entries-claude-code-dropped)。解析できないソースの場合、Claude Code は[ソースを示す別のメッセージ](#managed-settings-document-could-not-be-parsed)で終了します。

**対処方法:**

* マシンを管理している場合は、`Detail:` 行に示された問題を修正してデプロイされたソースを読み取れるようにするか、ソースを削除します
* マシンを管理していない場合は、メッセージを管理者に送ってください。自分の設定ファイルの内容がこのエラーの原因になることはなく、それによってエラーを解消することもできません

v2.1.285 より前では、claude.ai または Claude Console の認証情報でサインインしたセッションのみがこのメッセージで終了し、オペレーティングシステムによって読み取りが拒否された場合にもこのメッセージが表示されていました。

### Managed settings contain invalid entries, including PreToolUse/PermissionRequest hooks that are NOT loaded

`-p` の実行で表示されるこの stderr のブロックは、[管理設定](https://code.claude.com/docs/ja/managed-settings.md)のソースに Claude Code が読み込めないフックエントリが含まれていることを意味します。そのフックは実行されず、ある行でソースの `hooks` フィールドが無視されたと示されている場合は、そのソースのフックはいずれも実行されません。

各行には、ソース、該当する場合はフィールド、および問題（不明なフックの `type` や、`hooks` キーの外で宣言されたフックなど）が示されます。

```text theme={null}
Managed settings contain invalid entries, including PreToolUse/PermissionRequest hooks that are NOT loaded; fix or remove each entry:
  <source> (<field>): <message>
```

**対処方法:**

* ソースを管理している場合は、ブロックに一覧表示された各エントリを修正または削除します。`hooks` の下で Claude Code が想定する形式については、[フックの設定](https://code.claude.com/docs/ja/hooks.md#configuration)を参照してください。
* 行のソースが `parent managed settings` となっている場合は、Claude Code を起動したアプリケーションがそのエントリを[親設定](https://code.claude.com/docs/ja/managed-settings.md#parent-settings-from-embedding-hosts)として渡しているため、そのアプリケーションの開発者に報告してください
* それ以外の場合は、ブロックを管理者に送ってください

v2.1.300 より前では、`-p` の実行ではこのケースが `Managed settings failed to load; policies from the failed source are NOT in effect:` ヘッダーの下に一覧表示されていました。

### otelHeadersHelper failed

[`otelHeadersHelper`](https://code.claude.com/docs/ja/settings-reference#otelheadershelper) スクリプトが失敗した場合、または[スクリプトの要件](https://code.claude.com/docs/ja/monitoring-usage.md#script-requirements)を満たさない出力を返した場合、Claude Code はこの警告をターミナルインターフェースの通知として、対話セッションごとに 1 回表示します。

スクリプトが失敗し続けている間はエクスポートが失敗し、テレメトリのバックエンドはそのセッションから何も受信しません。

`See /status:` の後のテキストには、スクリプトの終了コードとそれに続くエラー出力など、失敗した内容が示されます。

```text theme={null}
otelHeadersHelper failed; telemetry is not being exported. See /status: exited 1: token service unreachable
```

**対処方法:**

* `/status` を実行して失敗の詳細を確認します。
* スクリプトが 30 秒以内に終了コード 0 で終了し、文字列のヘッダー値を持つ JSON オブジェクトを stdout に出力するように修正します。[スクリプトの要件](https://code.claude.com/docs/ja/monitoring-usage.md#script-requirements)を参照してください。
* 組織が[管理設定](https://code.claude.com/docs/ja/managed-settings.md)を通じてスクリプトをデプロイしている場合は、管理設定を管理している担当者に修正を依頼してください。

`-p` を使用した[非対話モード](https://code.claude.com/docs/ja/headless.md)では、同じ失敗が代わりに stderr に `otelHeadersHelper failed (OpenTelemetry export headers unavailable): <error>` として表示されます。

### headersHelper not run

Claude Code は MCP サーバーを静的な `headers` のみで接続し、サーバーの [`headersHelper`](https://code.claude.com/docs/ja/mcp#use-dynamic-headers-for-custom-authentication) をスキップしました。ヘルパーはシェルコマンドであり、フォルダに保存された信頼がないためです。フォルダに信頼が保存されるのは、`~/.claude.json` でそのエントリを手動で設定した場合、またはホームディレクトリ以外で、対話セッションでそのフォルダの信頼ダイアログを承認した場合です。このチェックがどのサーバーに適用されるかについては、[headersHelper を実行する前にフォルダを信頼する](https://code.claude.com/docs/ja/mcp.md#trust-a-folder-before-its-headershelper-runs)を参照してください。

Claude Code はこの行を[非対話モード](https://code.claude.com/docs/ja/headless.md)でのみ、サーバーごとに 1 回書き込みます。対話セッションでは、同じ拒否を代わりにデバッグログに書き込みます。

```text theme={null}
MCP server 'internal-api': headersHelper not run — this workspace has no persisted trust; accept the trust dialog here once interactively, or set projects["/Users/you/project"].hasTrustDialogAccepted in /Users/you/.claude.json.
```

メッセージに表示される `projects` キーは、[プロジェクトの許可ルールとワークスペースの信頼](https://code.claude.com/docs/ja/permissions.md#project-allow-rules-and-workspace-trust)で説明されている、Claude Code が信頼のキーとして使用するフォルダです。親フォルダの信頼ダイアログを承認してもこのチェックは満たされず、`-p` セッションや SDK セッションでも満たされません。

**対処方法:**

* メッセージに示されたフォルダで `claude` を実行して信頼ダイアログを承認し、その後 `-p` または SDK のコマンドを再度実行します
* メッセージに表示された `projects` キーをそのまま使用して、`~/.claude.json` の `hasTrustDialogAccepted` エントリを自分で設定します
* ホームディレクトリでセッションを開始した場合は、信頼済みのプロジェクトディレクトリから作業してください。ホームディレクトリで信頼ダイアログを承認した場合、Claude Code はその信頼を現在のセッションの間のみ保持します。

### Malformed Tool(content) rule

設定ファイルのいずれかにある[権限ルール](https://code.claude.com/docs/ja/permissions.md#permission-rule-syntax)が、閉じ括弧の後にテキストが続いている、または括弧の一方が欠けているなどの理由で、`Tool` または `Tool(content)` の形式になっていません。Claude Code はそのルールをスキップし、対話セッションの開始時に表示される無効な設定のダイアログと、[`claude doctor`](https://code.claude.com/docs/ja/debug-your-config#check-resolved-settings) の出力に一覧表示します。

```text theme={null}
Invalid permission rule "Bash(ls) x" was skipped: Malformed Tool(content) rule. Rules take the form Tool or Tool(content) and must end at the closing ")"; parentheses inside the content are literal
```

**対処方法:**

* メッセージとともに示された設定ファイルで、ルールが閉じ括弧で終わるように書き直します。たとえば、`Bash(ls) x` の代わりに `Bash(ls *)` とします
* content 内の括弧はそのままにしておきます。括弧はリテラルとして扱われるため、`Edit(./Finance (2024)/**)` のようなルールはエスケープなしで有効です

v2.1.260 より前では、Claude Code は括弧が対応していないルールを `Mismatched parentheses` として報告していました。

### Matches no tool · check for typos

起動バナーの下に表示されるこの行は、Claude Code がツール名を認識できない拒否ルールまたは確認ルールの[権限ルール](https://code.claude.com/docs/ja/permissions.md)を示しており、そのルールは意図したツールに適用されません。`Bsh` と記述された拒否ルールは Bash には適用されず、正規名ではなくトランスクリプトに表示されるツールのラベルを使用したルールも同様です。行には、記述したとおりのルールが繰り返し表示されます。

```text theme={null}
⚠ Deny rule Bsh matches no tool · check for typos
```

テキスト出力の[非対話モード](https://code.claude.com/docs/ja/headless.md)では、Claude Code は代わりに長い形式の警告を stderr に出力します。

```text theme={null}
Permission deny rule "Bsh" matches no known tool — check for typos.
```

**対処方法:**

* ルール内のツール名を修正します。たとえば、`Bsh` の代わりに `Bash` とします。正規名は[ツールリファレンス](https://code.claude.com/docs/ja/tools-reference.md)で確認できます。
* ルールが定義されている場所を確認するには、セッションで `/permissions` を実行してルールを選択します。詳細には、`From project local settings` や、`--disallowedTools` の値の場合は `From CLI argument` など、ルールの出所が示されます。
* 詳細に `From enterprise managed settings` と表示されている場合は、自分ではそのルールを変更できないため、[管理設定](https://code.claude.com/docs/ja/managed-settings.md)を管理している担当者にこの行を転送してください。

[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)、または `--output-format json` や `stream-json` を使用している場合、Claude Code は警告を stderr ではなくデバッグログに書き込みます。`--debug` を付けて実行すると、`~/.claude/debug/<session-id>.txt` に記録されます。

v2.1.305 より前では、対話セッションは行を表示する代わりに、起動時に長い形式を stderr に出力していました。

### Is not matched by file permission checks

Claude Code は、[設定ファイル](https://code.claude.com/docs/ja/settings.md#where-settings-live)のいずれか、[管理設定](https://code.claude.com/docs/ja/managed-settings.md)、または `--allowedTools`、`--disallowedTools`、`--settings` フラグの値の中に、パスを指定した `Write`、`NotebookEdit`、`MultiEdit`、または `Glob` の[権限ルール](https://code.claude.com/docs/ja/permissions.md#read-and-edit)を見つけました。Claude Code はファイルの権限を `Edit` ルールと `Read` ルールに対してのみチェックするため、それ以外のファイルツールを指定したパスルールは参照されません。Claude Code はそのルールを保持し、それ以外は何も変更しません。

* **対話セッション**: 完全な警告は[デバッグログ](#configuration-warnings)に書き込まれ、この形式の拒否ルールまたは確認ルールは、起動バナーの下に次の行としても表示されます。

  ```text theme={null}
  ⚠ Deny rule Write(docs/**) never matches · use Edit(docs/**)
  ```

  この形式の許可ルールには行は表示されません。ルールが定義されている場所を確認するには、セッションで `/permissions` を実行してルールを選択します。
* **テキスト出力の[非対話モード](https://code.claude.com/docs/ja/headless.md)**: stderr の完全な警告には、ルール、括弧内のソース、および記述すべき置き換え後のルールが示されます。

  ```text theme={null}
  Permission deny rule (.claude/settings.json): Write(docs/**) is not matched by file permission checks — only Edit(path) rules are. Use Edit(docs/**) instead (Edit rules cover all file-editing tools).
  ```
* **[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)、または `--output-format json` や `stream-json`**: 機械可読な出力をクリーンに保つため、完全な警告は stderr ではなくデバッグログに書き込まれます。`--debug` を付けて実行すると、`~/.claude/debug/<session-id>.txt` に記録されます。

**対処方法:**

* `Write(path)`、`NotebookEdit(path)`、およびレガシーの `MultiEdit(path)` ルールを `Edit(path)` に置き換えます。`Edit` ルールはすべてのファイル編集ツールに適用されます。
* Claude Code が `Glob` ルールを警告なしで受け入れる `--allowedTools` を除き、`Glob(path)` ルールを `Read(path)` に置き換えます。
* 完全な警告の括弧内に示されたソースでルールを修正します。ソースは設定ファイルのパスか、`--allowed-tools` と `--disallowed-tools` の場合はフラグそのものです。ディスク上に存在しない `claude-settings-<hash>.json` パスは、インラインの `--settings` 値を表します。そのフラグに渡す JSON を修正してください。
* `Write` や `Glob` などのツール名のみのルールはそのままにします。Claude Code はこれらを[ツールレベル](https://code.claude.com/docs/ja/permissions.md#match-all-uses-of-a-tool)で照合し、警告を出しません。
* 管理設定由来のルールの場合、完全な警告の括弧内は `managed policy settings` となり、`/permissions` のルールの詳細には `From enterprise managed settings` と表示されます。自分では解消できないため、管理設定を管理している担当者にその警告を転送してください。

v2.1.210 より前では、Claude Code はこれらのルールを警告なしで受け入れていました。v2.1.305 より前では、対話セッションは完全な警告を stderr に出力していました。

### Has a wildcard before the rest of the command

Claude Code は、[設定ファイル](https://code.claude.com/docs/ja/settings.md#where-settings-live)のいずれか、[管理設定](https://code.claude.com/docs/ja/managed-settings.md)、または `--allowedTools` や `--settings` フラグの値の中に、`Bash(git * main)` や `Bash(git -C * status *)` のように、どのコマンドであるかを決定する後続の単語よりも前に `*` がある `Bash` 許可ルールを見つけました。`*` はその位置に挿入されたオプションを含む任意のテキストに一致します。`Bash(git * main)` は `git -c core.fsmonitor=<script> diff main` も承認してしまい、この場合 `-c` によって git はコマンドで指定されたプログラムを実行します。照合のルールについては、[ワイルドカードパターン](https://code.claude.com/docs/ja/permissions.md#wildcard-patterns)を参照してください。

この警告は、ワイルドカードが意図よりも広い範囲に一致するルールを絞り込めるようにするためのものです。Claude Code はルールを保持し、照合の方法も一切変更しません。テキスト出力の[非対話モード](https://code.claude.com/docs/ja/headless.md)では、stderr の警告にルールと括弧内のソースが示されます。

```text theme={null}
Permission allow rule (.claude/settings.json): Bash(git -C * status *) has a wildcard before the rest of the command, so it also matches any options inserted at that position and approves them without a prompt. For git, options such as -c and --exec-path can run arbitrary commands. Replace that * with the exact value you mean, or only use * after the subcommand (for example Bash(git status *)).
```

対話セッションでは、完全な警告は[デバッグログ](#configuration-warnings)に書き込まれ、ルールは起動バナーの下に次の行として表示されます。

```text theme={null}
⚠ Allow rule Bash(git -C * status *) allows any option at its * · use an exact value
```

ルールが定義されている場所を確認するには、セッションで `/permissions` を実行してルールを選択します。

**対処方法:**

* サブコマンドの前にある `*` を、意図する正確な値に置き換えます。`Bash(git * main)` の代わりに `Bash(git checkout main)` とします。
* すべての `*` をサブコマンドの後に移動します。`Bash(git -C * status *)` の代わりに `Bash(git status *)` とします。許可したいサブコマンドごとに 1 つのルールを記述してください。
* 完全な警告の括弧内に示されたソースでルールを修正します。ソースは設定ファイルのパスか、`--allowed-tools` フラグそのものです。ディスク上に存在しない `claude-settings-<hash>.json` パスは、インラインの `--settings` 値を表します。そのフラグに渡す JSON を修正してください。
* 管理設定由来のルールの場合、完全な警告の括弧内は `managed policy settings` となり、`/permissions` のルールの詳細には `From enterprise managed settings` と表示されます。自分では解消できないため、管理設定を管理している担当者にその警告を転送してください。

[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)、または `--output-format json` や `stream-json` を使用している場合、機械可読な出力をクリーンに保つため、Claude Code は警告を stderr ではなくデバッグログに書き込みます。`--debug` を付けて実行すると、`~/.claude/debug/<session-id>.txt` に記録されます。v2.1.246 より前では、Claude Code はこれらのルールを警告なしで受け入れていました。

v2.1.305 より前では、対話セッションは行を表示する代わりに、完全な警告を stderr に出力していました。

### Denying Bash also turns off the PowerShell tool

`--disallowedTools Bash` を使用した場合や、設定ファイルのいずれかでツール名のみの `Bash` または `Bash(*)` の[拒否ルール](https://code.claude.com/docs/ja/permissions.md#match-all-uses-of-a-tool)を使用した場合など、Bash ツール全体を削除しました。Git Bash がインストールされた Windows では、[Bash を拒否すると PowerShell ツールもオフになる](https://code.claude.com/docs/ja/tools-reference.md#bash-deny-rules-also-turn-off-the-powershell-tool)ため、セッションはシェルツールなしで開始されます。

テキスト出力の[非対話モード](https://code.claude.com/docs/ja/headless.md)では、Claude Code は起動時にこの警告を stderr に出力し、対話セッションでは[デバッグログ](#configuration-warnings)にのみ書き込みます。

```text theme={null}
Denying Bash also turns off the PowerShell tool, so Claude has neither. To use PowerShell, set CLAUDE_CODE_USE_POWERSHELL_TOOL=1.
```

**対処方法:**

* Claude に PowerShell を使用させるには、[PowerShell ツールを有効にする](https://code.claude.com/docs/ja/tools-reference.md#enable-the-powershell-tool)で示されているように、環境または設定ファイルの `env` ブロックで [`CLAUDE_CODE_USE_POWERSHELL_TOOL`](https://code.claude.com/docs/ja/env-vars) を `1` に設定します。これにより、Bash の拒否ルールと併用しても PowerShell ツールはオンのままになります。
* ツール全体ではなく特定のコマンドをブロックするには、同じ設定ファイルまたはフラグで、ツール名のみの `Bash` エントリを `Bash(git push *)` のような範囲を限定したルールに置き換えます。Claude は Bash ツールを維持し、PowerShell ツールは、この変数も設定するか、範囲を限定した [`PowerShell` 権限ルール](https://code.claude.com/docs/ja/permissions#powershell)を追加するまでオフのままです。

[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)、または `--output-format json` や `stream-json` を使用している場合、Claude Code は警告を stderr ではなくデバッグログに書き込みます。`--debug` を付けて実行すると、`~/.claude/debug/<session-id>.txt` に記録されます。v2.1.287 より前では、Claude Code は同じように PowerShell ツールをオフにしていましたが、警告は表示していませんでした。

v2.1.305 より前では、対話セッションでも起動時に警告を stderr に出力していました。

### crossSessionInbound must be one of accept, hold, refuse

設定ファイルで [`crossSessionInbound`](https://code.claude.com/docs/ja/settings-reference#crosssessioninbound) が、タイプミスの `"reject"` など、Claude Code が認識しない値に設定されています。警告の 2 文目は、値がどのファイルにあるかによって異なります。ユーザー、プロジェクト、ローカル、または `--settings` のファイルの場合は次のようになります。

```text theme={null}
"crossSessionInbound" must be one of "accept", "hold", "refuse"; received "reject". This value was ignored; while it is present, cross-session messages are held for your approval instead of being delivered. Set it to one of the values above.
```

[管理設定](https://code.claude.com/docs/ja/managed-settings.md)では、Claude Code は認識されない値を最も制限の厳しい値である `refuse` として扱い、警告には、管理者が修正するまでセッション間メッセージが拒否されることが示されます。この保留が他の設定ファイルの値とどのように組み合わされるかについては、[`crossSessionInbound`](https://code.claude.com/docs/ja/settings-reference#crosssessioninbound) を参照してください。

**対処方法:**

* キーを `"accept"`、`"hold"`、または `"refuse"` に設定するか、削除します
* 警告に管理設定が示されている場合は、値の修正を管理者に依頼してください

v2.1.248 より前では、Claude Code は認識されない値を警告なしで無視していました。

### ANTHROPIC\_FOUNDRY\_RESOURCE must be a Foundry resource name

[`ANTHROPIC_FOUNDRY_RESOURCE`](https://code.claude.com/docs/ja/env-vars) を、エンドポイント URL やそのホスト名など、[Microsoft Foundry](https://code.claude.com/docs/ja/microsoft-foundry.md) のリソース名のみ以外の値に設定しました。Claude Code はリクエストを送信する前にその値を拒否しました。このメッセージは起動時の警告としてではなく、Claude の応答の代わりに表示されます。

```text theme={null}
API Error: ANTHROPIC_FOUNDRY_RESOURCE must be a Foundry resource name (2-64 letters, digits and hyphens, not starting or ending with a hyphen, such as my-resource), not a URL or host name. To use a full URL, set ANTHROPIC_FOUNDRY_BASE_URL instead.
```

**対処方法:**

* `ANTHROPIC_FOUNDRY_RESOURCE` にリソース名のみを設定し、Claude Code を再起動します。エンドポイントが `https://my-resource.services.ai.azure.com/anthropic` の場合、名前は `my-resource` です。
* 代わりに完全なエンドポイント URL を指定するには、[`ANTHROPIC_FOUNDRY_BASE_URL`](https://code.claude.com/docs/ja/env-vars) にその URL を設定して `ANTHROPIC_FOUNDRY_RESOURCE` を削除し、Claude Code を再起動します。Claude Code は 2 つの変数のうち一方のみを受け付けます。

### The 200K limit isn't enforced

[`CLAUDE_CODE_DISABLE_1M_CONTEXT=1`](https://code.claude.com/docs/ja/env-vars) を設定しました。この設定は通常、[自動圧縮](https://code.claude.com/docs/ja/model-config.md#default-auto-compact-thresholds)によって 1M コンテキストモデルのセッションを 200K のウィンドウに抑えますが、このセッションを 200K 以下に制限するコンテキスト圧縮のしきい値がないため、会話が 200K を超えて大きくなる可能性があります。

```text theme={null}
CLAUDE_CODE_DISABLE_1M_CONTEXT is set, but the 200K limit isn't enforced for <model>, so this session can grow past it. To enforce it, set CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000 (or the autoCompactWindow setting).
```

Claude Code は、ネイティブの 1M ウィンドウを持つと認識するすべてのモデルについて 200K の上限を自動的に強制し、認識しないモデル ID については想定するウィンドウで圧縮します。警告は、他の設定がこの強制を無効にしている場合に表示されます。

* モデル ID が、[LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)のエイリアスなど Claude Code が認識しないものであり、かつ [`CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1`](https://code.claude.com/docs/ja/env-vars) を設定したか、[`CLAUDE_CODE_MAX_CONTEXT_TOKENS`](https://code.claude.com/docs/ja/env-vars) で想定ウィンドウを 200K より大きくした場合。この場合、メッセージには対処方法として `or update to a Claude Code version that recognizes <model>` も示されます。
* [`ANTHROPIC_BETAS`](https://code.claude.com/docs/ja/env-vars) または [`--betas`](https://code.claude.com/docs/ja/cli-reference#cli-flags) フラグで要求した `context-1m` ベータが、そのベータを受け付けるモデルで引き続き API に 1M ウィンドウを要求しており、かつセッションを 200K で圧縮するものが何もない場合

**対処方法:**

* [`CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`](https://code.claude.com/docs/ja/env-vars) を設定するか、[`autoCompactWindow`](https://code.claude.com/docs/ja/settings-reference#autocompactwindow) 設定を `200000` にして、自動圧縮が 200K の境界で圧縮するようにします
* メッセージにこのバージョンが認識しないモデル ID が示されている場合は、`claude update` を実行します。その ID を 1M コンテキストモデルとして認識するバージョンでは、追加の設定なしで上限が強制されます。
* 代わりにセッションでモデルの完全なウィンドウを使用したい場合は、`CLAUDE_CODE_DISABLE_1M_CONTEXT` の設定を解除します。この警告は 200K の上限が強制されていないことを報告するだけです

テキスト出力の[非対話モード](https://code.claude.com/docs/ja/headless.md)では、この警告は stderr に表示されます。対話セッション、[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)、または `--output-format json` や `stream-json` を使用している場合は、代わりにデバッグログに書き込まれます。`--debug` を付けて実行すると、`~/.claude/debug/<session-id>.txt` に記録されます。

v2.1.305 より前では、対話セッションは起動時に警告を stderr に出力していました。

### リクエストでの認識されないモデル ID

Claude Code は、使用中の Claude Code のバージョンが認識しないモデル ID でリクエストを送信し、その ID を認識可能なモデルにマッピングする [`modelOverrides`](https://code.claude.com/docs/ja/model-config#override-model-ids-per-version) エントリも見つかりませんでした。Claude Code は設定されたとおりの ID でリクエストを送信し続け、終了したりモデルを切り替えたりはしません。

```text theme={null}
[claude-code:unrecognized_model] {"model":"my-proxy-model","query_source":"sdk"}
```

stderr を読み取るスクリプトやハーネスでは、`[claude-code:unrecognized_model]` プレフィックスで照合してください。プレフィックスと 1 つのスペースの後に、Claude Code は 1 行の JSON オブジェクトを書き込みます。Claude Code は今後のバージョンでフィールドを追加する可能性があるため、想定していないフィールドは無視してください。少なくとも次の 2 つのフィールドが書き込まれます。

* `model`: 設定されたとおりのモデル文字列
* `query_source`: そのモデルを使用したリクエストの経路。たとえば、`-p` の実行のメインの会話では値は `sdk` となり、サブエージェントでは `agent:` で始まります。

Claude Code は、実行方法に応じて次の 2 つの場所のいずれかにこの行を書き込みます。

* `-p` を使用した[非対話モード](https://code.claude.com/docs/ja/headless.md)では、すべての `--output-format` で stderr に書き込むため、この行を除外せずに stdout を解析できます
* 対話セッションまたは[バックグラウンドセッション](https://code.claude.com/docs/ja/agent-view.md)では、代わりにデバッグログに書き込みます。`--debug` を付けて実行すると、`~/.claude/debug/<session-id>.txt` に記録されます

Claude Code はこの行を、プロセスごとにモデル ID ごとに 1 回書き込みます。[サブエージェント](https://code.claude.com/docs/ja/sub-agents.md#choose-a-model)や[バックグラウンド機能](https://code.claude.com/docs/ja/model-config.md#environment-variables)が使用する ID など、さらに認識されない ID があれば、それぞれ別の行を書き込みます。

Amazon Bedrock の `us.anthropic.claude-...` ID、`@` バージョンサフィックス付きの Google Cloud の Agent Platform ID、Claude のモデル ID を含む Microsoft Foundry のデプロイ名など、Claude Code が認識可能なモデルに解決できるプロバイダー ID については、この行は書き込まれません。Amazon Bedrock の[アプリケーション推論プロファイル ARN](https://code.claude.com/docs/ja/amazon-bedrock.md#map-each-model-version-to-an-inference-profile) については、Claude Code は ARN そのものではなく、その背後にあるモデルをチェックします。入力ミスのある ARN など、解決できない ARN については行を書き込みません。

**対処方法:**

* [LLM ゲートウェイ](https://code.claude.com/docs/ja/llm-gateway)のエイリアスなど、意図的にその ID を設定している場合は、その ID を値とする [`modelOverrides`](https://code.claude.com/docs/ja/model-config#override-model-ids-per-version) エントリを[設定ファイル](https://code.claude.com/docs/ja/settings.md#where-settings-live)に追加します。キーには `opus` のようなファミリーエイリアスではなく、Anthropic のモデル ID を使用してください。例の行の `my-proxy-model` の場合は、次のエントリを追加します。

  ```json theme={null}
  {
    "modelOverrides": {
      "claude-opus-4-6": "my-proxy-model"
    }
  }
  ```

  これにより、Claude Code は `my-proxy-model` を `claude-opus-4-6` として扱い、この行の書き込みを停止します。

* ID が使用中の Claude Code のバージョンより新しいモデルを指している場合は、`claude update` を実行します

* ID がタイプミスの場合は、[モデルを設定できる場所](https://code.claude.com/docs/ja/model-config.md#setting-your-model)または[エイリアス変数](https://code.claude.com/docs/ja/model-config.md#environment-variables)のうち、その ID が設定されている箇所で修正します。`query_source` が `agent:` で始まる場合は、代わりに[サブエージェントのモデル](https://code.claude.com/docs/ja/sub-agents.md#choose-a-model)を設定している箇所で修正します。

v2.1.233 より前では、Claude Code は認識しないモデル ID でリクエストを送信しても、行を書き込んでいませんでした。

### 管理ロック下ではサンドボックスの許可エントリが無視される

`/status` と `claude doctor` に表示されるこの警告は、管理設定で [`allowManagedReadPathsOnly`](https://code.claude.com/docs/ja/settings-reference#sandbox-filesystem-allowmanagedreadpathsonly) または [`allowManagedDomainsOnly`](https://code.claude.com/docs/ja/settings-reference#sandbox-network-allowmanageddomainsonly) が設定されているため、警告に示されたファイル内の [`allowRead`](https://code.claude.com/docs/ja/settings-reference#sandbox-filesystem-allowread) または [`allowedDomains`](https://code.claude.com/docs/ja/settings-reference#sandbox-network-alloweddomains) エントリが適用されないことを意味します。

```text wrap theme={null}
sandbox.filesystem.allowRead is ignored — managed settings set allowManagedReadPathsOnly, so only allowRead paths from managed settings are honored. The 3 entries in /home/you/.claude/settings.json will NOT apply (see https://code.claude.com/docs/en/settings#sandbox-settings).
```

ネットワークのロックの場合、警告には `sandbox.network.allowedDomains` と `allowManagedDomainsOnly` が示され、`only allowed domains (and WebFetch domain rules) from managed settings are honored` と表示されます。

**対処方法:**

* この警告に対処する必要はありません
* それらのパスやドメインが必要で、組織の管理設定でロックが設定されている場合は、それらを管理設定に追加するよう管理者に依頼してください。示されたファイルからもエントリを削除するまで、警告は表示されたままになります。
* 警告を解消するには、示されたファイルからエントリを削除します。プロジェクトの `.claude/settings.json` など共有しているファイルの場合は、ロックのないチームメイトのためにエントリを残し、警告を表示させたままにしておくこともできます。

### Sandbox mask files left behind at write-deny paths

`claude doctor` と `/status` に表示されるこの警告は、マスクファイル、つまり[サンドボックス](https://code.claude.com/docs/ja/sandboxing.md)が書き込みを拒否するパスに置かれた 0 バイトの読み取り専用のプレースホルダーファイルを一覧表示します。この警告は、Linux および WSL2 で、ファイルシステムの分離を有効にした状態でサンドボックス化が有効になっている場合に表示されます。それらのファイルを保持しているプロジェクトで Claude Code セッションが開いていない状態になったら、シェルから削除してください。

`claude doctor` では、警告は次のように表示されます。

```text theme={null}
- Sandbox mask files left behind at write-deny paths: /home/you/project/.claude/settings.local.json
  Fix: A session leaves one where it was killed, or where it exited while a sandboxed command was still running. Remove each with `rm <path>` while no other Claude Code session is running in that project — a 0-byte read-only file where a settings file belongs makes "Yes, and don't ask again" fail to save, and the sandbox binds it read-only again on every start
```

**対処方法:**

* 一覧に表示されたファイルを保持しているプロジェクトで開いているすべての Claude Code セッション（`/status` に警告が表示されたセッションを含む）を終了してから、シェルで作業します。別のセッションのサンドボックスがまだ使用しているプレースホルダーは、そのセッションの書き込み保護として機能している部分です
* シェルで、一覧に表示された各ファイルを `rm` で削除し、`rm` が書き込み保護されたファイルについて確認を求めた場合は確定します。警告には最大 3 つのファイルが示され、残りは件数として表示されるため、警告が表示されなくなるまで削除後に `claude doctor` を再実行してください
* 「Yes, and don't ask again」で保存した権限の選択が保持されなかった場合は、プレースホルダーを削除した後に再度保存します

v2.1.309 より前では、警告は `Stale sandbox mask files left by a killed session` と表示されていました。

v2.1.257 より前では、`claude doctor` はこれらのファイルを警告しませんでした。それ以前のバージョンでも、セッションが強制終了されると同じプレースホルダーが残ります。

### Two Claude Code config files exist

Claude Code はこのメッセージが示す 1 つ目のファイルを使用しているため、2 つ目のファイルの内容は有効になっていません。1 つ目は `.config.json` で、これは [`.claude.json`](https://code.claude.com/docs/ja/claude-directory#ce-claude-json) の旧名です。メッセージには、どちらのファイルに自分のセットアップが含まれているかを確認する方法が含まれています。

```text wrap theme={null}
Two Claude Code config files exist: this run uses /home/you/.claude/.config.json, not /home/you/.claude.json. The file with the higher count here is usually yours, and this prints nothing else from them: grep -c -E '"(hasCompletedOnboarding|mcpServers)"' "/home/you/.claude/.config.json" "/home/you/.claude.json". To end this: if several hosts share this home, first get every host to version 2.1.319 or later, since an older one can write a moved .config.json back. Then stop your Claude processes on every host, move aside the one you do not want, and start none until no host lists it.
```

Windows では、`grep` コマンドを含む文の代わりに `The one with hasCompletedOnboarding or mcpServers in it is usually yours.` が表示されます。

**対処方法:**

**1. 自分のセットアップを含むファイルを見つける**

* **Windows の場合**: 両方のファイルを開き、`hasCompletedOnboarding` または `mcpServers` が含まれているのはどちらかを確認します
* **その他のプラットフォームの場合**: シェルでメッセージにある `grep` コマンドを実行し、どちらのファイルのカウントが大きいかを確認します

**2. ホームディレクトリを共有するすべてのホストを更新する**

複数のホストがこのホームディレクトリを共有している場合は、まずすべてのホストで Claude Code をメッセージに示されたバージョン以降に更新します。

**3. Claude Code を停止する**

すべてのホストで Claude Code のプロセスを停止します。

**4. 不要なファイルを移動する**

不要なファイルをそのフォルダの外に移動します。元に戻せるように、削除ではなく移動してください。

**5. Claude Code を再度起動する前に待つ**

移動したファイルを元のパスにあるものとして一覧表示するホストがなくなるまで、どのホストでも Claude Code を起動しないでください。

2 つのファイルのいずれかがなくなると、このメッセージは表示されなくなります。

### Make this change again later: \~/.claude.json could not be updated

stderr に表示されるこの通知は、サインインや信頼プロンプトへの回答など、[`~/.claude.json`](https://code.claude.com/docs/ja/claude-directory#ce-claude-json) への変更がファイルに保存されなかったことを意味します。

```text theme={null}
Make this change again later: /home/user/.claude.json could not be updated, so it applies to this session only.
```

**対処方法:**

* 後のセッションで同じ変更を再度行います。たとえば、`/login` を再度実行するか、信頼プロンプトに再度回答します。

## 応答の品質がいつもより低いように見える

Claude の回答がいつもより能力が低いように見えるが、エラーが表示されていない場合、原因は通常、モデル自体ではなく会話の状態です。Claude Code はモデルバージョンを静かに変更することはありません。これらのケースでフォールバックモデルに切り替わることができます。

* 設定された [`--fallback-model`](https://code.claude.com/docs/ja/cli-reference#cli-flags) は可用性エラーの後、そのターンのみ引き継ぎ、トランスクリプトに通知が表示されます
* Amazon Bedrock または Google Cloud の Agent Platform スタートアップチェックがデフォルトモデルが利用不可であることを検出するか、アカウントが [セッション中にそれへのアクセスを失う](https://code.claude.com/docs/ja/amazon-bedrock.md#when-a-model-is-disabled-mid-session)
* Fable モデル、Opus 5.5、Sonnet 5.5、Opus 5 での [自動モデルフォールバック](https://code.claude.com/docs/ja/model-config.md#automatic-model-fallback) は、指摘されたカテゴリにフォールバックモデルがある場合、セッションをそのフォールバックモデルに移動します。トランスクリプトに通知が表示されます

以下のモデル選択チェックは 2 番目と 3 番目のケースをキャッチします。最初のケースはトランスクリプト通知として表示され、`/model` の変更ではなく表示されます。[モデル設定](https://code.claude.com/docs/ja/model-config.md) は各フォールバックが適用される時期を説明しています。

まずこれらを確認してください。

* **モデル選択**: `/model` を実行して、期待するモデルにいることを確認します。以前の `/model` の選択または `ANTHROPIC_MODEL` 環境変数により、意図したより小さいモデルにいる可能性があります。
* **努力レベル**: `/effort` を実行して現在の推論レベルを確認し、難しいデバッグまたは設計作業のためにそれを上げます。デフォルトはモデルによって異なるため、最大値以下であると仮定する前に確認してください。[努力レベルを調整する](https://code.claude.com/docs/ja/model-config.md#adjust-effort-level) でモデルごとのデフォルトと `ultrathink` ショートカットを参照してください。
* **コンテキスト圧力**: `/context` を実行してウィンドウがどの程度満杯かを確認します。容量に近い場合は、自然な区切り点で `/compact` を実行するか、`/clear` を実行して新しく開始します。[コンテキストウィンドウを探索する](https://code.claude.com/docs/ja/context-window.md) で auto-compact が以前のターンにどのように影響するかを参照してください。
* **古い指示**: 大きいまたは古い `CLAUDE.md` ファイルと MCP ツール定義はコンテキストを消費し、応答を操作できます。`/doctor` チェックアップは過度に大きいメモリファイルと未使用の拡張機能にフラグを付け、`/context` は MCP ツールトークン使用量を表示します。v2.1.205 より前では、`/doctor` は過度に大きいメモリファイルとサブエージェント定義にフラグを付けた診断画面を開きました。

応答がうまくいかない場合、通常は修正で返信するよりも巻き戻す方が効果的です。Esc を 2 回押すか `/rewind` を実行して悪いターンの前に戻り、より具体的なプロンプトで言い換えます。スレッド内で修正すると、間違った試みがコンテキストに残り、後の回答をそれに固定する可能性があります。[チェックポイント](https://code.claude.com/docs/ja/checkpointing.md) を参照してください。

上記を確認した後も品質がまだおかしいように見える場合は、`/feedback` を実行して、期待したものと得たものを説明してください。この方法で送信されたフィードバックには会話トランスクリプトが含まれており、Anthropic が実際の回帰を診断する最速の方法です。環境で `/feedback` が利用できない場合は、[エラーを報告する](#report-an-error) を参照してください。

Claude が疑わしいプロンプトインジェクションについて警告する場合、または疑わしいインジェクションのためにリクエストを拒否する場合、警告が名前を付けるテキストがファイルまたは Web コンテンツではなく Claude Code が会話に自動的に追加するコンテキストである場合は、`claude update` を実行して再試行してください。更新後に警告が繰り返される場合は、フラグが付いたコンテンツをプロンプトに貼り付け直すのではなく、[報告してください](#report-an-error)。v2.1.201 より前では、Sonnet 5 は同じ方法でいくつかのリクエストを拒否しました。

## エラーを報告する

このページで扱っていないコンポーネントからのエラーについては、関連するガイドを参照してください。

* MCP サーバーが接続または認証に失敗した場合：[MCP](https://code.claude.com/docs/ja/mcp.md)
* Hook スクリプトが失敗したか、ツールをブロックした場合：[Debug hooks](https://code.claude.com/docs/ja/hooks.md#debug-hooks)
* インストール中に権限が拒否されたか、ファイルシステムエラーが発生した場合：[Troubleshoot installation and login](https://code.claude.com/docs/ja/troubleshoot-install.md)

ここにエラーが記載されていない場合、または提案された修正が役に立たない場合：

* Claude Code 内で `/feedback` を実行して、トランスクリプトと説明を Anthropic に送信します。このコマンドは、事前入力された GitHub issue を開くオプションも提供します。Anthropic への送信には[認証](https://code.claude.com/docs/ja/authentication.md)が必要です。Amazon Bedrock、Google Cloud の Agent Platform、Microsoft Foundry、その他のサードパーティプロバイダー、または Anthropic 認証情報が設定されていない場合、`/feedback` は代わりに Anthropic アカウント担当者に送信できるローカルアーカイブを保存します。
* `/feedback` が組織のポリシーによって無効化されていると応答した場合は、[そのメッセージの項目](#feedback-is-disabled-by-your-organizations-policy)を参照してください。
* シェルから `claude doctor` を実行して、インストールの読み取り専用診断を実行するか、Claude Code 内で `/doctor` チェックアップを実行してセットアップの問題を検出して修正します。
* [status.claude.com](https://status.claude.com) でアクティブなインシデントを確認します。
* GitHub の[既存の issue](https://github.com/anthropics/claude-code/issues) を検索します。
