Confusing statusline in terms of tokens used vs % context left

Resolved 💬 5 comments Opened Sep 15, 2025 by 3SMMZRjWgS Closed Jan 10, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.34.0

Which model were you using?

gpt-5-high

What platform is your computer?

Windows 11 Pro:

What steps can reproduce the bug?

It's difficult to say for sure how this behavior happens, but if you use Codex CLI to do some research using web research coupled with 'context7' MCP servers searching for package docs, you'll see often times not many tokens used (at least not 400k) and the context left will be 0%. Other times, when you keep running a very long chat (maybe just continue from the research thread), the tokens will keep accumulating, but the % context will become low again.

What is the expected behavior?

I'd expect tokens and % context is linked? if I do codex --resume on a chat, then those tokens used were from the previous chat, and I should start with 0 tokens and 100% context available for the new chat session?

What do you see instead?

If you use Codex CLI to do some research using web research coupled with 'context7' MCP servers searching for package docs, you'll see often times not many tokens used (at least not 400k) and the context left will be 0%.

<img width="262" height="31" alt="Image" src="https://github.com/user-attachments/assets/b71f664b-13d7-4148-b5ff-847c6fe15749" />

Other times, when you keep running a very long chat (maybe just continue from the research thread), the tokens will keep accumulating, but the % context will become low again (see image below).

<img width="260" height="44" alt="Image" src="https://github.com/user-attachments/assets/4a36b5c7-e45c-480e-b67e-4e1f30d61a70" />

or maybe I'm misinterpreting here that tokens are counted cumulatively while % context can be reset? But then I've ran into 1.77m tokens used at suddenly the entire chat session auto terminates. So that's when I found out how long a chat session can keep going.

Additional information

_No response_

View original on GitHub ↗

5 Comments

PrayagS · 11 months ago

+1. In this one thread, it said 58.8k tokens used and 98% context left. Considering its 272k context size, 58.8k is way above 2% and should be ~21%.

EDIT: Sharing the /status from that thread,

📂 Workspace
  • Path: REDACTED
  • Approval Mode: on-request
  • Sandbox: read-only
  • AGENTS files: (none)

👤 Account
  • Signed in with ChatGPT
  • Login: REDACTED
  • Plan: Plus

🧠 Model
  • Name: gpt-5-codex
  • Provider: OpenAI
  • Reasoning Effort: None
  • Reasoning Summaries: Auto

💻 Client
  • CLI Version: 0.36.0

📊 Token Usage
  • Session ID: REDACTED
  • Input: 48,557 (+ 178176 cached)
  • Output: 10,243
  • Total: 58,800
edgardcham · 11 months ago

+1. It's confusing.

<img width="309" height="55" alt="Image" src="https://github.com/user-attachments/assets/b6c9e6ed-f4c5-469a-b5d8-b7960fa3fbc0" />

mlovic · 11 months ago

I assume this is because not all tokens used are kept in the context window? It would be useful to learn how this works.

aiyinyuedejustin · 11 months ago

+1

etraut-openai contributor · 7 months ago

We've fixed many issues in this area since this bug was initially filed, so I'm going to close. If you're still seeing issues, please use the /feedback command to open a new bug report.