Respect PYTHONDONTWRITEBYTECODE (/ add a way to configure env variables)

Resolved 💬 2 comments Opened Feb 17, 2026 by LoreRizzetto Closed Mar 29, 2026

What variant of Codex are you using?

CLI

What feature would you like to see?

Currently when codex is done developing something it tests if the code works, this often entails as a minimum compiling the code to check if the syntax is valid.
The issue is that it creates __pycache__ directories even though codex itself is ran with PYTHONDONTWRITEBYTECODE=1 (checked with !env | grep PYTHONDONTWRITEBYTECODE).
It would be cool if there was a way to configure the env variables used by codex, either by setting them explicitly or by choosing a subset that will be forwarded from the host environment.

Additional information

__pycache__ is pointless for single execution scripts since it won't ever be used again

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗