Free

How to reduce Codex context and check usage

Give Codex the files a task needs, then compare answer quality and available usage on the same example. Check context size without assuming token savings.

Instructions

Start with one bug. For example, a form loses entered text after a server responds with 503. The agent needs the form handler, server request, related state and failure description. A full history of every past change may not help.

Step 1. How to Choose the Right Files

Describe the task’s expected behavior. Ask for a short list of files with an explanation of why each is needed.

Compare the list with the code. If the cause may be in a neighboring module, include it. Preserve task constraints: which data and project parts cannot be changed.

Step 2. Which metrics not to confuse

Context usage shows how much of the current conversation window is occupied. It is separate from your account usage limit. A new chat separates a new task but does not restore usage already consumed.

Check subscription limits in your account usage section. Also see reset time. Consumption depends on model, task complexity, tools, and conversation history, so the same number of messages does not mean the same consumption.

Step 3. How to compare two options

Use the prompt below to ask Codex to compare the options. Start each option in a separate copy of the same initial state. Keep the model, settings, task and result criteria identical.

Option A may get a full log; option B: failure description and related files. After each run, record whether the error was fixed, how many fixes were needed, and what consumption metric is available.

Record the available usage metric, measurement time and correction costs before and after each option. Mark unavailable costs as “unknown” and record external charges separately. Repeat the comparison under comparable conditions if a limit resets or other account tasks run during measurement.

Step 4. What to check with high consumption

Clarify the task: what is broken, what the result should be, and which files relate to the problem. Specify the needed response volume. A long retelling of changes made is not always necessary.

Keep only the MCPs needed for the task connected. Their descriptions add context. Do not disable tools without which the agent cannot verify the result.

Step 5. When not to shorten context

Do not remove info that affects decisions: access limits, behavior agreements, file links, and current test results. For a large task, better first make a map of needed project parts.

One successful run provides an observation. To conclude repeatability, several comparable runs are needed. For this material, comparative experiments and savings percentages have not yet been obtained.

What you will have

The task has a smaller set of relevant files, with answer quality and available usage compared on the same example.

Next: How to continue work in Codex in a new chat..

Prompt for Codex

Paste into your project chat:

Find the source data in the available project and conversation and fill in the bracketed fields yourself. Ask me about any unknown goals, preferences or sources; do not invent them.
Reduce the context for this task: [task]. Find the necessary files, leave out unrelated material and retain current decisions. Compare full and reduced context on the same task, checking result quality and available usage figures. Keep information needed for a correct result.

What to try next

In this guide
Saved