codex-continue
Expect-style wrapper that automatically sends a "Continue" message to Codex CLI after your usage limit resets or when the selected model is at capacity.
Quickstart:
pipx install codex-continue
codex-continue -- "/goal finish this task"
Background: you have a long task for codex, and a cheap Pro plan. Your task if for fun and you don't want to spend more money on it. But you also don't want to waste your unused plan quotas or your time waiting to click "Enter" when the limit refreshes. This script is for you.
This script waits for a message with the following format to show up:
You've hit your usage limit. Upgrade to Pro (https://chatgpt.com/explore/pro), visit https://chatgpt.com/codex/settings/usage to purchase more credits or try again at 11:42 AM.
When that happens, it parses out the time displayed, sleeps until it is reached and then wakes up and then automatically sends a message which defaults to:
Continue
which should be enough to send Codex on its merry way once again until the next quota is hit and the cycle continues.
Tested on Ubuntu 25.10, Python Python 3.13.7, codex-cli 0.133.0.
Installation
From PyPI:
pipx install codex-continue
Use latest master executable from a clone:
git clone https://github.com/cirosantilli/codex-continue
cd codex-continue
pipx install -e codex-continue
Usage
Run Codex through the wrapper:
codex-continue
Pass an initial prompt to Codex. /goal is recommended, Codex seems to work for much longer with it now:
codex-continue -- "/goal finish this task"
Customize the continuation text:
codex-continue --continue-prompt "Continue exactly where you left off"
When Codex prints a usage-limit message with either an absolute reset time or a relative duration, codex-continue keeps the same Codex process alive, waits until the reset time plus a grace period, then injects the continuation prompt and presses Enter.
It also handles:
Selected model is at capacity. Please try a different model.
For capacity errors, it waits five seconds and sends the continuation prompt in the same session, retrying each time the error appears. Customize this delay with:
codex-continue --capacity-retry-seconds 10
The usage-limit grace period does not apply to capacity retries. The selected model stays the same.
Publishing
Install the publishing tools once:
pipx install build
pipx install twine
Commit your changes, then run the release script from the repository root with a clean working tree:
./release
It runs the tests, increments the minor version and resets the patch version (for example, 0.1.1 → 0.2.0), updates all three version declarations, builds into dist/<version>/, and checks the artifacts. It commits the version bump as Release <version>, uploads only that version's wheel and source distribution, then creates an annotated Git tag named v<version>. It stops on failure and rejects existing tags. The commit and tag stay local; push them when ready:
git push
git push origin "v$(python3 -c 'from codex_continue import __version__; print(__version__)')"
Tests use the Python interpreter running release by default; set PYTHON=/path/to/python to use an environment containing the project's dependencies. The build uses the pyproject-build command installed by pipx.
To build and validate without uploading, committing, or tagging:
./release --no-upload
The bumped version remains in the source files if a build or check fails, and the release commit remains if the upload fails. To retry, or to publish after --no-upload, first commit any pending changes, then keep the current version:
./release --no-bump
PyPI does not allow replacing previously uploaded files, even after deletion. If an upload partially succeeded, upload only the missing artifact rather than rebuilding and replacing the published file.
Twine accepts the PyPI API token through TWINE_PASSWORD, with TWINE_USERNAME=__token__. For Bash, read the token without putting it in shell history:
read -rsp 'PyPI API token: ' TWINE_PASSWORD; echo
export TWINE_PASSWORD
export TWINE_USERNAME=__token__
./release
The same variables work for a direct upload of existing artifacts:
twine upload dist/codex_continue-0.1.1-py3-none-any.whl dist/codex_continue-0.1.1.tar.gz
The script defaults TWINE_USERNAME to __token__; without TWINE_PASSWORD, Twine can prompt for the token. Set TWINE_NON_INTERACTIVE=1 to fail instead of prompting when credentials are missing. See Twine's environment variable documentation.
Metadata
Release files for codex-continue 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| codex_continue-0.3.0.tar.gz | 10.2 kB | Without provenance | Details for codex_continue-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| codex_continue-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for codex_continue-0.3.0-py3-none-any.whl |
Total release size: 18.0 kB
Release files / codex_continue-0.3.0.tar.gz
| Download URL | codex_continue-0.3.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
00cb9f766dd1344d0d19c084d15eebbbaed767ffdf81953c80baeca955029d01
|
|
BLAKE2b-256 checksum How to use checksums |
ee008ce78b0bdd1c9b0222d63ed80865a4e0d7beb981197a96038cf1d3eabb03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / codex_continue-0.3.0-py3-none-any.whl
| Download URL | codex_continue-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5361e394d28a8d244897f58c6d1cba72120401fa7d1cb4fbe6ec14bb4f8a9d82
|
|
BLAKE2b-256 checksum How to use checksums |
a09a2b818c1b8992f2c71d0a32162eba4931546e2cc85112e017f8b243d581ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for codex-continue 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.