Codex Context Window: Tokens, Usage, and What Carries Over

The Codex context window is a working budget, not a permanent project memory. Learn how to read usage, prepare for compaction, and continue with a checked handoff.

Updated 5 min read

The Codex context window is the working information budget available to the active model, measured in tokens, small pieces of text. It helps determine how much conversation, instruction, and task material can be available together; it is separate from your account’s usage allowance and the files saved in your project.

The useful question is which information the next action needs. Tools like fenbs keep decisions and progress outside the session, so a restart or change of assistant can begin with a reviewed brief rather than a reconstruction of the whole conversation.

What takes up the working budget?

Your latest request is only part of the material an assistant works from. Instructions, earlier discussion, source excerpts, and tool results can all contribute information. A short request to investigate a bug may lead to substantial reading before the assistant has enough evidence to propose a fix.

OpenAI’s conversation-state guide (opens in a new tab) explains context as a finite token budget that includes input, output, and reasoning. Do not equate a token with a word or a line of code. The AI context window overview introduces the general concept without tying it to one coding app.

A file stored on disk is not the same thing as its contents being available for the current response. Give Codex the relevant location and ask it to inspect the portion needed. A directory containing thousands of files should be treated as material to investigate selectively, not as a promise of complete awareness.

How do you check usage in Codex?

In an interactive CLI session, use the commands available in that client. OpenAI’s developer-command reference (opens in a new tab) documents /status for session configuration and token usage. It also documents /statusline, whose selectable fields include context statistics and rate limits. Interface details can differ between the CLI, editor extension, and desktop app.

Read the label before interpreting a percentage. Context remaining, rate-limit remaining, and cumulative token activity describe different things. A context indicator concerns the current working budget; an allowance indicator concerns permitted use. A large total token count across a session does not mean all that material is simultaneously in the current window.

Check usage after a substantial read or a long tool result, then decide whether another broad read is useful. Do not optimize by removing the evidence required for a safe change. The goal is enough relevant information to act correctly, with a clear route back to sources when details need checking.

Does every Codex session have the same limit?

Do not assume one number applies to every model, client, or configuration. Check the active session and the documentation for the selected model. A model’s published capacity also should not be confused with the amount of task material you can add after instructions and other working information are included.

The configuration reference (opens in a new tab) distinguishes model_context_window, the active model’s context tokens, from model_auto_compact_token_limit, the threshold for automatic history compaction. These describe different controls. Changing a configured number is not evidence that the underlying model supports a larger capacity, so keep settings aligned with supported documentation.

For example, a repository search might return hundreds of matches when you need one handler and its caller. Narrowing that investigation can make the evidence easier to review even with ample capacity left. More available space does not make unrelated results relevant.

What changes when the conversation is compacted?

Compaction reduces the earlier conversation into a smaller representation so work can continue. OpenAI’s best-practices guide (opens in a new tab) says Codex compacts chats automatically. The command reference also documents /compact for explicitly summarizing a long chat to free context.

A compacted conversation should not be your only record of exact requirements or verification. Before a long transition, save what changed, what was checked, what remains open, and the source locations. Afterward, ask the assistant to restate the relevant constraints and next step. Check that answer against the saved record.

Say a change passes a focused test but the full test suite has not run. Preserve that distinction explicitly. “Tests passed” is too broad a handoff and can cause the next session to skip a necessary check. fenbs’s handoff workflow keeps that reviewed state outside the conversation representation.

What carries over when you resume or start again?

Resuming a saved chat and starting a fresh chat are different operations. The documented /resume command reloads a selected conversation, while /new starts a fresh one. Resuming is useful for continuing the same problem, but it should not be treated as unlimited working context or a substitute for checking the current repository state.

Before continuing, verify the working directory, branch or worktree, files already changed, and any running commands. A transcript describes earlier work; it does not by itself prove that the current environment still matches. The Codex CLI on Windows guide covers that setup separately.

OpenAI’s Memories documentation (opens in a new tab) describes local Codex memory as a separate recall layer and recommends keeping required guidance in AGENTS.md or checked-in documentation. Use durable repository instructions for stable project rules and a current work record for changing progress. Review either source when it appears inconsistent with the task.

What should a useful continuation brief contain?

Make your continuation note small enough to inspect and specific enough to continue from. Preserve the facts that would change the next action. Replace vague claims such as “mostly done” with a concrete state and the next check. Keep a reference to evidence instead of copying every line of output.

  • Goal and boundaries: the requested result, permitted scope, and actions still requiring a person’s decision.
  • Current implementation: relevant files and the reason for the chosen approach.
  • Verification: checks actually run, their results, and checks still outstanding.
  • Uncertainty: failed assumptions, unresolved questions, and evidence that needs another look.
  • Next action: where to begin and what would count as progress.

Ask the continuing assistant to read the source again when exact code matters. A summary of a function is not its current implementation. Our ChatGPT and Codex guide covers their relationship; the context-engineering library covers the wider workflow.

How fenbs helps

Keep the working brief beyond the window

Save task plans, Decisions and rules, and Where we left off in fenbs. At the next session, ask your connected assistant to read the project context before inspecting the relevant code. The work record remains available when the conversation changes.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

How to do this with fenbs

  1. Create a free account, then add the project and its active task on your kanban board.
  2. Keep the task plan current as you learn. Record a person’s decisions in Decisions and rules, and put useful findings with source references in project context notes.
  3. Connect Codex using the guide on Integrations. MCP is a standard connection that lets an assistant read and update an outside tool.
  4. Before stopping, save task progress and Where we left off, including verification and the next step. Ask the next session to read that context, check the current files, and explain where it will begin.

fenbs is free for one person, with no credit card. It does not increase Codex’s context capacity or store a complete copy of the repository. A short isolated code question may need only the relevant file; the shared work record is useful when decisions and unfinished tasks must survive sessions.

For a repeatable approach to deciding what to load, use the separate context-management guide. For the mechanics and tradeoffs of shortening conversation history, see context window compaction.

Questions people ask.

Does compacting reset my usage allowance?

No. Freeing working context and restoring an account allowance are different operations. Read the usage indicator and limit message for the kind of allowance involved.

Can Codex inspect code that is no longer in the conversation?

If the relevant files remain available and access permits it, ask Codex to read them again. Provide the path and the question you need answered rather than relying on an earlier recollection.

Should I restart whenever context usage rises?

No. Continue a coherent task while the session is useful. Save a checked handoff before restarting when the work changes direction, the conversation becomes difficult to follow, or you need a fresh starting point.

Is the context indicator a guarantee that instructions were followed?

No. Remaining capacity tells you about a budget, not the correctness of an answer. Check the work against the requirements and the current source files.

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.