claude-code - 💡(How to fix) Fix /ultrareview cloud session fails with `CLAUDE_CODE_OAUTH_TOKEN not set`, then silently times out at 30 min — consumes free runs [2 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#54181Fetched 2026-04-29 06:34:07
View on GitHub
Comments
2
Participants
3
Timeline
8
Reactions
2
Timeline (top)
labeled ×3commented ×2cross-referenced ×2subscribed ×1

Error Message

=== run_hunt.sh: Starting === === Bug Hunter: Starting Review === Timestamp: 2026-04-28T02:58:34Z PR: 9279 Repo: planfit/planfit-client-rn === run_hunt.sh: OAuth token check === ERROR: CLAUDE_CODE_OAUTH_TOKEN not set

Root Cause

  1. Root cause (server-side env): The cloud session's SessionStart:startup hook (run_hunt.sh) exits with code 1 immediately because CLAUDE_CODE_OAUTH_TOKEN is not set in the cloud environment. Nothing in my local environment can influence this.

Code Example

=== run_hunt.sh: Starting ===
=== Bug Hunter: Starting Review ===
Timestamp: 2026-04-28T02:58:34Z
PR: 9279
Repo: planfit/planfit-client-rn
=== run_hunt.sh: OAuth token check ===
ERROR: CLAUDE_CODE_OAUTH_TOKEN not set
RAW_BUFFERClick to expand / collapse

Description: /ultrareview <PR#> consistently fails before any review work can begin. Two distinct problems compound here:

  1. Root cause (server-side env): The cloud session's SessionStart:startup hook (run_hunt.sh) exits with code 1 immediately because CLAUDE_CODE_OAUTH_TOKEN is not set in the cloud environment. Nothing in my local environment can influence this.

  2. Failure-surfacing bug: The hook fails within seconds, but the cloud session does not surface the failure. The web UI stays empty and the task keeps the free-run slot reserved until a 30-minute timeout. The eventual notification reads Remote review failed: remote session exceeded 30 minutes, which masks the real cause and makes it look like a long-running review timed out.

Reproduction:

  1. Run /ultrareview 9279 in repo planfit/planfit-client-rn
  2. Cloud session starts; web UI shows no progress for ~30 min
  3. System reports "remote session exceeded 30 minutes"
  4. Inspecting the local task output file reveals the hook actually died immediately with the OAuth error

Hook output (identical across both attempts, captured locally):

=== run_hunt.sh: Starting ===
=== Bug Hunter: Starting Review ===
Timestamp: 2026-04-28T02:58:34Z
PR: 9279
Repo: planfit/planfit-client-rn
=== run_hunt.sh: OAuth token check ===
ERROR: CLAUDE_CODE_OAUTH_TOKEN not set

Affected sessions:

  • session_015pncy6hnrqT5maaZjhQ1RJ — started 2026-04-28 02:58 UTC, hook failed in seconds, marked failed only after 30 min
  • session_017RbBTu7Pguyyhha7oR2V6o — started 2026-04-28 03:23 UTC, identical pattern

Impact:

  • 2 of 3 free runs consumed without producing any review
  • Each failure wastes 30 min of wall time before the user gets any signal
  • Misleading timeout message hides the actual root cause

Requests:

  1. Fix the server-side env so CLAUDE_CODE_OAUTH_TOKEN is set in ultrareview cloud sessions
  2. Surface SessionStart hook failures immediately instead of waiting for the 30-min timeout, and don't consume free-run quota for sessions that fail before any review work
  3. Credit the 2 failed runs back to my account — both failed at startup due to the server-side env issue

extent analysis

TL;DR

Set the CLAUDE_CODE_OAUTH_TOKEN environment variable in the cloud session to fix the immediate hook failure.

Guidance

  • Verify that the CLAUDE_CODE_OAUTH_TOKEN is set in the local environment and check if it's being passed to the cloud session.
  • Investigate the cloud session configuration to determine why the CLAUDE_CODE_OAUTH_TOKEN is not being set.
  • Consider modifying the run_hunt.sh script to handle the case where CLAUDE_CODE_OAUTH_TOKEN is not set, such as by surfacing an error message immediately.
  • Review the cloud session's error handling and logging to ensure that failures are properly reported and do not consume free-run quota.

Example

No code snippet is provided as the issue is related to environment variable configuration.

Notes

The root cause of the issue is the missing CLAUDE_CODE_OAUTH_TOKEN environment variable in the cloud session. The failure-surfacing bug is a separate issue that needs to be addressed to provide a better user experience.

Recommendation

Apply a workaround by setting the CLAUDE_CODE_OAUTH_TOKEN environment variable in the cloud session, as this is the most direct way to fix the immediate hook failure.

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