AI for Coding
How to Fix Codex Usage Limits: 7 Token-Saving Methods, Verified

Image: Flickr / Wikimedia Commons / Unsplash

How to Fix Codex Usage Limits: 7 Token-Saving Methods, Verified

Seven popular Codex token-saving tricks, checked against benchmarks and OpenAI's own docs, so you know which ones actually move the needle.

August 3, 202625 minutes

Codex usage limits are now measured in tokens, not messages, and the agent loop that makes Codex useful is also what burns through them fastest. This guide checks seven widely shared Codex token-saving methods, from switching to GPT-5.6 Luna at Extra High reasoning to the Caveman skill, against real benchmarks and OpenAI's own documentation, so you can see which ones are genuinely verified and which are marketing math.

Why Codex eats through usage limits faster than you'd expect

Save codex limits

Codex does not work like a single chat completion. Every task runs an agent loop: Codex reads files, runs commands, reads the output, and decides the next step, and the context window grows with every iteration. A moderately complex task can end up costing three to five times what a single exchange would suggest, because each new call re-sends the accumulated context plus whatever new tool output just came in.

Since April 9, 2026, both the 5-hour and the longer secondary window on Plus and Pro plans are measured in tokens consumed rather than message count, so a task that leans on heavy reasoning burns through the cap faster than the number of messages implies. The model you route a task to has an outsized effect here: the same task description can cost roughly 13x more in credits depending on which model runs the loop, before you change anything else about how you work.

Route execution work to Luna at Extra High, not Terra or Sol

Codex 5.6 luna

This is the highest-leverage change on this list, and it holds up under independent testing, not just a single blog's numbers. Codex CLI's current model family is GPT-5.6 Sol, Terra, and Luna: Sol is the most capable and most expensive, Terra sits in the middle at roughly half Sol's price, and Luna costs about a fifth of Sol's price. Each model also has a reasoning effort dial, from minimal up to Extra High, with a Max tier reserved for Sol.

The default advice from Codex's own team is to start most tasks on Luna and only escalate to Terra or Sol when the agent stalls or loses the thread. What independent testers have added on top of that: running Luna at Extra High reasoning, rather than Terra at High, for execution and subagent work delivers close to the same output quality at roughly 1.3x the speed and 2.5x lower cost. On long-horizon coding benchmarks, Luna at Max reasoning has matched a prior-generation Sol model at Extra High reasoning while costing about 13.75x less.

Set a persistent default in Codex's config file so you're not toggling this every session:

# ~/.codex/config.toml model = "gpt-5.6-luna" model_reasoning_effort = "xhigh"

Keep manually escalating to Terra or Sol, at High or Max reasoning, for the tasks where a wrong early step would cost the whole session: architecture decisions, planning, and gnarly debugging. Reserve xhigh and max for genuinely hard problems, since higher reasoning effort costs several times more tokens regardless of which model runs it.

Start a new chat every 15 to 20 messages

Codex new chat

This one is verified and it is the cheapest fix on this list, because it costs nothing to set up. Every message in a Codex session carries the full conversation history back into the model's context, so token cost per message climbs as the session goes on. One benchmark tracking this found that by message 30, a session is paying roughly 31 times what message 1 cost, purely from re-sending accumulated context.

The 15 to 20 message range is not an arbitrary number. Past roughly 60 percent of the context window, output quality measurably degrades because the model is wading through stale conversation instead of focusing on the current task. Codex CLI's own knowledge base makes the same point about compaction: a session at 95 percent context capacity with several compactions behind it produces worse output than a fresh session with focused context, even before you hit a hard limit.

Use /plan to write plan.md, then implement in a clean thread

Codex plan mode

Codex's Plan Mode is a read-only state: Codex explores the repo and drafts a step-by-step plan but does not edit or run anything until you approve it. Before Plan Mode existed, Codex engineers approximated the same workflow manually with a plan.md file: a markdown document holding the architecture plan, an atomic todo list, and session recovery notes, written before any code gets touched.

The reason this pairs with new-chat hygiene from the previous section is architectural, not just habit. Plan Mode's fresh-start option drops the planning conversation entirely when you move to implementation, so the implementation thread inherits only what you explicitly hand it, typically a reference to plan.md, instead of carrying the full back-and-forth of how the plan got decided. Planning conversations tend to be verbose and exploratory; implementation doesn't need that verbosity in its context.

Write AGENTS.md once instead of re-explaining the project every session

AGENTS.md

This is a variant of the same principle as plan.md, applied to standing project context instead of a single task. AGENTS.md is the file Codex loads automatically at the start of every session, and putting your persistent project background there means Codex starts with the relevant context already in place instead of reconstructing it from conversation history each time.

The pattern extends naturally to separate files like design.md or product.md when a project has distinct kinds of standing context, architecture decisions in one file, product requirements in another, so Codex loads only what's relevant to reference rather than one bloated file. A useful working rule from senior Codex users: anything you find yourself correcting twice belongs in AGENTS.md or a skill, not in another one-off message.

Convert PDFs to Markdown before uploading, but size your expectations correctly

PDF to markdown

The logic behind this one is sound, but the number you'll see quoted ("90 percent fewer tokens") is usually measured against the wrong baseline. PDFs carry font tables, layout coordinates, and encoding overhead that get tokenized without adding any information the model can use, and stripping that out genuinely reduces tokens. Where the marketing figures inflate the claim is comparing a Markdown file to the raw binary size of a PDF, rather than to the text Codex actually receives after extraction.

Measured against properly extracted PDF text rather than the file itself, one independent test found Markdown saves closer to 25 percent of tokens versus HTML, and can cost more tokens than raw extracted PDF text on a clean, simple document. The realistic range across several independent measurements sits around 30 to 50 percent for typical documents, with the bigger 90-plus percent reductions showing up specifically on scanned or image-heavy PDFs where extraction is messy to begin with. Convert PDFs before uploading them, but expect a meaningful trim, not a tenfold one, on a clean text-based PDF.

If the PDF contains anything sensitive, run the conversion with a local tool instead of a web uploader. Microsoft's markitdown, IBM's docling, and pymupdf4llm all convert PDF to Markdown locally without sending the file to a third party.

Give Codex a knowledge graph instead of raw files (Graphify)

graphify save tokens

Graphify is an open-source coding assistant skill, built for Claude Code but with native integrations across roughly ten AI coding platforms including Codex, that pre-processes a codebase once into a queryable knowledge graph. Instead of Codex running repeated file search and read calls to orient itself, it queries the graph and gets back the specific nodes and relationships relevant to the question.

The savings compound with codebase size. On a corpus of 52 files, the most widely cited benchmark reports roughly 71.5x fewer tokens per query versus a naive read-everything approach. That reduction is not universal, though: on a project small enough that Codex answers questions in one or two file reads, Graphify's own per-query overhead can add tokens rather than save them. The practical threshold is a repo of 20 or more files, or a project where Codex is already running four or more search calls to answer a single question.

The Caveman skill: real, but not the 65% you'll see advertised

Caveman skill save tokens

Caveman is an open-source skill, compatible with Codex among 30-plus agents, that instructs the agent to respond in stripped-down, compressed language: no pleasantries, no hedging, short declarative sentences. Its own ten-prompt benchmark suite reports a 65 percent mean output-token reduction, and the project has become one of the most-starred skills in this category.

An independent paired benchmark run by JetBrains on real coding-agent sessions found a different picture. Forced on across 82 paired tasks, Caveman changed how the agent talked without measurably hurting output quality, but the real-world saving on agentic work came out to roughly 8.5 percent of output tokens and about 10 percent of cost at best, not 65 percent. The gap exists because the tokens that actually dominate a coding-agent session are code and tool call output, which Caveman deliberately leaves untouched. The advertised number describes chat-style question and answer sessions, not agentic coding work.

This is worth installing because it costs nothing and doesn't hurt, but don't count on it to solve a usage-limit problem. Treat it as a small bonus on top of the methods above, not a replacement for them.

Which of these are worth your setup time

Not all seven methods carry equal weight, and stacking every one blindly wastes setup time that could go toward the two or three that actually move your usage limits. Sorted by verified impact:

Biggest verified impact, set these up first:

  • Route execution to Luna at Extra High reasoning instead of Terra or Sol (roughly 2.5x cheaper for comparable output)
  • New chat every 15-20 messages (cost per message compounds to roughly 31x by message 30 in a long session)
  • Graphify, but only on repos of 20+ files (71.5x fewer tokens per query on the benchmark corpus, negative ROI below that threshold)

Real, moderate impact:

  • /plan into plan.md, then implement in a fresh thread
  • AGENTS.md (and design.md / product.md) for standing project context
  • PDF to Markdown conversion (expect 30-50% on clean documents, not 90%)

Marginal, nice to have:

  • Caveman skill (roughly 8.5% real-world saving on agentic tasks, well below its advertised 65%)

Before you trust this workflow to hold your usage limit

Brian Weerasinghe

AI & Technology Researcher

Brian Weerasinghe is the founder and editor of AI Eating The World, where he covers artificial intelligence, tech companies, layoffs, startups, and the future of work. His reporting focuses on how AI is transforming businesses, products, and the global workforce. He writes about major developments across the AI industry, from enterprise adoption and funding trends to the real-world impact of automation and emerging technologies.

Trusted AI LeaderTrusted AI LeaderTrusted AI LeaderTrusted AI Leader
Trusted by 10,000+ builders

The AI brief for people adapting to changes in work

Join readers tracking AI news, workflow shifts, and practical tools they can use to adapt faster.

Free, no spam, unsubscribe anytime.