Skip to content

Codex /compact vs /new: Which Saves More Tokens?

· Pedro Villaca

Quick answer

Use /compact to continue the same task with a shorter conversation summary. Use /new when you need a fresh chat. Neither guarantees the lowest total usage: compaction requires work, while a new chat can require repeated investigation. Include that work and the final test result in your comparison.

Try Codex in Halv

The useful question is not which command makes the next context meter smaller. It is which workflow completes your task with less unnecessary work.

OpenAI documents /compact as a conversation summary operation and /new as a fresh chat operation. See the official command reference.

Choose based on the next task

Situation Starting choice Reason
Continue a complex debugging task /compact Earlier findings still matter
Start an unrelated feature /new The earlier conversation has little value
Continue a short, useful conversation Keep the current chat Neither operation may be necessary
Restart after a confused investigation /new with a brief Preserve confirmed facts without every failed approach
Preserve an exact error or requirement Save it before either command A summary may omit exact details

This table gives a decision rule, not a measured savings ranking. The best choice depends on how much useful information the agent would need to recover.

What compaction preserves

Compaction replaces a longer conversation with a shorter summary. That summary can retain the objective, progress, and important constraints. It is not a guarantee that every file excerpt, error message, or decision remains verbatim.

Before a difficult continuation, keep exact requirements in an appropriate project file. For example, a reproduction command belongs with the debugging notes, and an acceptance test belongs in the repository. Check that the agent still understands those requirements after compaction.

What a new chat changes

A new chat removes the previous conversation as the working transcript. It does not mean the next model request contains zero tokens. The agent still needs its instructions, your new request, and any content it retrieves.

It also does not undo changes on disk. Tell the agent which edits already exist and which files it may change. Keep unrelated work protected.

Use this short handoff when the next chat continues related work:

Goal: Fix session expiry handling.
Confirmed cause: The dashboard accepts an expired cached session.
Changed files: src/auth/session.ts.
Remaining work: Add coverage for refresh failure.
Validation: Run the existing session test target.
Constraint: Preserve unrelated dashboard edits.

This example illustrates a brief. It is not a transcript from a measured run.

Why smaller context does not always mean lower cost

Starting again can cause repeated searches, reads, and tests. Compaction can require a summarization request before the task continues. Both workflows can then differ in correctness and retries.

Caching adds another distinction. OpenAI’s prompt caching documentation describes reuse of matching prompt prefixes. Cached input and fresh input can have different prices. A smaller token total alone does not establish a smaller bill.

Do not assume either command preserves or breaks the entire cache in every client version. Use the usage records for your actual run.

Compare the complete continuation

  1. Prepare equivalent repository snapshots at a defined checkpoint.
  2. Save the task, constraints, and expected acceptance test.
  3. Continue one workflow after /compact.
  4. Continue the other after /new with a defined handoff.
  5. Include compaction, repeated discovery, retries, and validation usage.
  6. Record whether each workflow passes the same acceptance test.

Keep the model, effort, permissions, and tool configuration identical. Repeat the comparison across several tasks. Report the sample size and describe what information the handoff included.

Use a results table with these fields:

Field Why it matters
Checkpoint and transcript Establishes equivalent starting information
Handoff text Reveals what the fresh chat received
Input, cached input, output Separates different usage categories
Compaction usage Captures work before continuation
Acceptance result Prevents a failed run from appearing efficient
Total elapsed time Captures the cost of repeated investigation

If compaction usage is unavailable, label the total incomplete. Do not turn missing telemetry into a zero.

Keep the workflow useful between resets

Better file targeting and shorter command results can reduce unnecessary context before either command becomes necessary. Halv combines code navigation, command filtering, and context compression for coding agents. Download Halv and compare a verified task in your own repository.

For the wider diagnosis, read why Codex uses so many tokens. For persistent instructions, read AGENTS.md token usage.

Sources and scope

Official documentation checked on September 28, 2026. This guide does not claim a measured percentage reduction for /compact or /new.

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.

Reduce noise before context becomes a problem.

Use Halv's command filtering and code navigation alongside your Codex workflow. Keep the evidence your task needs and verify the result.

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

What is the difference between /compact and /new in Codex?

/compact summarizes the current conversation. /new starts a fresh chat within the CLI session. Choose based on whether the next step needs earlier decisions.

Does /new remove AGENTS.md instructions?

A fresh chat is not an instruction-free model request. Applicable instructions, configuration, and tools can still contribute context. Check the active setup separately.

Is /compact free?

Do not assume that compaction has no cost. Include any recorded summarization usage when comparing full workflows. Billing depends on your account and provider.

Does /new delete my code changes?

Starting a new chat does not reset your repository. Inspect the working tree before continuing, because existing edits remain relevant to the new task.