Skip to content

Why Is Codex Using So Many Tokens? 7 Things to Check

· Pedro Villaca

Quick answer

Codex usage includes more than your prompt. Instructions, conversation history, file content, tool results, and model output can all contribute. Start with session usage, then check repeated work, reasoning effort, and subagents. Compare completed tasks, because a smaller request can still produce more retries.

Download Halv for Codex

A short request can start a long coding workflow. Your agent may inspect files, run commands, interpret failures, and revise its patch. Each step can add input or output usage.

This guide diagnoses Codex coding sessions. Ordinary ChatGPT conversations have a different interface and may use different tools.

First, identify what your usage number means

Open /status in Codex CLI to inspect session usage and context capacity. Use /usage for account activity. These views answer different questions. Context capacity describes the current working context; cumulative usage describes work across requests. See the official Codex command reference.

Also record whether you use a subscription, purchased credits, or API billing. A token count alone does not establish a dollar charge. OpenAI documents these distinctions in Codex pricing.

Check these seven sources of usage

Check Evidence to look for First change to try
Long conversation Many unrelated tasks share one thread Start a separate chat for the next task
Repeated file reads The agent opens the same unchanged files Provide the relevant paths and known findings
Large command results Full logs hide a small failure Request the failing section and its context
Broad instructions Repository guidance includes unrelated procedures Keep shared rules short and scope specialist guidance
Reasoning effort Simple work uses a demanding configuration Try a lower supported effort on a comparable task
Tool configuration The session exposes irrelevant tools Disable one irrelevant integration and compare
Delegation and retries Workers repeat discovery or failed work Count all threads and remove duplicate assignments

1. Separate unrelated work

A session that combines deployment, design, debugging, and research accumulates context with different purposes. Start a new chat when the objective changes substantially. Preserve the task brief and necessary decisions if the new task depends on earlier work.

Do not reset a productive investigation merely because the context meter looks large. The compact versus new guide explains that tradeoff.

2. Give the agent a search boundary

Compare two requests:

Investigate the authentication code.
Inspect src/auth/session.ts and its callers.
Find why an expired session reaches the dashboard.
Verify the fix with the existing session tests.

The second request names the failure, likely files, and completion check. It still permits investigation when those files do not explain the problem.

3. Keep useful command output

A complete build log can contain much more text than the actual failure. Ask for the failure message, surrounding lines, and command exit status. Keep the full log available when the excerpt does not explain the failure.

Halv includes RTK command filtering and Crux code navigation to support this workflow. Download Halv and try it on your next debugging task.

4. Audit persistent instructions

Keep test commands, important constraints, and repository conventions. Remove repeated explanations and instructions that apply to unrelated projects. Use the AGENTS.md guide to check discovery and measure a proposed reduction.

5. Match effort to the task

Higher reasoning effort can increase usage and response time. It can also improve results on difficult work. Use a supported setting and evaluate the result before changing your default. The official model and effort guidance explains this distinction.

A cheaper failed patch is not an improvement if the next attempt consumes the saved budget.

6. Inspect tools without assuming a fixed tax

MCP cost depends on the client, tool discovery, server instructions, and returned content. Counting configured servers does not reveal the complete cost. The MCP context guide gives a controlled comparison procedure.

7. Include every agent and retry

A coordinator can look inexpensive while workers perform most of the work. Record their usage separately, then calculate the combined total. Include unsuccessful attempts and the coordinator’s integration work.

Run a useful before-and-after check

  1. Select a task with an existing acceptance test.
  2. Record the repository revision, model, effort, tools, and client version.
  3. Run the baseline from an isolated checkout.
  4. Change one configuration choice.
  5. Run the same task from an equivalent checkout.
  6. Compare test results, total usage, cost basis, and elapsed time.

Repeat the comparison before making a general claim. One run can change because model output varies. Keep environment failures separate from model failures, and explain any excluded runs.

What Halv has actually measured

Our published SWE-rebench report compares Codex with and without the Halv toolkit across 20 task pairs. The report includes configuration, verifier outcomes, and downloadable evidence. It measures the combined toolkit, not the savings from any individual tip above.

For a broader checklist, read how to save tokens in ChatGPT and Codex. For allowance questions, read Codex usage limits.

Sources and scope

Official documentation checked on September 28, 2026. This article provides a diagnosis method, not a new benchmark result.

How to Reduce ChatGPT Usage

Reduce avoidable ChatGPT usage with focused chats, relevant files, controlled tools, shorter outputs, and the right workspace for coding.

How to Reduce Claude Usage

Reduce Claude and Claude Code usage with smaller context, focused Projects, clear model choices, controlled tools, and complete measurement.

Give your coding agent less noise.

Halv combines command output filtering, context compression, and code navigation in one desktop workspace. Try it on a task you can verify.

JEV agent routing is included in your Halv subscription, with no separate routing fee. Your agent subscriptions remain separate.

7 days free. Then US$10/month. Card required. Cancel in two clicks.

Frequently asked questions

Why does a short Codex prompt use many tokens?

Your prompt is only part of the input. Codex also uses instructions, relevant history, tools, and retrieved content. Model output adds usage too.

Does high token usage mean my ChatGPT bill increases?

Not necessarily. Subscription allowances, credits, and API billing use different accounting. Check your account usage before converting token counts into money.

Will starting a new Codex chat always save tokens?

No. A new chat removes the previous conversation context, but the agent may need to repeat useful investigation. Compare the full task cost.

Should I remove every tool to reduce token usage?

No. A useful tool can prevent repeated searches or mistakes. Remove irrelevant tools, then check whether the agent still completes the task correctly.