Skip to content

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

671 B
Raw Blame
import { useLayoutEffect, useSyncExternalStore } from 'react';
import {
  applyThemeAppearance, DEFAULT_THEME_APPEARANCE, subscribeThemeAppearance, themeAppearanceSnapshot, updateThemeAppearance,
} from '../../theme-appearance';

/** The shared reading appearance (src/ui/theme-appearance.ts): keeps it on <html> and returns its change function. */
export function useAppearance() {
  const appearance = useSyncExternalStore(subscribeThemeAppearance, themeAppearanceSnapshot, () => DEFAULT_THEME_APPEARANCE);
  useLayoutEffect(() => { applyThemeAppearance(document.documentElement, appearance); }, [appearance]);
  return { appearance, update: updateThemeAppearance };
}