Skip to content

Instantly share code, notes, and snippets.

@Vaibhavs10
Created April 4, 2026 17:23
Show Gist options
  • Select an option

  • Save Vaibhavs10/03d2d518f9a58796e050dba97c2c2f47 to your computer and use it in GitHub Desktop.

Select an option

Save Vaibhavs10/03d2d518f9a58796e050dba97c2c2f47 to your computer and use it in GitHub Desktop.
keep-going-codex.md

Auto “Keep going” in Codex 1. Enable hooks in ~/.codex/config.toml.

[features] codex_hooks = true

2.	Add a Stop hook in ~/.codex/hooks.json.

{ "hooks": { "Stop": [ { "hooks": [ { "type": "command", "command": "python3 ~/.codex/hooks/keep_going.py", "timeout": 30 } ] } ] } }

3.	Create ~/.codex/hooks/keep_going.py.

#!/usr/bin/env python3 import json import sys

payload = json.load(sys.stdin)

Prevent an infinite loop on the continuation turn.

if payload.get("stop_hook_active"): print(json.dumps({"continue": True})) raise SystemExit(0)

print(json.dumps({ "decision": "block", "reason": "Keep going" }))

4.	Make it executable.

chmod +x ~/.codex/hooks/keep_going.py

5.	Run Codex.

When GPT-5.4 finishes a turn, the Stop hook sends "Keep going" back as a continuation prompt, so Codex keeps working automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment