claude-code - 💡(How to fix) Fix [BUG] SSH Remote: `projects` field in remote ~/.claude.json becomes null after desktop restart — jsonl files intact, UI shows 'No messages yet' for every session

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…

After restarting the Claude Code desktop client while connected to a remote host via SSH Remote, the sidebar shows "No messages yet" for every conversation. Investigation on the remote shows the top-level projects field of ~/.claude.json has been nulled out, while the .jsonl transcript files in ~/.claude/projects/<project>/ are intact and continue to be appended to in real time.

This appears related to #54187, #53717, and #34324 but with a stricter form of the corruption — the projects map is entirely missing instead of just having empty sessions[] arrays per project.

Root Cause

#54187 (macOS local) reports sessions[] arrays per project go empty. In this SSH-remote case, the projects map is entirely missing (null). Possibly the same root cause hitting a different code path that writes through ~/.claude.json, or a separate bug masked as the same UI symptom.

Fix Action

Fix / Workaround

Workaround attempted

Code Example

>>> import json
>>> d = json.load(open('/root/.claude.json'))
>>> list(d.keys())
['cachedGrowthBookFeatures', 'unpinOpus47LaunchEffort', 'firstStartTime',
 'opusProMigrationComplete', 'sonnet1m45MigrationComplete', 'seenNotifications',
 'migrationVersion', 'userID', 'cachedExperimentFeatures',
 'cachedExtraUsageDisabledReason', 'skillUsage']
>>> d.get('projects')
None
>>> type(d.get('projects'))
<class 'NoneType'>

---

$ ls ~/.claude/projects/-root/*.jsonl | wc -l
14
$ du -sh ~/.claude/projects/-root/
17M
$ for f in ~/.claude/projects/-root/*.jsonl; do
    python3 -c "import json
bad = 0
for l in open('$f'):
    try: json.loads(l)
    except: bad += 1
print('$f', bad)"
done
# every file: 0 malformed
RAW_BUFFERClick to expand / collapse

Summary

After restarting the Claude Code desktop client while connected to a remote host via SSH Remote, the sidebar shows "No messages yet" for every conversation. Investigation on the remote shows the top-level projects field of ~/.claude.json has been nulled out, while the .jsonl transcript files in ~/.claude/projects/<project>/ are intact and continue to be appended to in real time.

This appears related to #54187, #53717, and #34324 but with a stricter form of the corruption — the projects map is entirely missing instead of just having empty sessions[] arrays per project.

Environment

  • Client: Claude Code Desktop on Windows 10/11
  • Connection: SSH Remote via OpenSSH 9.6 (Windows native OpenSSH)
  • Server: Ubuntu 24.04.4 LTS (Noble Numbat), claude-code installed under /root
  • Working dir on remote: /root

State of remote ~/.claude.json after bug triggers

>>> import json
>>> d = json.load(open('/root/.claude.json'))
>>> list(d.keys())
['cachedGrowthBookFeatures', 'unpinOpus47LaunchEffort', 'firstStartTime',
 'opusProMigrationComplete', 'sonnet1m45MigrationComplete', 'seenNotifications',
 'migrationVersion', 'userID', 'cachedExperimentFeatures',
 'cachedExtraUsageDisabledReason', 'skillUsage']
>>> d.get('projects')
None
>>> type(d.get('projects'))
<class 'NoneType'>

No projects map at all — not {}, not per-project entries with empty sessions[].

Data side is intact

$ ls ~/.claude/projects/-root/*.jsonl | wc -l
14
$ du -sh ~/.claude/projects/-root/
17M
$ for f in ~/.claude/projects/-root/*.jsonl; do
    python3 -c "import json
bad = 0
for l in open('$f'):
    try: json.loads(l)
    except: bad += 1
print('$f', bad)"
done
# every file: 0 malformed

The currently-active session's .jsonl continues being appended to within seconds of sending a message from the (broken) UI, so the CLI/backend write path is fine. Only the index is broken.

UI symptom

  • Sidebar lists conversations as normal.
  • Clicking any conversation shows "No messages yet" — including the one I am actively sending messages to.
  • After restarting Claude Code on the desktop, no messages render at all.

Repro context

  • Long-running conversation (~1000 lines, ~2 MB in the .jsonl).
  • Closed the desktop window while SSH session was active.
  • Reopened — broken state since.

Difference from #54187

#54187 (macOS local) reports sessions[] arrays per project go empty. In this SSH-remote case, the projects map is entirely missing (null). Possibly the same root cause hitting a different code path that writes through ~/.claude.json, or a separate bug masked as the same UI symptom.

What would help

Happy to share:

  • Sanitized ~/.claude.json (after stripping userID and tokens).
  • Diagnostics on the active jsonl that keeps being appended to despite the broken index.
  • Try a specific repro on request.

Workaround attempted

Reconstructing the projects map manually from filesystem scan was attempted but I want maintainer guidance on the exact expected schema (sessions array of {id, ...}? other required keys per project?) before writing to my own ~/.claude.json. Will report back if I find a safe regeneration script.

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