acw watches a Codex tmux pane and sends your follow-up prompt after each
completed turn.
It is designed for long-running Codex sessions where you want a stable "continue" loop, but still want to interrupt, inspect, edit the prompt, or recover from tmux problems without losing control of the pane.
- Linux
python3tmuxpstree- Codex CLI
rich is optional. If it is installed, acw status uses the formatted table;
otherwise it falls back to a plain-text summary.
Install from a local checkout with uv:
uv tool install --editable /path/to/codex-auto-continueFrom inside the repo:
uv tool install --editable .After pulling new changes:
uv tool install --editable --reinstall /path/to/codex-auto-continueTo try it without installing:
uv tool run --from /path/to/codex-auto-continue acw --help- Start Codex in a tmux pane.
codex- Check that
acwcan see the pane and thread.
acw doctor- Start the watcher from any shell attached to the same tmux server.
acw start uvm
acw start %6
acw start 2start accepts a pane id (%6), window index (2), session:window
(0:2), or exact tmux window name (uvm).
- Watch the control panel.
acwIf thread discovery is not ready yet, start fails instead of guessing.
If you already know the Codex thread id, pass it explicitly:
acw start uvm 019cb235-bc2c-7920-8832-f2d5656fead8acw Show status
acw status --details Show full watcher details
acw start <target> Start a watcher
acw stop [target] Stop one watcher or all watchers
acw pause [target] Pause one watcher or all watchers
acw resume [target] Resume one paused watcher or all paused watchers
acw restart [target] Restart one watcher or all watchers
acw edit <target> Edit the stored continue prompt, then restart
acw doctor [target] Diagnose tmux, auth, pane, and watcher state
acw cleanup Remove stale watcher files
For all-watcher operations, prefer the no-target forms:
acw pause
acw resume
acw restartQuoted '*' is accepted too, but an unquoted * will be expanded by your
shell before acw sees it.
If you do not pass --message or --message-file, acw start opens $EDITOR
so you can write a multi-line continue prompt. An empty message cancels the
start.
Examples:
acw start %0 --message "continue and focus on tests"
acw start tests --message-file /path/to/message.txt
acw edit testsDefault message file:
~/.codex/auto_continue.message.txt
acw creates that file from the bundled template on first run if it does not
exist yet.
acw status is the main control panel. It shows:
- the live tmux window and pane
- whether the watcher is
running,warn,paused, ordead - when the Codex thread started
- when
acwlast sent a continue prompt - recent visible agent output from the pane
- the stored continue message
Use:
acw status --detailsto see HEALTH_DETAIL, state file paths, watch logs, and the last recorded
event for each watcher.
When the summary table shows a degraded watcher, acw prints a follow-up
recommendation such as:
Recommendation: run acw doctor uvm
User interrupt behavior is intentionally different from real Codex failures.
- Pressing
Escapein the Codex pane skips exactly one interrupted turn. - The watcher stays running.
- After you send your next manual prompt, automatic continue resumes on the next completed turn.
Real Codex error banners still auto-pause the watcher, including:
- authentication failures
- quota / usage limit failures
- similar pane-visible Codex errors
After fixing the problem in the pane, resume with:
acw resume <target>If a watcher process is gone entirely, acw status shows it as dead even if
the last on-disk health snapshot looked healthy.
acw doctor is the first command to run when something looks wrong.
Inside tmux, acw doctor with no target checks the current pane. You can also
target a specific watcher or pane:
acw doctor
acw doctor uvm
acw doctor %6It checks:
- whether
~/.codexis writable - whether Codex auth state exists
- whether the tmux server is reachable
- whether the target pane resolves
- whether a Codex thread is discoverable
- whether a watcher is running, paused, degraded, or dead
It also prints an explicit recommended next command when appropriate.
acw start <target> says could not determine thread_id
- Codex is not fully started yet in that pane, or it is not a Codex pane.
- Wait for Codex startup to settle, then retry.
- If needed, use
acw doctor <target>or pass the thread id explicitly.
acw status says dead
- The watcher process is gone.
- Run
acw restart <target>oracw start <target>.
acw status says warn
- Run
acw doctor <target>. warnusually means degraded but still partially functional, not necessarily dead.
tmux socket disappeared
acwprints a recovery hint when it can identify the tmux server pid.- Recreate the socket with the suggested command, for example:
kill -USR1 1996933The watcher reads ~/.codex/log/codex-tui.log and reacts to Codex completion
events.
Supported completion signals:
- older Codex:
post sampling token usage ... needs_follow_up=false - current Codex:
codex_core::tasks: close
Thread discovery is pane-local. acw maps the pane's live Codex process to the
thread id using the process tree and Codex's local SQLite state. It does not
guess from unrelated global activity.
Canonical watcher/session state is stored under:
~/.codex/acw_session.<thread-id>.json
Watcher processes also record the tmux socket they are using, which avoids pane id collisions between your real tmux server and the isolated real-Codex test harness.
Fast checks:
bash test/smoke.sh
python3 -m unittest test.test_watchd_unit test.test_logwatch_unitReal end-to-end suite:
bash test/test_rollout_e2e.shThe real suite:
- uses a dedicated private tmux server on its own socket
- runs real Codex sessions
- does not touch your existing tmux sessions
- stores failure artifacts under
~/.codex/auto-continue-e2e-tmp/failures/
GitHub Actions runs the fast path on pushes and pull requests:
bash test/smoke.shpython3 -m unittest test.test_watchd_unit test.test_logwatch_unit test.test_real_codex_harness_unit
Current real-Codex coverage includes:
- basic continue delivery
- interrupt skip and auto-resume after the next manual prompt
- manager start for plain
codexpanes - manager start for
codex resume <thread-id>panes doctor,edit,status, dead-watcher reporting, and tmux socket recovery