Context window size at launch should approximate effect of `AGENTS.md`

Resolved 💬 4 comments Opened Nov 22, 2025 by guidedways Closed Jan 14, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.63.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.1-codex-max ex high

What platform is your computer?

macOS

What issue are you seeing?

Context window size displayed 100% at launch, then suddenly 95% after the first message - it seems the AGENTS.md consumed 5% but this wasn't immediately obvious at initial lunch without first sending a message

What steps can reproduce the bug?

Uploaded thread: 019aaa37-ec3e-73e2-a25c-35b7b598f82c

  • Create a large AGENTS.md
  • Start codex
  • It says 100%
  • Type 'Hello'
  • Context window drops to 95% (my AGENTS.md is 40kb)

At launch:
<img width="1088" height="652" alt="Image" src="https://github.com/user-attachments/assets/a4a4b5cc-eb27-4caf-acc8-9d5957de23a0" />

After first message:
<img width="956" height="884" alt="Image" src="https://github.com/user-attachments/assets/48f39c18-ac01-47c4-af1d-c8dd08e3f03a" />

What is the expected behavior?

At launch the remaining context window size should be accurate, should reflect how much space has been consumed already by AGENTS.md

Additional information

_No response_

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 9 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #7131
  • #4887
  • #4179

Powered by Codex Action

etraut-openai contributor · 9 months ago

The AGENTS.md contents are included as part of the first message sent to the model. It wouldn't be accurate for the context window size to reflect a value less than 100% until after the first message is sent. Prior to sending the first message, the CLI has no way to determine the context window consumed that will be consumed by AGENTS.md. Tokenization and context window accounting are done server-side.

guidedways contributor · 9 months ago

@etraut-openai agreed, I understand it's rather wasteful to send out a message at launch just to have a more accurate context count showing up front, which is why even if it's an approximation - that would help.

Right now it's jarring and confusing to see a 5% drop on Hello. Context window percentage just needs to be closer to being accurate at different times (from launch onwards) because it truly helps with how one interacts with codex. For instance, if I see a ~5% drop at launch (without my first message) I'll know something's off (if that wasn't expected) and can fine-tune AGENTS.md or anything else such as an MCP server that's connected and consuming a lot of space.

etraut-openai contributor · 7 months ago

This feature request has received only one upvote, so I'm going to close it.