Atlas ends the assistant message in a ContextOverflowError, commonly with the message "Input exceeds context window of this model", because the request is larger than the model's context window. Fix it by compacting the session so older turns are summarized instead of resent, dropping large pasted files or MCP resources from the prompt and letting Atlas read them with the read tool on demand, and switching to a model with a larger context window via `atlas models`.
Why does Atlas say Input exceeds context window of this model
Atlas says "Input exceeds context window of this model" because parseAPICallError classifies the failure as context_overflow. That classification fires when the provider reports context_length_exceeded, returns HTTP 413, or the message matches isContextOverflow. The request was simply larger than the model's window.
ContextOverflowError is a size verdict, not a correctness verdict. Atlas recognizes three separate provider signals as the same underlying overflow. A provider reporting context_length_exceeded, a provider returning HTTP 413, and a provider whose message text matches isContextOverflow all land on the context_overflow type. parseStreamError maps the streaming variant of that failure to the identical type, so a prompt that overflows mid-stream is classified exactly like one that overflows before streaming begins. The practical consequence: retrying cannot help. The prompt token count is unchanged, so the same oversized input will not fit the model window on a second attempt either.
How do I fix context overflow in Atlas
Step 1 of the documented fix is to compact the session so older turns are summarized instead of resent. Compaction comes first because a long session, not a single oversized message, is the usual reason an Atlas request grew past the model's context window and raised ContextOverflowError.
Compacting an Atlas session replaces accumulated conversation history with a summary, so older turns stop being resent verbatim on every request. The prompt token count drops immediately, and the same model that just refused the request will typically accept the compacted one. Compact before reaching for a bigger model, because a larger context window applied to an ever-growing session merely postpones the same ContextOverflowError. After compaction, re-send the message. If the overflow repeats, conversation history is not the culprit, and the pasted content sitting inside your prompt is where to look next.
Why pasted files and MCP resources cause ContextOverflowError
Large pasted files and MCP resources are a leading cause of ContextOverflowError in Atlas, because every one of them is resent inline on every request. Step 2 of the documented fix is to drop them from the prompt and let Atlas read them with the read tool on demand instead.
A file pasted into an Atlas prompt lives in the context for the rest of the session and is resent with every subsequent turn. The same applies to MCP resources pulled in from a Model Context Protocol server. Atlas connects to Model Context Protocol servers and exposes their tools to the agent, so it is easy to accumulate large resource payloads without noticing. The better pattern is to remove the pasted content and let Atlas read the file with the read tool when it actually needs it. Atlas indexes code by AST declarations using tree-sitter, so it can find the relevant declaration without you pasting the whole file.
How to switch to a model with a larger context window
Step 3 of the documented fix is to switch to a model with a larger context window via `atlas models`. Atlas lets you switch the active model and provider on the fly with favorites and recents, so the change takes effect without restarting the session that hit ContextOverflowError.
`atlas models` is the documented path out of a ContextOverflowError that compaction cannot solve. Some tasks are legitimately large, and a bigger window is the honest answer for them. Be clear about the caveat though: a larger context window raises the ceiling, it does not remove it. If the session keeps growing, ContextOverflowError returns at the new limit, and parseAPICallError classifies it exactly the same way. Treat the model switch as headroom for a specific task, and keep compaction and on-demand reads as the habits that keep sessions inside the window in the first place.
How to fix prompt too large in atlas github
Step 4 of the documented fix covers `atlas github`, where a context overflow is caught by name and re-thrown as a prompt-too-large message that lists the offending files. Trim the files named in that message, because the list tells you precisely which inputs pushed the request past the model's context window.
`atlas github` handles the overflow case with more detail than the generic ContextOverflowError. Instead of only reporting that the input exceeds the context window, `atlas github` catches the overflow by name and re-throws it as a prompt-too-large message that enumerates the offending files. Read that list first. Trim or exclude the files it names, then re-run. Because the message identifies the specific files, you do not have to guess at which part of the input to shrink, which makes the `atlas github` path considerably faster to resolve than a plain ContextOverflowError in an interactive session.
What HTTP 413 and context_length_exceeded mean in Atlas
HTTP 413 and context_length_exceeded are two of the three signals Atlas treats as context_overflow. parseAPICallError classifies either one, plus any message matching isContextOverflow, as the same ContextOverflowError, so the prompt exceeded the model context window whichever signal the provider chose to send.
Providers disagree about how to report an oversized prompt. One provider returns the error code context_length_exceeded. Another returns HTTP 413. A third returns neither and says so only in the message text, which is why Atlas also matches against isContextOverflow. parseAPICallError folds all three signals into one context_overflow classification, and parseStreamError does the same for the streaming path. The benefit is that your remedy never changes with the provider: compact the session, drop pasted files so Atlas reads them with the read tool on demand, or move to a model whose context window is large enough using the `atlas models` command.
How to verify the context overflow fix worked
Verify the ContextOverflowError fix by re-sending the same message after compacting the session. A reply that completes normally, with no context_length_exceeded code, no HTTP 413, and no context_overflow classification from parseAPICallError, means the request now fits inside the model's context window and the fix held.
Verification for ContextOverflowError is straightforward because the error is deterministic. The same request against the same window either fits or it does not, so a successful completion is real evidence rather than luck. Send the message again after compacting. If the reply completes, the fix worked. If "Input exceeds context window of this model" comes back, the request is still too large, and the next lever is dropping pasted files and MCP resources, then switching to a model with a larger context window via `atlas models`. Do not simply retry the identical request. parseStreamError and parseAPICallError will classify it as context_overflow every time.
How to fix it
- 01Compact the session so older turns are summarized instead of resent.
- 02Drop large pasted files or MCP resources from the prompt and let Atlas read them with the read tool on demand.
- 03Switch to a model with a larger context window via `atlas models`.
- 04In `atlas github`, an overflow is caught by name and re-thrown as a prompt-too-large message listing the offending files. Trim the files it names.
Frequently asked questions
- how to fix Input exceeds context window of this model in atlas
- Compact the Atlas session so older turns are summarized instead of resent, drop large pasted files and MCP resources and let Atlas read them with the read tool on demand, and switch to a model with a larger context window via `atlas models`.
- what is ContextOverflowError in atlas
- ContextOverflowError is how Atlas reports that a request exceeded the model's context window. parseAPICallError classifies the failure as context_overflow when the provider reports context_length_exceeded, returns HTTP 413, or the message matches isContextOverflow.
- does atlas retry a context overflow error
- Retrying a context overflow does not help, because the request is unchanged and will not fit the second time either. Compact the session, remove pasted files, or switch to a model with a larger context window via `atlas models`.
- why does pasting a large file into atlas break the model
- A large pasted file stays in the Atlas context and is resent on every turn, which pushes the request past the model's context window. Drop the paste and let Atlas read the file with the read tool on demand instead.
- atlas github says prompt too large, which files do I trim
- In `atlas github`, an overflow is caught by name and re-thrown as a prompt-too-large message that lists the offending files. Trim the files named in that message, then re-run.
- will a bigger context window permanently fix atlas context overflow
- A model with a larger context window raises the ceiling but does not remove it. If the session keeps growing, Atlas will raise ContextOverflowError again at the new limit, so compaction and on-demand reads still matter.
- how do I compact an atlas session
- Compacting an Atlas session summarizes older turns instead of resending them verbatim, which shrinks the request. Compaction is the first documented fix step for ContextOverflowError and usually clears it without changing models.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Atlas for Godot: Terminal-Native AI Coding for GDScript and the Node Tree in 2026
Atlas is a terminal-native AI coding agent for Godot in 2026, working across GDScript, the node tree, and signals, where scene structure is half the program.
Atlas with Gemma 2 27B (Ollama): the Free Local Diff Reviewer in 2026
Gemma 2 27B (Ollama) is Google's 2024 flagship open model, 16GB and Free (self-hosted), with 8K tokens (8,192) of context. Use it to review Atlas diffs, not write them.
Atlas with IBM Granite Code 8B (Ollama): 125K Context on 4.6GB in 2026
IBM Granite Code 8B (Ollama) gives Atlas a 125K tokens window from a 4.6GB download, Free (self-hosted), with enterprise licensing. Setup, tags, and tradeoffs.
Atlas with GPT-5 Pro: The 272,000 Token Output Ceiling in 2026
GPT-5 Pro in Atlas: the only OpenAI model with a 272,000 token max output, priced at $15 per Mtok input, $120 per Mtok output on a 400K tokens window.
Atlas with Groq (gateway) in 2026: LPU Speed for the Agent Loop
Groq (gateway) runs open models on LPU hardware for Atlas: GPT-OSS 120B at $0.15 / $0.60 per Mtok, 131K tokens (131,072) context, and no Claude or GPT-5.
Atlas vs Factory AI: Terminal AI Coding Agents in 2026
Compare Atlas and Factory AI, two terminal AI coding agents for developers in 2026. Explore features, pricing, privacy, and workflow to choose the best fit.
Atlas with Qwen3.5 Plus: A Million-Token Window for $0.40 per Mtok in 2026
Qwen3.5 Plus gives Atlas a 1M tokens (1,000,000) context window at $0.40 per Mtok input and $2.40 per Mtok output. What the million tokens buy, and what closed weights cost.
Atlas with OpenAI o3-mini in 2026: Still Worth Pinning?
OpenAI o3-mini runs in Atlas at $1.10 per Mtok input and $4.40 per Mtok output on a 200K context, but o4-mini costs exactly the same and is newer. Here is the call.