How to clear context in Codex?

To clear context in Codex, type /clear and press Enter in the Codex CLI; it clears the terminal, resets the visible transcript and starts a fresh chat in the same session.

As of December 4, 2026, OpenAI’s Codex command reference describes these options:

  • /clear: starts a new chat with empty context. You can name it as you create it, for example /clear release prep.
  • /new: also starts a fresh chat in the same CLI session, but does not clear the current terminal view first.
  • Ctrl+L: only clears the terminal view and keeps the current chat, so it does not reset context. Codex disables both /clear and Ctrl+L while a task is in progress.
  • /compact: keeps the chat but replaces earlier turns with a concise summary after you confirm, freeing context space.
  • /resume: reopens a saved chat later if you need the earlier context again.

Related: How to check context usage in Codex?, How to change the model in Codex? and What is the Codex context window?

Source: ChatGPT Learn, Codex developer commands

Image: ChatGPT logo by OpenAI, public domain (PD shape), via Wikimedia Commons, placed on a white background and resized. Codex and ChatGPT are trademarks of OpenAI. FreeAnswers is not affiliated with or endorsed by OpenAI.



Related answers

Leave a Comment