claude-code - 💡(How to fix) Fix codex:resume / codex-rescue burned 27% of weekly limit (71%→98%) over ~12h with zero forward progress [3 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54143Fetched 2026-04-28 06:38:05
View on GitHub
Comments
3
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×3

Invoked /codex:review (which forwards to the codex:codex-rescue subagent → codex-companion.mjs task ... --resume-last) on a finished plan. The run spun for ~12 hours and consumed roughly 27 percentage points of my weekly Claude Code usage (71% → 98%), without taking a single forward step on the work. When I returned, the orchestrator was still showing Codex review… (27s · ↓ 85.4k tokens · still thinking) — i.e. the review never produced a verdict, never wrote a finding, never edited a file. The plan it was reviewing was not modified between when codex started and when I killed it.

The screenshot attached shows the state I returned to. Note the bottom status bar: 5h:88% 7d:96% — i.e. weekly cap is on the verge of exhausting purely from this stalled codex:rescue invocation continuing to call out.

Error Message

  • Add a watchdog: if Codex emits no finding within N minutes, kill the wrapper and surface an error to the orchestrator.

Root Cause

Invoked /codex:review (which forwards to the codex:codex-rescue subagent → codex-companion.mjs task ... --resume-last) on a finished plan. The run spun for ~12 hours and consumed roughly 27 percentage points of my weekly Claude Code usage (71% → 98%), without taking a single forward step on the work. When I returned, the orchestrator was still showing Codex review… (27s · ↓ 85.4k tokens · still thinking) — i.e. the review never produced a verdict, never wrote a finding, never edited a file. The plan it was reviewing was not modified between when codex started and when I killed it.

The screenshot attached shows the state I returned to. Note the bottom status bar: 5h:88% 7d:96% — i.e. weekly cap is on the verge of exhausting purely from this stalled codex:rescue invocation continuing to call out.

Fix Action

Fix / Workaround

Mitigation I've taken locally

RAW_BUFFERClick to expand / collapse

Summary

Invoked /codex:review (which forwards to the codex:codex-rescue subagent → codex-companion.mjs task ... --resume-last) on a finished plan. The run spun for ~12 hours and consumed roughly 27 percentage points of my weekly Claude Code usage (71% → 98%), without taking a single forward step on the work. When I returned, the orchestrator was still showing Codex review… (27s · ↓ 85.4k tokens · still thinking) — i.e. the review never produced a verdict, never wrote a finding, never edited a file. The plan it was reviewing was not modified between when codex started and when I killed it.

The screenshot attached shows the state I returned to. Note the bottom status bar: 5h:88% 7d:96% — i.e. weekly cap is on the verge of exhausting purely from this stalled codex:rescue invocation continuing to call out.

Repro context

  • Plugin: codex@openai-codex v1.0.3 (the OpenAI-published Codex companion plugin)
  • Subagent: codex:codex-rescue (defined in plugins/codex/agents/codex-rescue.md)
  • Command path: /codex:review → forwards to node \"\${CLAUDE_PLUGIN_ROOT}/scripts/codex-companion.mjs\" task ... --resume-last
  • Trigger: explicit /codex:review invocation against a finished planning doc (5 markdown files, ~80 KB total)
  • Claude Code: Opus 4.7 (1M context), v2.1.119
  • OS: macOS Darwin 25.4.0

What I'd expect

A review subagent that delegates to an external runtime should either:

  1. Stream incremental findings to the parent so the loop can be detected, OR
  2. Hard-cap on wall-clock / token spend / no-progress watchdog, OR
  3. Surface a clear failure when the underlying Codex CLI hangs

What actually happens: the --resume-last mode appears to keep the polling loop alive indefinitely against a Codex session that's stuck in "still thinking". The wrapper has no upper bound, so it silently incinerates Claude Code quota while doing nothing.

Asks

  • Default --resume-last to off for /codex:review (treat it as fresh per invocation).
  • Add a watchdog: if Codex emits no finding within N minutes, kill the wrapper and surface an error to the orchestrator.
  • Surface running token / wall-clock cost into the parent transcript so the user can intervene before the weekly cap blows.
  • Document the failure mode in the codex plugin README — there's currently no warning that a stuck Codex session can drain Claude Code quota for hours.

Mitigation I've taken locally

Disabled the codex plugin manifest (mv plugin.json plugin.json.disabled-2026-04-28) so it no longer loads. Will not re-enable until this is addressed.

Screenshot

Attaching screenshot via web UI after issue creation (gh CLI does not support binary gist upload). Shows the orchestrator stuck on Codex review… (27s · still thinking) with weekly usage at 7d:96%.

extent analysis

TL;DR

Disable the --resume-last mode for /codex:review to prevent indefinite polling and quota exhaustion.

Guidance

  • Investigate the codex-companion.mjs script to understand how the --resume-last mode is handled and consider modifying it to include a timeout or watchdog.
  • Add a hard-cap on wall-clock or token spend to prevent the wrapper from running indefinitely.
  • Consider surfacing running token and wall-clock cost to the parent transcript to allow for user intervention.
  • Review the codex plugin README to document the potential failure mode and quota exhaustion issue.

Example

No code snippet is provided as the issue does not include specific code that needs to be modified.

Notes

The issue seems to be related to the --resume-last mode in the codex-companion.mjs script, which causes the wrapper to poll indefinitely when the Codex session is stuck. Disabling this mode or adding a watchdog could mitigate the issue.

Recommendation

Apply workaround: Disable the --resume-last mode for /codex:review to prevent quota exhaustion, until a more permanent fix is implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING