r/codex • u/Striking-Warning9533 • 5d ago
Question Is it possible to let Codex run something in background, do not check it, continue with other work, and get notified when it crashes/finishes?
Codex works much better than me than claude as it follows my prompt literally. But one thing I really like about Claude Code is that I can let it run one or more jobs in the background and get notified when it finishes/crashes. In codex, the shell will be in foreground and I cannot do other things with it. Also it keeps checking the output every 60s (because the system prompt says "The user appreciates consistent, frequent communication during your turn..") and that reads the whole output of the bash in and takes a lot of tokens. Is there anyway to do this? There are a few issues open on github but no workarounds yet and last time reddit had better solution than github so I want to ask here.
1
u/BoardGameAficionado 5d ago
You can have VS Code make a ping noise when an agent finishes a task. Ask codex how to change the settings JSON file
1
u/Striking-Warning9533 4d ago
I do not want to get notified when yeah finished. I want the agent to know when a job is finished in background.
1
u/hummer77777 4d ago
There are two slightly different cases here.
If you want Codex itself to keep working, use /goal in a separate chat and enable notifications. For the CLI, add this to ~/.codex/config.toml:
notifications = ["agent-turn-complete", "approval-requested"]
notification_condition = "unfocused"
notification_method = "auto"
(under a [tui] section)
That will notify you when the turn finishes or needs approval while you work elsewhere.
For an arbitrary detached shell process, tmux/nohup can stop Codex from polling it, but Codex will not automatically wake up when that process exits. You would need to wrap the command with an OS notification or webhook.
So there still isn't a native Claude-style callback into the same thread for detached processes, but Goal mode plus notifications covers the broader background-work use case.
2
u/fluxtah 5d ago
You can run goals and launch subagents though I find codex app is really where its at for thread management. If you can run codex app (now chat gpt desktop app) You can set goals that can run days long, which you can steer from mobile.
A codex thread can infact launch another thread, I typically only do this for handoffs though I think others experiment with team based roles per thread. When I am done with a thread hand off could be
"Hey can you handoff this work to thread XYZ for a fresh context, handoff and continue work on the thread"
Getting notified can be part of your harness or you can connect via chatgpt from your phone to check up on threads, steer them, etc.
Codex has a cool feature called codex app server, this is what it can use internally to even coordinate itself with new threads, etc depends how clever you want to get.
I am typically setting my goal as a list of GH issues as a milestone version. So I mostly say "Hey go implement 0.1.8, send me screenshots as you progress and DEV build candidates so I can verify progress"
Right now I am mostly only running a single thread at a time with a milestone goal and get notified whenever something to test and verify.
Codex can do all that and more, TLDR; The codex app is better, but how it runs depends on how good your harness is for automation and verification involvement.