Interactive mode silently exits when ~/.codex/rules is a file instead of directory

Resolved 💬 1 comment Opened Jan 14, 2026 by dangirsh Closed Jan 14, 2026

Description

When ~/.codex/rules exists as a file instead of a directory, codex interactive mode exits silently with code 0 and no error message. The error is only visible when running codex exec.

Steps to Reproduce

# Create a file at ~/.codex/rules (instead of directory)
echo "some content" > ~/.codex/rules

# Run codex interactively - exits immediately with no output
codex

# Run codex exec - reveals the actual error
codex exec "echo hello"

Expected Behavior

Interactive mode should display the error message before exiting, matching exec mode behavior.

Actual Behavior

  • Interactive mode: Exits immediately with code 0, no output
  • Exec mode: Shows error:

``
Error: Fatal error: failed to load execpolicy: failed to read execpolicy files from /home/ubuntu/.codex/rules: Not a directory (os error 20)
``

Impact

This makes debugging very difficult when the rules path is misconfigured. Users see codex spawn and immediately exit with no indication of what went wrong.

Environment

  • codex-cli 0.80.0
  • Linux 6.17.0-8-generic

Workaround

mv ~/.codex/rules ~/.codex/rules.bak
mkdir -p ~/.codex/rules

View original on GitHub ↗

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