
How to Stop an AI Agent Tool Loop—and Keep It Stopped
Stop new tool execution, preserve verified results, and reconcile any uncertain write before resuming. A turn limit contains a loop; progress checks and operation records make recovery safer.

Stop new tool execution, preserve verified results, and reconcile any uncertain write before resuming. A turn limit contains a loop; progress checks and operation records make recovery safer.

Start with the final outbound request. Use the instruction field and message positions supported by that exact endpoint, preserve tool-call pairs, and verify the full task after the role error clears.

For direct Anthropic API access, set ANTHROPIC_API_KEY and approve it in the interactive CLI. Gateways need their own endpoint and credential; cloud providers and Desktop use separate configuration paths.

Start with /context for session drift, check loaded instructions before editing memory, and verify Context7 authentication and returned docs before adding another server.

To use DeepSeek in Claude Code, choose OpenRouter's gateway or DeepSeek's Anthropic-compatible endpoint. Each needs its own key and model names; a successful reply alone does not confirm the model or coding-tool compatibility.

For an Opus 4.7 `top_p deprecated` error, omit sampling fields from the final request your client sends. Native Messages and Bedrock Converse put those fields in different places; keep the same model and task when checking the fix.

Sonnet 5.5 keeps Sonnet 5's $2/$10 token prices. On Artificial Analysis tests it costs less per task from low to xhigh effort and about 51% more at max.

Temporarily unable to authenticate comes from Anthropic: stay signed in and retry. Login expired or Failed to authenticate means /login. The wording decides.

A Codex token-exchange 403 is a refused authentication request. The full error tells you whether to repair callback access, check the client’s network, renew stored credentials, or stop for an access restriction.

As of October 6, 2026, only GPT-6.1 Sol is open to developers. Fable 5.5 is unannounced, Gemini 4 Argon is limited to Fairwind, and GPT-6.1 Astra was canceled.

GPT-6.1 Sol keeps GPT-6 Sol's $2/$10 rates but halves cached input to $0.10. Requests using none effort or Chat Completions tools must change.

As of October 6, 2026, Google hasn't announced Nano Banana 2.1. It showed up in Google Flow for some users, then reportedly vanished. No API or price exists.

For a confirmed Nano Banana 2 503 response, retry with jitter within an attempt and time budget. Keep the image workflow intact, verify image output, and defer work when recovery cannot fit the deadline.

If Pro returns a restriction message or no image, first recover the correct Pro route: More → Redo with Pro in Gemini, the Pro menu in eligible AI Mode accounts, or gemini-3-pro-image in the API. Then check the actual response before calling the failure a policy block.

For "Unsupported file URI type," check the exact image value your app sent and the endpoint that rejected it. Native Gemini can accept supported HTTPS URLs; local paths, unresolved templates and base64 data URLs need a different payload. Verify the repair by getting an edited image from the same Pro request.

For APIConnectionError, capture the underlying exception and test DNS, TLS, proxy settings, and the exact endpoint from the failing runtime. An HTTP response narrows the problem; recovery still requires a successful request through the original application.

For OpenAI API quota exceeded or insufficient_quota, inspect error.code before buying credits or retrying. A depleted balance, enforced spend cap, and approved usage limit need different fixes; ChatGPT subscriptions do not fund API calls.

Compare the best AI video models in 2026 including Sora 2, Veo 3.1, Runway Gen-4.5, Kling 2.6, and open-source options. Features verified pricing data, real cost calculations per 10-second video, scene-based recommendations, and an API developer guide.

A returned Claude API 500 api_error calls for bounded retries and request evidence. If it keeps failing, stop the immediate loop, defer safe work, and send a redacted reproduction to the service owner.

Claude Code API Error 500 is a server-side failure, not your prompt or account. Check status, then retry, sign in again, or resume after checking finished work.

A slash command is an invocation interface; a skill packages reusable instructions; a hook runs at a lifecycle event. Custom commands now use the skills system, and /claude-api invokes the bundled Claude API skill.

"Rate limit reached" in Claude Code is usually a session, weekly, or Opus/Sonnet limit. Match the line, then resume in the same session without resending.

Run /usage for Claude Code's 5-hour session and weekly limits and their reset times. /status only shows account and model. Audit fast drain before upgrading.

Claude API Error: Rate limit reached and Rate Exceeded are not one limit. Match the current message to plan usage, 1M access, API key, provider, or gateway.