Keeping an Agentic Session Under the 272K Line
The 272K line isn't a number you hit deliberately — it's one an agentic session drifts toward gradually, turn by turn, unless something is actively watching the running total. This page is about the watching, not the rule itself, which is covered in more depth elsewhere on this site.
Why "keeping under" is a session-management problem, not a pricing one
Once you understand that the threshold reprices the whole request rather than the marginal tokens over it, the natural next question isn't "what does crossing it cost" — that's answered elsewhere — it's "how do I actually avoid crossing it without giving up the long context that makes agentic sessions useful in the first place." That's a session-management problem: what to keep, what to trim, and when.
Checking the running total, not just noticing a slow response
A session that's approaching the threshold doesn't announce it — it just keeps working, turn after turn, with the accumulated input quietly growing in the background. Checking a session's actual accumulated size against the context-window planner at natural breakpoints — after a big file read, after a long tool-output turn — is a more reliable signal than waiting to notice a subjectively "slow" or "expensive-feeling" turn, which isn't a number you can act on precisely.
What's actually safe to trim
Tool output from several turns ago that's already been acted on, verbose logs or test output beyond the specific failure that mattered, and file contents read early in a session that are no longer directly relevant to the current step are all reasonable candidates to summarize or drop rather than carry forward verbatim. What's risky to trim: anything the model is still actively reasoning against, or context establishing constraints that apply to the rest of the session — cutting those to save space can produce a result that's technically smaller but has quietly lost track of a requirement it needed to keep respecting.
Summarizing instead of accumulating
Rather than letting a long session's context grow purely by addition, periodically asking Codex to summarize what's been established and done so far — then continuing from that summary rather than the full verbatim history — is a direct lever on where a session sits relative to the threshold. This costs a turn to do the summarizing, but a well-written summary is dramatically smaller than the history it replaces, and it's often clearer too, since it drops the false starts and back-and-forth along the way.
Splitting instead of stretching
If a task's natural shape is genuinely large — a big refactor, a wide-reaching investigation — the fix isn't always to trim a single session harder; sometimes it's to split the task into the smaller, better-scoped steps this site covers separately, each with its own fresh, small context rather than one session accumulating everything. A task that's hard to keep under the threshold in one session is sometimes a sign the task itself should have been broken up before it started, not mid-way through.
A habit worth building into the workflow itself
For any recurring agentic workflow — not just a one-off session — building a context check into the process itself, rather than relying on remembering to look, is worth the setup. A CI step or wrapper script that checks accumulated input size against the threshold before sending the next turn, and trims or summarizes automatically when it's getting close, turns "keeping under the line" from a manual discipline into something the workflow enforces on its own.
When crossing it is actually the right call
None of this is an argument that crossing the threshold is always a mistake — a task that genuinely needs the full accumulated context to reason correctly, and where the higher rate is a real, acceptable cost for a correct result versus a cheaper but wrong one, is a legitimate reason to cross it deliberately. The goal is making that a decision, made with the cost visible ahead of time, rather than something that happens to a session by accident partway through.
A simple rule of thumb for long sessions
Check the running total after any turn that involved reading a genuinely large amount of new material into context — a big file, a large diff, a verbose tool output — rather than on a fixed schedule of every N turns. The threshold gets crossed by volume, not by turn count, so a session with several small turns in a row is lower risk than one with a single turn that just read in a large file, even if the small-turn session has technically run longer.
Why this is worth a dedicated page rather than folding into the general rule
The mechanics of the 272K rule — what it is, why it's a cliff rather than a ramp — are genuinely important to understand once. What's harder, and worth its own separate treatment, is the ongoing discipline of actually managing a live session against that rule turn after turn, which is a different skill from understanding the rule in the abstract. Knowing the cliff exists doesn't automatically stop you from walking into it mid-session; watching the running total is the habit that actually does.
Building the habit into how you start every long session
The easiest time to think about this is before a long session starts, not partway through one that's already grown large — deciding upfront that a task looks likely to accumulate a lot of context, and planning checkpoints for summarizing or trimming from the outset, is far less disruptive than realizing mid-session that a turn just pushed the running total uncomfortably close to the line with no plan in place for what to do about it.
Verified 2026-08-09 against https://developers.openai.com/api/docs/models/gpt-5.6-sol.
Could not confirm: Whether the rule applies to gpt-5.3-codex, gpt-5.5-pro, gpt-5.4-mini or gpt-5.4-nano. Their model pages carry no long-context note, and absence of the note is not evidence the rule does not apply — so this site states it for the six models that publish it and stays silent for the other four.
Checked: https://developers.openai.com/api/docs/models/gpt-5.6-sol · https://developers.openai.com/api/docs/models/gpt-5.3-codex · https://developers.openai.com/api/docs/pricing