Re-authentication required after every clean restart due to auto-update wiping credentials

Resolved 💬 2 comments Opened Jun 10, 2026 by Lubexes Closed Jun 13, 2026

Bug Description

After closing Claude Code cleanly and restarting it, the full first-time authorization flow is triggered (OAuth login required), as if it were a fresh installation. This happens consistently — not just once.

Environment

  • OS: Linux (CachyOS), kernel 7.x
  • Shell: zsh
  • Claude Code version: 2.1.170 (observed during: 2.1.159 → 2.1.161 auto-update)
  • Install path: /opt/claude-code/bin/claude

Steps to Reproduce

  1. Use Claude Code normally in a session
  2. Close Claude Code cleanly (normal exit)
  3. Start Claude Code again
  4. Full first-time authorization flow appears (OAuth re-login required)

Expected Behavior

Existing credentials should persist. The refresh token should silently renew the access token if expired — no user interaction required.

Root Cause (from daemon log)

binary at /opt/claude-code/bin/claude changed (mtime changed)
— self-restarting for upgrade
daemon start — version=2.1.159 → 2.1.161 (origin=transient)

The supervisor daemon self-restarts on binary mtime changes (auto-update). After restart, credentials are lost or invalidated.

Additionally, two concurrent config formats exist on disk simultaneously:

  • ~/.claude.json — legacy all-in-one JSON (still being written to)
  • ~/.claude/ directory — newer split format

This dual-format situation suggests an incomplete migration. The auto-update likely resets ~/.claude.json or breaks the mapping between formats, causing Claude Code to treat the next startup as first-time setup.

Frequency

Reproducible reliably on multiple consecutive days after clean restarts.

Impact

Every restart requires full OAuth re-authorization and plugin reconfiguration — blocks daily development workflow.

Fix Requested

  1. Auto-updates must not clear persisted credentials
  2. Migration from ~/.claude.json~/.claude/ must be idempotent
  3. If re-auth is genuinely required (new scopes etc.), show a clear explanation instead of silently triggering first-time-setup

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗