Skip to main content

Run Codex in a pty and automatically continue after usage-limit resets

Project description

codex-continue

Expect-style wrapper that automatically sends a "Continue" message to Codex CLI after your usage limit resets.

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.

Publishing

Build and upload:

pipx install build twine
python -m build
python -m twine upload dist/*

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_continue-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_continue-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file codex_continue-0.1.0.tar.gz.

File metadata

  • Download URL: codex_continue-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codex_continue-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd55c2383715436451cdcef8e1dab1d3ee9eeb179b131008cdb8a63c2cdc3e9b
MD5 61109f5397696bf0e72836cdc7b60138
BLAKE2b-256 71a75f8ff2a3f1b719ad64d764cb26f198bde08b35909f4e9325043a616ef88d

See more details on using hashes here.

File details

Details for the file codex_continue-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: codex_continue-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codex_continue-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80e8d5afb0522060436194140be5f5ce227c5d68fb218a59bb9f5d246bad39e7
MD5 7ddebe68d4a8134c417236daaf65e1a4
BLAKE2b-256 754400bb04fa80027f982a9c29a4ff312276fd629a8f3c0abfb855b91e38e95a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page