Adhere to XDG Base Desktop Specification on Linux platforms
Resolved 💬 3 comments Opened Apr 16, 2025 by offsetcyan Closed Oct 19, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator)
responded on this thread — see the highlighted reply below.
The user's home directory is not the place to dump program data, and for future cross-platform compatibility handling this would be inappropriate. Currently Codex stores user data in ~/.codex, however Linux has a popular specification for where to place files of various types (link). In Codex's case, $XDG_CONFIG_HOME/codex/ would be suitable. (more info)
3 Comments
Agreed that this should be configurable, please send a PR, will gladly merge it! Some files written aren't exactly program data, such as the session logs that you might want to inspect as the user or load back at a later time, thoughts on that?
If it's volatile or ephemeral or can ultimately be forgotten, it should go in
$XDG_CACHE_HOME. If it's data that's persisted for whatever reason and up to the program or user to clear up, it should go in$XDG_STATE_HOME. So one of those, depending on how important you think session logs should be - the PR from @crazywolf132 uses$XDG_STATE_HOMEand I also support thatWe've discussed this within the team and decided that for now we will not support this and keep storing data under ~/.codex for the simplicity of the implementation, documentation, when requiring to engage with you all on bug reports and consistency across platforms. We might revisit in the future, but will close this for now.