You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
codex exec "Create hello world example in hello.py"
# Now we are at a checkpoint, so we fork.
codex exec fork --last
codex exec "Create a similar program in C." resume --last
codex exec "Create a similar program in Javascript." resume --last
Now we decide that the additional programs were not needed, We re-fork.
codex exec resume --parent
codex exec fork --last
Or we could just re-fork with:
codex exec fork --parent
The changes implied in above:
Add support for 'exec fork', which creates a new derrived session and exits.
exec fork could allow --last, --parent or a specific session id.
Optional changes would be similar for exec resume:
Allow codex exec resume to work without prompt. Without a prompt, it would just reset the current session (if needed) and exit.
Allow --parent to be passed to exec resume.
The above allows forking at some checkpoint, and going back to that checkpoint non-interactivly, without determining session id's.
As an alternative to using --parent, codex could expose /status as 'codex exec status'. This could allow:
parent=$(codex exec status | grep 'Forked from:' | sed 's/.*: *//')"
Additional information
No response
Reacted by Taine Zhao, Axiomniscion369, invidious9000, ToddMeng, Nil Mamano, Yurii Karabas, Luke and Virgil King
Activity
github-actions commentedon Jan 28, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
dmahurin commentedon Feb 3, 2026
Until fork, status and other commands are available with exec, a crude workaround is to run codex in a pty and run the slash commands.
You can use this to run codex commands non-interactively. It is currently specific to codex.
https://github.com/dmahurin/pty-runner
Examples:
pty-runner codex ... /status /exit
pty-runner codex ... /fork /status /exit
etraut-openai commentedon Mar 20, 2026
This feature request hasn't received enough upvotes, so closing.
btomaj commentedon Jun 20, 2026
@etraut-openai has this received enough upvotes now across #10106, #17568, and #11750 ?
etraut-openai commentedon Aug 7, 2026
This will be included in the next release.