Why Codex Loses the Thread on Long Sessions
A session that was sharp and precise for its first several turns and gets vaguer, more repetitive, or subtly inconsistent by turn thirty isn't a sign the model got worse mid-conversation — it's usually a sign the conversation itself grew into something the model is now working harder to hold together.
Context accumulation is the actual mechanism
Every turn in a long agentic session adds to what the model has to consider on the next one — its own prior responses, tool output, file contents it read, your corrections and clarifications along the way. None of that gets forgotten by default; it all sits in the growing context the model re-reads on every subsequent turn. A session that's been running a while isn't reasoning about your original request in isolation anymore — it's reasoning about your original request plus everything that's happened since, and the earlier, more specific parts of that history can get proportionally less weight the larger the whole context gets.
Why this looks like "losing the thread" rather than an obvious failure
The model doesn't announce that it's struggling to hold a long context together — it keeps answering fluently, which is exactly what makes the degradation easy to miss until the output has drifted meaningfully from what you actually wanted. A subtly wrong assumption from ten turns ago that never got corrected can quietly propagate forward into every later turn's reasoning, looking locally reasonable at each step while the cumulative result drifts further from the original goal.
Stale state is a related but different problem
Beyond the general effect of a growing context, a long session can be reasoning from information that was true earlier and isn't anymore — a file it read at turn five that's since been edited by a different process, an assumption about the codebase's state that a subsequent turn's changes have invalidated. Re-reading relevant files rather than trusting an earlier turn's summary of them is worth doing explicitly at natural checkpoints in a long session, rather than assuming the model's mental model of the codebase has stayed current the whole way through.
The 272K line is a related but separate concern
On models that publish the long-context repricing rule, a session that's grown large enough to genuinely lose the thread is very often also large enough to have crossed the repricing threshold — the two problems tend to show up around the same size, even though they're mechanically unrelated. A session getting both vaguer and more expensive per turn at the same time is worth checking against the context-window planner, since fixing the size problem tends to fix both symptoms at once.
When to summarize and restart versus push forward
A session that's drifted is usually better served by a deliberate reset than by continuing to patch forward — summarize what's actually been accomplished and what's still needed, in your own words rather than trusting the model's own account of a long session it may itself be reasoning about imprecisely, and start a fresh session with that summary as the new starting context. That fresh session, with a tight, accurate summary instead of the full accumulated history, is often sharper than the drifted original ever was again, precisely because it's working from a much smaller, more accurate context.
Breaking work into steps is the preventive version of the same fix
The pattern covered elsewhere on breaking a large task into Codex-sized steps is, from this angle, really a strategy for keeping any single session's context small enough that thread-loss doesn't have room to happen — a task that's naturally chunked into steps with clean handoffs rarely runs long enough in any one session to accumulate the kind of context that causes this in the first place.
What actually helps mid-session, short of a full restart
Explicitly restating the current goal partway through a long session — not because the model has literally forgotten it, but because restating it re-anchors the most recent turns against the original intent rather than against whatever the conversation has drifted toward — is a cheap, useful habit. It costs a small amount of additional input, and it's a much smaller cost than discovering several turns later that the last several turns solved a problem adjacent to, but not quite, the one you actually asked about.
Signs worth watching for, specifically
A few concrete tells that a session has started to lose the thread, worth checking for rather than waiting to feel generally uneasy about a session's output: answers that restate something already established several turns ago as if it were new information, growing vagueness in responses that were previously specific and concrete, or small factual inconsistencies between an early turn's stated assumption and a later turn's behavior. Any one of these on its own might be nothing; two or three together in the same session are a reasonable trigger to stop and consider a reset rather than continuing.
Why this isn't really a model-quality complaint
It's tempting to read session drift as evidence a model "isn't very good," but the same pattern shows up across different models at different session lengths, which points at the mechanism — a growing context diluting the weight of earlier, more specific information — rather than at any one model's particular limitations. A smaller, sharper context reliably produces better results than a larger, messier one on the same underlying model, which is the practical reason this whole page is about managing session size rather than about picking a supposedly smarter model to fix a structural problem a different model choice won't actually solve.
The cost side of a drifted session, briefly
A session that's drifted long enough to be losing the thread is also, in most cases, a session that's accumulated a meaningfully large amount of input — which means it's not just producing worse output, it's usually also the more expensive turns in the whole conversation, especially on a model where crossing the long-context threshold reprices the full request. Catching drift early and resetting is very often a cost optimization as much as a quality one, even though it doesn't always get framed that way.
Verified 2026-08-09 against CodexHow facts module (src/data/facts/) — see /about/#accuracy.