[BUG] Silent exit after OAuth token check loop (272+ iterations) on macOS
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code silently exits without any error message. Debug logs show an abnormal pattern: [API:auth] OAuth token check complete is logged 272+ times within 1 second before the process terminates.
The exit occurs randomly - during idle, while typing, or during tool execution. No specific trigger pattern identified.
What Should Happen?
Claude Code should continue running normally without excessive OAuth token checks or silent termination.
Environment
| Component | Value |
|-----------|-------|
| Claude Code Version | 2.1.25 |
| Node.js | v23.11.0 |
| OS | macOS 15.6.1 (Darwin 24.6.0) |
| Platform | darwin arm64 |
Error Messages/Logs
Debug log ends abruptly with no shutdown message:
2026-02-05T02:42:39.882Z [DEBUG] [API:auth] OAuth token check complete
2026-02-05T02:42:39.882Z [DEBUG] [API:auth] OAuth token check complete
2026-02-05T02:42:39.882Z [DEBUG] [API:auth] OAuth token check complete
... (272 total occurrences within ~1 second)
2026-02-05T02:42:40.806Z [DEBUG] [API:request] Creating client...
2026-02-05T02:42:41.502Z [DEBUG] Auto tool search enabled: 45570 tokens
2026-02-05T02:42:52.389Z [DEBUG] High write ratio: blit=90, write=49067 (99.8% writes)
2026-02-05T02:42:53.670Z [DEBUG] High write ratio: blit=90, write=55187 (99.8% writes)
2026-02-05T02:42:56.072Z [DEBUG] High write ratio: blit=90, write=36072 (99.8% writes)
[EOF - no shutdown, no error]
Steps to Reproduce
- Start
claudein any project directory - Use Claude Code normally (conversation, tool calls, etc.)
- Process exits randomly - could be during idle, typing, or tool execution
- Check debug log:
~/.claude/debug/*.txtshows OAuth loop pattern
Key Observations
- OAuth token check spam: 272 calls within ~1 second (same millisecond timestamps)
- High write ratio warnings: 99.8% writes to terminal before crash
- No graceful shutdown: Debug log ends without any exit/shutdown message
- Random timing: Not correlated with specific tools or user actions
Claude Model
Opus
Is this a regression?
Unknown - issue persists across sessions
Claude Code Version
2.1.25 (Claude Code)
Platform
macOS
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗