Skip to content
Topics

AI Development & Programming: Build Apps with AI

Build smarter with AI-powered development. Code generation, app building, debugging, and test automation guides.

124 articles

Sort articles to find what you need

Articles in AI Dev & Programming

API Error: The response stopped arriving — What It Means and How to Fix It When Claude Code's Response Data Stops Midway

API Error: The response stopped arriving — What It Means and How to Fix It When Claude Code's Response Data Stops Midway

If Claude Code shows "API Error: The response stopped arriving. The response above may be incomplete." partway through a response, the connection stayed open but data stopped arriving, and Claude Code's watchdog timer cut it off. Completed output is kept, so check the state of your work and reply continue to pick up where it left off. This message is the renamed version of what was shown as "Response stalled mid-stream" before v2.1.227. Based on the official error reference and network configuration documentation, we cover how it differs from Connection lost mid-response, The response stalled before a response was produced, and Streaming response ended before any complete data was received; why it is not resent; how -p and subagents handle it; how to check your version, network path, and watchdog timers; and what to record when you report it. Five GitHub reports we read are treated separately from the official explanation, as unconfirmed cases.

Login expired · Please run /login: What It Means and How to Fix It When Claude Code Can’t Renew Your Saved Login

Login expired · Please run /login: What It Means and How to Fix It When Claude Code Can’t Renew Your Saved Login

If Claude Code shows “Login expired · Please run /login,” the automatic renewal of your saved login was refused and Claude Code cleared the credentials. Later prompts never reach the API and stop on your machine, so sign in again with /login instead of retrying. Based on the official error reference, we cover how it differs from Not logged in, OAuth token has expired, and Your account is on hold; how the message changed in v2.1.206; the steps from checking /status to signing in again; what to do with -p and CI; and the version, Keychain, clock, and CLAUDE_CONFIG_DIR checks for when it keeps recurring. Six GitHub reports are presented separately as cases with no confirmed cause.

Codex "thread not found": Troubleshooting and a Recovery Case

Codex "thread not found": Troubleshooting and a Recovery Case

When Codex shows your history but can't send a message with "thread not found," the conversation may not be lost. This article explains the difference between saved history and the conversation that accepts new instructions, and shares a case where sending recovered after reloading. It then covers the order to try fixes, how to hand off the task without deleting history if the problem persists, and what to include in a report.

What Is Jev? Uses, Pricing, and Limits of TypeSafe's Decision AI That Doesn't Generate Text

What Is Jev? Uses, Pricing, and Limits of TypeSafe's Decision AI That Doesn't Generate Text

Jev is TypeSafe's AI model that returns a choice, score, or Yes/No probability instead of generating text. This guide explains how Choice, Score, and Noul differ, how to read confidence, and how to write an API request that routes inquiries. It also covers documented weaknesses such as calculations, dates, and leading prompts, plus pricing, input limits, and how to evaluate Jev with non-English text, so you can judge whether it fits your work.

What Is Claude Code's opusplan? Opus for Planning, Sonnet for Implementation: How to Set It and What to Watch For

What Is Claude Code's opusplan? Opus for Planning, Sonnet for Implementation: How to Set It and What to Watch For

You want a smart model to handle only the planning, and a faster, cheaper model to handle the implementation. Claude Code's opusplan is a model setting that does this automatically. It runs Opus while in plan mode and Sonnet the rest of the time, and you can use it with /model opusplan or with model in settings.json. However, it does not appear in the /model list, and because the model switches every time you enter or leave plan mode, each switch re-reads the whole conversation without the cache. Based on the official documentation, the CHANGELOG and GitHub issues as of September 15, 2026, this article covers how to set it up (including pinning versions and 1M context), the flow from plan mode through approval to implementation, how it was removed from the selector in v2.0.0 and what an Anthropic staff member said about it, an estimate of the cache cost a switch creates and how to keep it down, how it differs from the advisor tool and subagents, and the kinds of work it suits and doesn't.

How to Run Claude Code Subagents on a Different Model: Handing Work to Sonnet or Haiku, Measured

How to Run Claude Code Subagents on a Different Model: Handing Work to Sonnet or Haiku, Measured

Can you keep Claude Code's main session on Opus 5 and hand only jobs like translation or high-volume checks to Sonnet or Haiku subagents? Yes. A subagent's model is decided in this order: the model passed at invocation, model in the definition file, the CLAUDE_CODE_SUBAGENT_MODEL environment variable, then the main session's model, and effort can also be set per subagent. Based on the official documentation as of September 15, 2026, this article covers how that order differs between versions, CLAUDE_CODE_SUBAGENT_MODEL_FORCE for pinning every subagent to one model, how aliases resolve differently by provider, and the fact that since v2.1.198 the built-in Explore inherits the main session's model. It then shares what happened when I actually launched subagents on other models and checked the conversation logs: they ran on the models I specified, each one read tens of thousands of tokens just to start, the subagent cache expires after 5 minutes even on a subscription, and the same translation given to Opus 5, Sonnet 5 and Haiku 4.5 twice each differed in time, cost and quality. Finally, it summarizes how this affects cost and usage limits, and what to weigh when deciding which work to move to a cheaper model.

Claude Code Usage by Session: How to See Which Session Is Eating Your Plan

Claude Code Usage by Session: How to See Which Session Is Eating Your Plan

Run several sessions in parallel and you start to wonder which one is eating your weekly limit. Yet Claude Code's /usage only shows the current session's numbers plus your plan-wide consumption split by skill, subagent, plugin and MCP server, and what share each session used appears neither in the desktop app's usage ring nor on the claude.ai settings page (as of September 2026). The answer is in the conversation logs stored on your machine (the JSONL files in ~/.claude/projects), but adding them up as they are gives the wrong result, because a single response is written across several lines, one per content block, and subagent records live in separate files. Measured on my own machine, the naive total came to about twice the correct value, and because the size of the error differed from session to session, even the ranking changed. This article covers what the official screens do and do not show, how to count the logs correctly with an aggregation script of about 50 lines, the measured result in which one session took nearly a third of all usage, the limits of what the numbers can tell you, and how to set up OpenTelemetry if you want to keep watching over time.

Claude Code: What Is Actually Eating Your Context? How to Measure It, and What to Cut First

Claude Code: What Is Actually Eating Your Context? How to Measure It, and What to Cut First

Install too many skills and they crowd out your context: half of that is right and half of it is wrong. According to the Claude Code documentation, the skill listing draws on a fixed budget of 1% of the model context window, and no matter how many skills you add, it stops there. Instead of growing, the listing starts dropping descriptions, beginning with the least frequently invoked skills, and keeps only their names. A skill that has lost its description no longer connects to what you asked for, and yet no error appears and nothing gets slower. This article works through the different jobs of the three measurement tools (/context, /usage and /skill-doctor), the definition of a cache miss as 5% and 2,000 tokens, how the cache lifetime falls from one hour to five minutes depending on your plan, why a CLI is still lighter than MCP now that tool definitions are lazy-loaded by default, the reasoning behind keeping CLAUDE.md under 200 lines, and what to cut first once you have measured, restricted throughout to what could be confirmed in the official documentation.

The model returned no content — Causes and Fixes: a Claude Error Message Means Something Different Depending on Who Wrote It

The model returned no content — Causes and Fixes: a Claude Error Message Means Something Different Depending on Who Wrote It

You hit a wall while using Claude, you search the exact message that appeared, and almost nothing comes back. Five strings behave this way: The model returned no content because the response was blocked by content filtering, The response was blocked by the provider's content filter, Streaming response ended before any complete data was received, Could not locate the Claude CLI on PATH, and Connection to Claude's response was lost. Claude may still be working. What they share is that they appeared while you were using Claude, yet searching Claude's own material seems to turn up nothing, and the reason is simple: the program that wrote the message on your screen is not necessarily the one you think it is. This article does not explain each individual cause from scratch. It is an entrance hall that identifies who wrote the message and routes you to the right article. It first splits the possible writers into four layers, the backend that serves the model, Claude Code itself, the launching IDE extension or wrapper, and third-party clients, and then does the matching. Two of the five turn out to be entries in Claude Code's official error reference. The official definition of the streaming message is that the headers came back but the body held no Claude API message, which is not a mid-way cut at all, and reading it as a dropped connection sends you down the wrong path. Could not locate the Claude CLI on PATH sits in a separate chapter, Wrapper and IDE errors, described as printed by the launching program rather than by Claude Code, and the real display string can be four sentences long where the official heading is one, which is why searching it returns nothing. The two content-filter strings, meanwhile, are third-party vocabulary, and OpenCode Issue #35736 reports that three completely separate failures, a Vertex 404, a socket drop, and a genuine refusal, all surface as the same blocked by content filter sentence. The wording is correct for only one of the three, so believing it and softening your prompt will never fix a misconfigured model ID. GitHub official documentation also states that input prompts and output completions pass through GitHub Copilot content filters when Claude is used, so using Claude does not mean Anthropic filtering is what stopped you. The remaining string appears in neither the official error reference nor the Remote Control documentation, so its source could not be identified; no tool is named for it, and four steps for tracing it in your own environment are given instead. What is settled and what is not is labelled throughout.

API Error: Connection lost mid-response — Causes and Fixes for the Error v2.1.227 Renamed

API Error: Connection lost mid-response — Causes and Fixes for the Error v2.1.227 Renamed

Claude Code stops partway through a response with "API Error: Connection lost mid-response. The response above may be incomplete." and searching that exact string turns up almost nothing, because the string itself is new. The official error reference states it plainly: before v2.1.227, Connection lost mid-response appeared as Connection closed mid-response, and in the same batch Response stalled mid-stream became The response stopped arriving, while Connection closed while thinking, before producing a response became Connection lost before a response was produced. The event is not new; only the word on screen changed, which is why material written under the old name still applies unchanged and why an issue search has to use both strings. Starting from that rename, this article works only from the official documentation and public issues. It covers the official definitions of the six "cut off mid-response" messages (Server error, Connection lost, Your computer went to sleep, The response stopped arriving, Part of the response never arrived, and The response stream was malformed), why the output already on screen is kept deliberately - re-sending the request could execute the same tool call twice - and why the recovery step is to reply continue rather than to start over. It then explains why nothing is retried automatically, using the official Automatic retries branch: a break before anything has completed is re-sent with exponential backoff up to ten times, a break after thinking but before any output is re-sent at most twice and then ends the turn with Connection lost before a response was produced, and a break after a block has completed is not re-sent at all. From there it maps the three layers where a stream can break - your machine and line, the path through proxies and gateways, and the server side with connection reuse - adds the easily missed fourth case of mTLS certificate rotation and its reload behaviour from v2.1.232, and gives a nine-step isolation checklist. It lists the four stream watchdog timers with their defaults (first byte 180s, event level 300s, byte level 180s, body idle five minutes) alongside CLAUDE_CODE_MAX_RETRIES, CLAUDE_CODE_RETRY_WATCHDOG, API_TIMEOUT_MS and the two stream timeout variables, while making clear that raising the retry count does not reduce this particular message. A comparison table separates eight confusable messages, and two public reports, #86473 and #85979, show raw HTTPS and curl completing while only the CLI dies with ECONNRESET. It closes by separating what is officially confirmed from what is only reported, including that builds before v2.1.222 could show this notice even when the response was in fact complete.

The 3 Breaking Changes in Claude Fable 5.1, and How to Migrate

The 3 Breaking Changes in Claude Fable 5.1, and How to Migrate

Migrating to Claude Fable 5.1 is not a matter of swapping the model ID and calling it done. Anthropic marks three of the changes as breaking, and two of them surface far from where they originate. The first throws immediately: passing type any or type tool to tool_choice returns 400 invalid_request_error, because forcing a call skips the reasoning this model always does and the argument quality drops with it. The second is the quiet one. Thinking blocks now record which model produced them and only carry over in one direction, so a conversation moving onto Fable 5.1 keeps its reasoning while a router or fallback that moves it back to an earlier generation loses that turn entirely. By default the API discards the unreadable blocks before the model sees them, and because the discarded tokens are neither counted in input_tokens nor billed, nothing shows up on the invoice. Making it visible takes the thinking-binding-controls-2026-08-01 beta header. The third one is the broadest: changing anything before a Fable 5.1 thinking block, including the system prompt, the tools array or any earlier message, invalidates it and every block after it. Whether that is enforced depends on when your account was created, which means a staging environment you just spun up can fail while production does not. The article also covers what did not get worse: input stays at $10 and output at $50 per million tokens, while cache reads drop to $0.25, or 0.025x base input against the 0.1x every other Claude model charges. Anthropic quotes roughly 25% lower cost on typical workloads and up to about 45% on agent-heavy work. Seven behaviors change without any code change, including fewer parallel tool calls, less progress narration at high effort, and more answers from memory at low effort, and Anthropic counts five additions, one of which is the cache read price cut handled on its own in section 5, with beta features among the remaining four that exist specifically to replace the patterns the breaking changes forbid.

Local LLM Coding with Ollama and Cline: What Works, and the One Setting That Breaks It

Local LLM Coding with Ollama and Cline: What Works, and the One Setting That Breaks It

Local models have been able to write code for years, but only as completion: finishing the line you were already typing. The agentic pattern, where the model reads the repository, edits several files and runs the tests, was too heavy to run at home. That changed through late 2025 and 2026, and the clearest evidence is that model developers now market for it directly: the Qwen model card names CLINE outright and ships a purpose-built function call format, while Mistral released Devstral Small 2 (24B) under Apache 2.0 alongside the 123B Devstral 2 on December 9, 2025. This article works through what is actually achievable today using primary sources only, because several roundup posts turned out to have attributed one model size's score to another. The central obstacle is a configuration detail almost nobody mentions: Ollama does not use a fixed default context length, it derives one from your VRAM, which means 4k below 24 GiB, 32k from 24 to 48 GiB and 256k above that. A typical gaming PC lands on the first row, so an agent overruns the window immediately and the start of the conversation is silently truncated. No error is raised. It forgets instructions, repeats actions and loses the goal, and the whole thing reads as a stupid model rather than a discarded context. Ollama documents at least 64000 tokens for coding tools, set via OLLAMA_CONTEXT_LENGTH, but raising it raises memory use too, so ollama ps has to confirm the model still fits on the GPU. Also covered: why Continue and Cline are different tools with different hardware demands, published scores for Qwen3.6-35B-A3B (73.4 on SWE-bench Verified, 3B active out of 35B) and Devstral Small 2 (68.0%), download sizes and memory guidance by VRAM tier, a four-step setup, why "local is at X% of the cloud" comparisons no longer hold now that the frontier side is drifting away from publishing SWE-bench Verified, and an honest accounting of what "free" actually costs.