diff --git a/components/SessionSidebar.tsx b/components/SessionSidebar.tsx
index 0514b55e5..6530a170c 100644
--- a/components/SessionSidebar.tsx
+++ b/components/SessionSidebar.tsx
@@ -2,6 +2,7 @@
import { useEffect, useLayoutEffect, useState, useCallback, useRef, type CSSProperties, type ReactNode } from "react";
import type { SessionInfo } from "@/lib/types";
+import { loadExplorerOpen, saveExplorerOpen } from "@/lib/file-explorer-state";
import { useI18n } from "@/hooks/useI18n";
import { DirectoryPicker } from "./DirectoryPicker";
import { FileExplorer, type FileExplorerHandle } from "./FileExplorer";
@@ -465,6 +466,12 @@ export function SessionSidebar({ selectedSessionId, onSelectSession, onNewSessio
loadSessions(isFirst);
}, [loadSessions, refreshKey]);
+ // Browser storage is unavailable during server rendering. Restore the panel
+ // preference after hydration so a collapsed explorer stays collapsed on reload.
+ useEffect(() => {
+ setExplorerOpen(loadExplorerOpen());
+ }, []);
+
// Persist unread markers so they survive a browser refresh before the user
// has actually opened the completed session.
useEffect(() => {
@@ -1558,7 +1565,11 @@ export function SessionSidebar({ selectedSessionId, onSelectSession, onNewSessio
>