"Log rotate" CODEX_HOME/history.jsonl
Resolved 💬 3 comments Opened Oct 8, 2025 by bolinfest Closed Nov 15, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex is running?
0.45.0
Which model were you using?
gpt-5-codex
What platform is your computer?
Darwin 24.6.0 arm64 arm
What steps can reproduce the bug?
Currently, CODEX_HOME/history.jsonl grows without bound. If you use Codex a lot, this can get really long. We have seen folks accidentally feed in giant prompts that resulted in this file being gigabytes in size!
What is the expected behavior?
https://github.com/openai/codex/blob/main/docs/config.md#history was meant to have some sort of "max size" option that we honor (similar to how Bash history works).
Note that we do some stuff with advisory locking to ensure only one instance of Codex can write at a time. We also do some [possibly overengineered] work to ensure that each session of Codex CLI sees a consistent history as the user uses up/down to cycle through messages.
What do you see instead?
I see it grow without bound...
Additional information
_No response_
3 Comments
Closing in favor of #6015, which has more upvotes
@etraut-openai not closed
This specific issue was solved via https://github.com/openai/codex/pull/6242.