commands like "codex resume `session-id`" do not respect CODEX_HOME

Resolved 💬 5 comments Opened Oct 16, 2025 by fallonou1999 Closed Oct 23, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.46.0

What subscription do you have?

pro

Which model were you using?

gpt-5 high

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

running command CODEX_HOME="XXX" codex resume %session_id% starts a new session with different session id, while config.toml is correctly loaded and session jsonl will be saved to CODEX_HOME(but you can't resume it with previous command)

What steps can reproduce the bug?

1.run CODEX_HOME="XXX" codex
2.exit codex
3.run CODEX_HOME="XXX" codex resume %session_id% (session id is provided by exiting message by codex)
4.a new session starts instead of resuming session in step 1

What is the expected behavior?

when running resume command with CODEX_HOME, correct session could be loaded

Additional information

1.running CODEX_HOME="XXX" codex resume then choose wanted session works
2.related logs
^[[2m2025-10-16T05:24:53.900573Z^[[0m ^[[31mERROR^[[0m Error finding conversation path: 0199e96c-7d0c-7403-bf30-395693cd1788
^[[2m2025-10-16T05:24:57.095886Z^[[0m ^[[32m INFO^[[0m aggregated 12 tools from 3 servers
^[[2m2025-10-16T05:25:01.442102Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:27:33.540101Z^[[0m ^[[32m INFO^[[0m Shutting down Codex instance
^[[2m2025-10-16T05:43:41.451194Z^[[0m ^[[31mERROR^[[0m Error finding conversation path: 0199eb7a-7010-72b2-bc68-c8399e9e182e
^[[2m2025-10-16T05:43:45.345846Z^[[0m ^[[32m INFO^[[0m aggregated 12 tools from 3 servers
^[[2m2025-10-16T05:45:09.291282Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:46:50.482043Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:46:50.218842Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:47:01.119434Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:47:09.088110Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:47:49.256007Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:47:51.297212Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:47:52.100984Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:47:56.316442Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:48:06.972737Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:48:08.892258Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:48:13.797365Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
^[[2m2025-10-16T05:48:20.307741Z^[[0m ^[[32m INFO^[[0m ERR: No such file or directory (os error 2)
3.if there is really a bug in command like CODEX_HOME="XXX" codex resume %session_id%, would any other command have similar issues?

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 10 months ago

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

  • #4703
  • #4791
  • #3817
  • #3856

Powered by Codex Action

Artein · 10 months ago

Same about the Codex extension for VS Code. Without per-project settings, I can't use Codex in VS Code
Have to return to that laggy Android Studio + Codex CLI...
Hope, @tibo-openai, the team will prioritize per-project experience

version: 0.46.0
platform: macOS
environment: Flutter + direnv

The only way to have per-project experience in Codex CLI (Terminal in Android Studio):

  1. Install direnv
  2. Create .envrc file:
export MCP_REMOTE_CONFIG_DIR="$PWD/.mcp-auth"
export CODEX_HOME="$PWD/.codex"
  1. Allow direnv in the project directory
tibo-openai collaborator · 10 months ago

@fallonou1999 Is the CODEX_HOME you are using covered by a .gitignore perhaps? I can reproduce the latter, but not any other issues. Would love more information to get to the bottom of this one.

MarianoFacundoArch · 10 months ago

i can confirm it happens only if the path is in gitignore

fallonou1999 · 10 months ago
@fallonou1999 Is the CODEX_HOME you are using covered by a .gitignore perhaps? I can reproduce the latter, but not any other issues. Would love more information to get to the bottom of this one.

yes I have this in my .gitignore:
.codex/**
!.codex/config.toml