Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/CodeShellManager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,24 @@ private async void OnLoaded(object sender, RoutedEventArgs e)
// Launch live sessions first, then append dormant entries — keeps the
// "dormant always at the bottom" invariant that SleepSession and
// RebuildSidebarOrder enforce at runtime.
// Stagger consecutive claude launches: claude's CLI does an unlocked
// read-modify-write on ~/.claude.json at startup, so simultaneous
// boots can corrupt the user's profile.
bool lastWasClaude = false;
foreach (var s in saved)
{
if (s.IsDormant) continue;
bool isClaude = ClaudeSessionService.IsClaudeCommand(s.Command);
if (isClaude && lastWasClaude)
await Task.Delay(2000);
try { await LaunchSessionAsync(s, restoring: true); }
catch (Exception ex)
{
Log($"Restore FAILED for '{s.Name}': {ex}");
MessageBox.Show($"Failed to restore '{s.Name}': {ex.Message}",
"Restore Error", MessageBoxButton.OK, MessageBoxImage.Warning);
}
lastWasClaude = isClaude;
}
foreach (var s in saved)
{
Expand Down
Loading