claude-code - 💡(How to fix) Fix [BUG] Dark mode preference resets to system/light on re-authentication [1 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#48773Fetched 2026-04-16 06:51:22
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×2unlabeled ×1

Error Message

Error Messages/Logs

No error messages are shown. The reset happens silently on re-authentication. userThemeMode and the OAuth token cache live in the same config.json. On re-authentication, the app writes a fresh config with "userThemeMode": "system" as the default, overwriting the user's saved preference. No error is logged — the reset is silent.

Root Cause

Root cause hypothesis:

Fix Action

Fix / Workaround

Actual Behavior config.json (~/Library/Application Support/Claude/config.json) has "userThemeMode" overwritten to "system" on every login/auth refresh, discarding the user's saved preference. Environment

  • macOS Tahoe Version 26.3 (25D125)
  • Claude desktop app: Claude 1.2773.0 (884b37) 2026-04-15T14:32:09.000Z
  • System appearance: Light (user intentionally not using macOS dark mode) Workaround Manually editing config.json or using a file watcher to re-apply the preference after each auth reset.

Workaround used:

Code Example

No error messages are shown. The reset happens silently on re-authentication.
Relevant log snippet from ~/Library/Logs/Claude/main.log:
[info] Trying to load oauth token cache
[info] [oauth] token cache location: ~/Library/Application Support/Claude/config.json
[info] [oauth] loaded token cache from disk
The OAuth token and userThemeMode preference share the same config.json file.
On re-auth, the app overwrites userThemeMode back to "system" without logging
the change. Confirmed by manually inspecting the file before and after login.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Summary The dark mode preference (Settings > Appearance > Dark) does not persist across logouts or re-authentication. Every time the app resets auth, the theme reverts to "system" (light).

Actual Behavior config.json (~/Library/Application Support/Claude/config.json) has "userThemeMode" overwritten to "system" on every login/auth refresh, discarding the user's saved preference. Environment

  • macOS Tahoe Version 26.3 (25D125)
  • Claude desktop app: Claude 1.2773.0 (884b37) 2026-04-15T14:32:09.000Z
  • System appearance: Light (user intentionally not using macOS dark mode) Workaround Manually editing config.json or using a file watcher to re-apply the preference after each auth reset.

What Should Happen?

Expected Behavior Theme preference should persist server-side and restore correctly after re-authentication.

Error Messages/Logs

No error messages are shown. The reset happens silently on re-authentication.
Relevant log snippet from ~/Library/Logs/Claude/main.log:
[info] Trying to load oauth token cache
[info] [oauth] token cache location: ~/Library/Application Support/Claude/config.json
[info] [oauth] loaded token cache from disk
The OAuth token and userThemeMode preference share the same config.json file.
On re-auth, the app overwrites userThemeMode back to "system" without logging
the change. Confirmed by manually inspecting the file before and after login.

Steps to Reproduce

Steps to Reproduce

  1. Open Claude desktop app
  2. Go to Settings > Appearance > set theme to Dark
  3. Log out (or let the session expire and re-authenticate)
  4. Theme reverts to system/light mode Expected Behavior Theme preference should persist server-side and restore correctly after re-authentication.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

1.2773.0

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Configuration file (~/Library/Application Support/Claude/config.json — redacted):

{ "locale": "en-US", "userThemeMode": "system", "hasTrackedInitialActivation": true } (userThemeMode is set to "system" after every re-auth, regardless of user preference)

App version: 1.2773.0 macOS version: 26.3 (Build 25D125)

Root cause hypothesis:

userThemeMode and the OAuth token cache live in the same config.json. On re-authentication, the app writes a fresh config with "userThemeMode": "system" as the default, overwriting the user's saved preference. No error is logged — the reset is silent.

Workaround used:

macOS LaunchAgent watching config.json via WatchPaths, re-applying "userThemeMode": "dark" whenever the file changes. Shouldn't be necessary.

Screenshots: Not applicable — the bug is a silent file overwrite, not a visual glitch. You could show the before/after of config.json if you want to illustrate it, but the file content above covers it.

No repo to link — this is in the closed-source desktop app.

extent analysis

TL;DR

The most likely fix is to modify the re-authentication process to preserve the user's theme preference by not overwriting the userThemeMode in the config.json file.

Guidance

  • Investigate the re-authentication logic to identify why the userThemeMode is being reset to "system" and modify it to retain the user's saved preference.
  • Consider separating the OAuth token cache and user preferences into different files or sections to prevent accidental overwrites.
  • Verify that the config.json file is being written correctly after re-authentication by inspecting the file contents before and after the process.
  • Test the fix by setting the theme to Dark, logging out and back in, and checking if the theme preference persists.

Example

No code snippet is provided as the issue is related to the closed-source desktop app, but the fix would involve modifying the re-authentication logic to handle the userThemeMode preference correctly.

Notes

The root cause hypothesis suggests that the issue is due to the userThemeMode and OAuth token cache sharing the same config.json file, which is overwritten during re-authentication. The workaround used, involving a macOS LaunchAgent, confirms this hypothesis.

Recommendation

Apply a workaround by modifying the re-authentication process to preserve the user's theme preference, as the root cause is identified and a fix can be implemented to resolve the issue.

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

claude-code - 💡(How to fix) Fix [BUG] Dark mode preference resets to system/light on re-authentication [1 participants]