Automatic hourly ping to keep your 5hr usage windows rolling 👍️
G'day nerds, just sharing what I put together to solve this problem for myself; note that it of course only works while your computer is on.
You can also tweak it to deliberately go off several hours before you start work instead, that might work better for some people. I'm sure I've seen a post about something like this ages ago (like a year), but couldn't get it to come up in a search, so figured I'd make this easier to find!
As I've config'd these below, it'll run a tiny non-interactive Codex CLI ping prompt once an hour, get it to reply with pong, and then kill it if it hangs (that part normally not needed). This still costs some tokens, but with a stripped-down prompt it's fairly cheap, and I found it well worth it to be able to actually use my damn plan when I want to.
In my smoke tests:
default-ish Codex run: ~12,285 tokens
trimmed ping run: ~3,348 tokens
At one run per hour, that's roughly 80k tokens/day for the trimmed version.
Linux (cron)
This installs an hourly cron job. Running it again replaces the previous codex-hourly-ping line instead of duplicating it.
TAG=codex-hourly-ping
BIN=$(command -v codex) || exit 1
CMD="0 * * * * mkdir -p /tmp/codex-hourly-ping && \
timeout --kill-after=10s 20s $BIN exec \
--ephemeral \
--ignore-user-config \
--ignore-rules \
--skip-git-repo-check \
--disable plugins \
--disable apps \
--disable tool_suggest \
-m gpt-5.5 \
-c 'model_reasoning_effort=\"low\"' \
-c 'instructions=\"Reply only with the single word pong. Do not run commands or take any other action.\"' \
-c include_permissions_instructions=false \
-c include_apps_instructions=false \
-c include_collaboration_mode_instructions=false \
-c include_environment_context=false \
-c 'skills.include_instructions=false' \
-C /tmp/codex-hourly-ping \
\"Reply with exactly: pong\" \
>/dev/null 2>&1 # $TAG"
(crontab -l 2>/dev/null | grep -v "$TAG"; echo "$CMD") | crontab -
Remove it later with:
crontab -l | grep -v codex-hourly-ping | crontab -
macOS
macOS cron works, but stock macOS does not ship GNU timeout. The easiest option is to install GNU coreutils with brew install coreutils and replace timeout with gtimeout (once, on the fourth line). The removal command is exactly the same as the Linux one.
Windows (PowerShell)
On Windows, Task Scheduler is the practical equivalent to using cron. This creates the hourly scheduled task and uses PowerShell to kill Codex if it runs longer than 20 seconds.
$task = 'CodexHourlyPing'
Unregister-ScheduledTask -TaskName $task -Confirm:$false -ErrorAction SilentlyContinue
$pingScript = @'
New-Item -ItemType Directory -Force "$env:TEMP\codex-hourly-ping" | Out-Null
$codex = (Get-Command codex -ErrorAction Stop).Source
$codexArgs = @(
'exec'
'--ephemeral'
'--ignore-user-config'
'--ignore-rules'
'--skip-git-repo-check'
'--disable','plugins'
'--disable','apps'
'--disable','tool_suggest'
'-m','gpt-5.5'
'-c','model_reasoning_effort="low"'
'-c','instructions="Reply only with the single word pong. Do not run commands or take any other action."'
'-c','include_permissions_instructions=false'
'-c','include_apps_instructions=false'
'-c','include_collaboration_mode_instructions=false'
'-c','include_environment_context=false'
'-c','skills.include_instructions=false'
'-C',"$env:TEMP\codex-hourly-ping"
'Reply with exactly: pong'
)
$p = Start-Process -FilePath $codex -ArgumentList $codexArgs -WindowStyle Hidden -PassThru
if (-not $p.WaitForExit(20000)) { try { $p.Kill($true) } catch { $p.Kill() } }
'@
$encoded = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($pingScript))
$actionArgs = @{ Execute = 'powershell.exe'; Argument = "-NoProfile -WindowStyle Hidden -EncodedCommand $encoded" }
$action = New-ScheduledTaskAction @actionArgs
$triggerArgs = @{ Once = $true; At = (Get-Date).Date; RepetitionInterval = (New-TimeSpan -Hours 1); RepetitionDuration = (New-TimeSpan -Days 3650) }
$trigger = New-ScheduledTaskTrigger @triggerArgs
Register-ScheduledTask -TaskName $task -Action $action -Trigger $trigger -Force
Remove it with:
Unregister-ScheduledTask -TaskName CodexHourlyPing -Confirm:$false
Generic command
If you already have a scheduler, you can just stick the actual command in there, though this doesn't handle killing it:
mkdir -p /tmp/codex-hourly-ping && codex exec --ephemeral --ignore-user-config --ignore-rules --skip-git-repo-check --disable plugins --disable apps --disable tool_suggest -m gpt-5.5 -c 'model_reasoning_effort="low"' -c 'instructions="Reply only with the single word pong. Do not run commands or take any other action."' -c include_permissions_instructions=false -c include_apps_instructions=false -c include_collaboration_mode_instructions=false -c include_environment_context=false -c 'skills.include_instructions=false' -C /tmp/codex-hourly-ping "Reply with exactly: pong" >/dev/null 2>&1
It can be bloody frustrating to sit down and get cooking, then hitting a stupid limit that doesn't reset for another 3.5hrs - cause it didn't start counting down until you sent the first prompt that morning 😝 Hopefully this can help you avoid some of that!
Edit: Changed it to 5.5 since I just saw 5.4 might not be available much longer
Triggered an account moderation thingy from copied solution comment
G'day, I've had my (this) account flagged/moderated because I copy+pasted the solution to a problem (how to access account resets via commandline) in a number of (5) related r/codex threads which were asking specifically for that answer, trying to be helpful. Since then a number of my comments have been hidden automatically as soon as they're submitted. This usually seems to occur when there's an attachment or link, but plain comments have also been inst-deleted, despite not violating any Reddit or subreddit rules. The standard Appeals page says I can't lodge anything as my account's not restricted, but clearly I've pissed off the automated detection lol
To be clear, these comments remain visible to me, but invisible to anyone else, or a logged out user. This is not specific to individual subs, and there's no pattern to content I can identify.
Any ideas as to how long this heightened level of scrutiny on the account normally lasts? It's only been a day, and having to open a private browsing window every time I make a comment is getting old pretty fast. Thanks for any info you can provide.