`shell_snapshot=true` breaks rc handling such as `direnv`, affecting ability to use Codex app's worktrees

Resolved 💬 1 comment Opened Feb 9, 2026 by lgo Closed Feb 9, 2026

What issue are you seeing?

When shell_snapshot=true, various load-bearing capabilities no longer work. For example:

  • When using the Codex app, there is no way to automatically setup worktree/session-scoped environment variables without direnv
  • direnv does not work or is not evaluated w
  • This is often important for python projects, which need to scope a virtual environment for a worktree

While I'm sure this is a problem more broadly with the app-server / session scoping, this is particularly annoying a problem with the Codex app where you can't simply setup a shell session before running codex (cli) that has the correct env setup.

What steps can reproduce the bug?

Setup environment.toml

# .codex/enviroments/personal-joeyp.toml
version = 1
name = "joeyp"

[setup]
script = '''
#!/usr/bin/env bash
set -euo pipefail

echo 'export FOO=BAR' > .envrc
direnv allow
'''
# ~/.zprofile

# ensure direnv hooks are installed
eval $(direnv hook zsh)
# paranoid "evaluate now with pwd"
direnv export zsh

Then, with shell_snapshot=true, the shell snapshot will not have FOO=BAR. Without it, the worktree sessions will be able to observe it.

What is the expected behavior?

_No response_

Additional information

This feels like more of a general pain with the Codex app. I'd like to be able to setup worktree-specific session envrionment variables, but it's not apparent that's possible without the means of a more complicated shell setup like direnv so the app's worktree support isn't as "batteries included"

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗