OpenAI Codex Automations: How Scheduled Tasks Quietly Drain Your Token Credits
Codex scheduled tasks start a fresh chat every run, re-reading and re-reasoning the whole job from cold — here's the rate-card math, and how to replay the deterministic half at 0 tokens.
- 01Codex scheduled tasks start a new chat on every run — fresh full context, re-billed each time, whether or not anything actually changed.
- 02On gpt-5.3-codex that cold re-read runs roughly $25–$126 a month for an hourly automation at 20k–100k tokens of repo context — before the code-writing output on top.
- 03Record the deterministic checks once, replay them at 0 tokens, and wake Codex only when a check drifts.
Codex automations are a good idea with an expensive default. Rather than wait for you to ask, Codex can run recurring tasks in the background on a schedule. The catch is one line of OpenAI's docs: standalone scheduled tasks start a new chat for each scheduled run. A new chat is a cold context: every run re-reads your repo, re-derives yesterday's plan, and re-runs the same checks — and you pay full token price whether or not anything changed.
This is the Codex chapter of the recurring-agent cost series: the drain from OpenAI's rate card, then the fix, with a real receipt.
1. What a scheduled task re-does every run
The scheduler runs minute, daily, or weekly cadences via an RFC 5545 RRULE. A standalone run is independent by design — no warm session carries context forward, so the model rebuilds it from the repo every run. Most runs conclude what the last did: tests pass, deps current, nothing to do — a full cold-start context to hear it.
2. The math, from first principles
The bill is arithmetic: calls per month × tokens per call × price per token.
| Cadence | Calls/day | Calls/month (30d) |
|---|---|---|
| Daily | 1 | 30 |
| Hourly | 24 | 720 |
| Every 15 min | 96 | 2,880 |
Price per token is published. Codex's current rate-card model, gpt-5.3-codex, is $1.75/M input tokens, $0.175 cached, $14.00 output (OpenAI API pricing, retrieved 2026-07-21). On an API key that is your literal bill; on a ChatGPT/Codex plan those tokens draw credits from the same budget your interactive coding uses.
Tokens per call is the factor people misread. Even a trivial task carries context — the published benchmark below measured a two-step lookup at 18,390 input tokens. A repo-aware coding task carries far more; plug your own in. Input-side cost at the gpt-5.3-codex rate:
| Context/run | Cost/call (input) | Hourly, monthly | Every 15 min, monthly |
|---|---|---|---|
| 20,000 tokens | $0.035 | $25.20 | $100.80 |
| 50,000 tokens | $0.088 | $63.00 | $252.00 |
| 100,000 tokens | $0.175 | $126.00 | $504.00 |
| ✓ Reelier replay · Level 0 | $0.00 | $0 | $0 |
Three honest notes. The table is input only — a code-writing run also pays output at $14.00/MTok, which dominates for a real PR and is near-zero for a read-only check. Cached input's 10× discount only applies to a prefix OpenAI re-sees inside its short cache window, which a new-chat-per-run schedule misses. And the schedule sets the call count, not the work.
Cost is calls × 120k tokens × price on Opus 4.8 at a 15-minute cadence. Level-0 replay re-executes the recorded tool calls: 0 tokens by construction. Source: the tables above and the reelier benchmark.
3. Which half of the job is actually judgment?
The fix applies to only one side of the job. Judgment needs the model every run: deciding what a new test failure means, drafting the code change, writing a PR for a human. Keep paying for that.
Re-derivation is everything else — run the test suite, pull CI status, read the same files, diff the dependency manifest, hit the same API. Same sequence, same shapes, every run. Your automation worked those mechanics out correctly once; every later run pays Codex to re-derive them, with some chance of deriving them slightly differently — tool-call drift wearing the cost problem's clothes.
Most scheduled coding automations are a thin layer of code-writing on a thick layer of checking. Replay the checks for free; wake Codex only when one fails. Honest boundary: Reelier replays tool calls — typed JSON in, typed JSON out — via deterministic replay, not the code-writing itself. If your automation genuinely rewrites source every run, that half stays model work; replay the checks that gate it.
4. Capturing a Codex run, honestly
Here is the part most tools get wrong. Reelier's scanner does list ~/.codex/sessions as a source — but its transcript parser understands Claude Code's Anthropic JSONL schema today, and Codex writes a different format, so a Codex rollout there parses to 0 replayable calls. Honest degradation, not a capture path.
The path that works for Codex is the recording proxy, which captures the MCP calls directly and doesn't care which agent made them:
npx -y reelier mcp --wrap "<your mcp server command>"Run the automation once through it. The proxy records every tool call losslessly; the compiler turns the trace into a SKILL.md. It asserts the steps with a clean recorded result; a step that errored or returned nothing stays assertion-less and replays as unchecked — surfaced as an open question, never silently marked passed. You commit it like any code.
5. The loop: record once, replay on the schedule
npx -y reelier run <job>.skill.md # Level 0: no model constructed, 0 tokens
npx -y reelier diff <job> # SAME or DRIFTED per step — exit 1 on driftLevel-0 replay never builds an LLM client, so the deterministic core costs 0 tokens by construction, not by optimization. It is read-only by default: an idempotent-write step re-fires only with --allow-writes, and a destructive step never without an explicit --yes — so a replay can't re-open a PR or re-send a notification. diff exits 1 the moment an assertion fails or an API changes shape; wire that nonzero exit as the trigger, and Codex only wakes on the run that deserves it. It's also the cheapest way to catch a model-upgrade regression — re-record on the new Codex model and diff against the frozen baseline before it ships. (Same loop for a scheduled Claude Code routine; weighing Codex's own record/replay? See the comparison.)
6. A real receipt
Reelier's install demo closes with this run receipt, verbatim from the project README:
Your receipt: skill: reelier-init-demo steps: 2 total, 2 passed, 0 unchecked, 0 failed replay time: 44ms [measured] LLM tokens: 0 [measured] An agent doing a comparable task re-reasons every run (~2.8s, ~18k tokens on our benchmark). Your replay: 44ms, 0 tokens.
The head-to-head benchmark — same task, same live data — measured 18,390 input tokens/run vs. 0, $0.019068 vs. $0.000000, and 1,000 / 1,000 replays byte-identical, with the 0-token claim asserted from each run record. Latency varies with your network; 0 LLM tokens and the same steps every run do not.
Plug your cadence, context size, and model into the agent cost calculator — the table above at your numbers, replay column pinned at $0. Record the checks once, replay them on the schedule, and pay Codex for judgment, not re-derivation.