From bd5d7685d816f0457a633f55243f42772abdddba Mon Sep 17 00:00:00 2001 From: Hikari Date: Sun, 8 Feb 2026 12:45:10 -0800 Subject: [PATCH 1/2] fix: list memory files from WSL home directory on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The memory files tab was empty on Windows production builds because `list_memory_files()` was using `dirs::home_dir()` which returns the Windows home directory (C:\Users\...), but Claude Code stores memory files in the WSL home directory (~/.claude/projects/.../memory/). Solution: - Split into platform-specific implementations - Windows: Use WSL command to find and list memory files in WSL home - Linux/Mac: Continue using native filesystem access - Use `bash -l` to ensure proper PATH and home directory resolution This matches the pattern used for other file operations throughout the codebase (read_file, write_file, list_directory, etc.). Fixes empty memory files tab on Windows whilst maintaining full functionality on Linux/Mac. ✨ This fix was created by Hikari~ 🌸 --- src-tauri/Cargo.lock | 2 +- src-tauri/src/commands.rs | 49 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 1be5dcd..d7a39e8 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1636,7 +1636,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hikari-desktop" -version = "1.4.0" +version = "1.5.0" dependencies = [ "chrono", "dirs 5.0.1", diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index e53f834..a9e56e2 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -1166,6 +1166,55 @@ pub struct MemoryFilesResponse { #[tauri::command] pub async fn list_memory_files() -> Result { + // On Windows, we need to look in the WSL home directory + // On Linux/Mac, use the native home directory + #[cfg(target_os = "windows")] + { + list_memory_files_via_wsl().await + } + + #[cfg(not(target_os = "windows"))] + { + list_memory_files_native().await + } +} + +/// List memory files via WSL (for Windows) +#[cfg(target_os = "windows")] +async fn list_memory_files_via_wsl() -> Result { + use std::process::Command; + + // Use WSL to find all memory files in the WSL home directory + // This script finds all "memory" directories and lists their files + let script = r#" + find ~/.claude/projects -type d -name memory 2>/dev/null | while read dir; do + find "$dir" -maxdepth 1 -type f 2>/dev/null + done | sort + "#; + + let output = Command::new("wsl") + .args(["-e", "bash", "-l", "-c", script]) + .output() + .map_err(|e| format!("Failed to execute WSL command: {}", e))?; + + if !output.status.success() { + let stderr = String::from_utf8_lossy(&output.stderr); + return Err(format!("Failed to list memory files: {}", stderr)); + } + + let stdout = String::from_utf8_lossy(&output.stdout); + let files: Vec = stdout + .lines() + .filter(|line| !line.trim().is_empty()) + .map(|line| line.trim().to_string()) + .collect(); + + Ok(MemoryFilesResponse { files }) +} + +/// List memory files using native filesystem (for Linux/Mac) +#[cfg(not(target_os = "windows"))] +async fn list_memory_files_native() -> Result { use std::fs; // Get the .claude directory in the user's home -- 2.52.0 From 6f7544c8b3b47f03861dc42f72a865c807be2472 Mon Sep 17 00:00:00 2001 From: Hikari Date: Sun, 8 Feb 2026 12:50:18 -0800 Subject: [PATCH 2/2] fix: use backend command to read memory files for WSL compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The frontend was using Tauri's `readTextFile` plugin which enforces scope restrictions and doesn't work with WSL paths on Windows. Changed to use our `read_file_content` backend command which: - Already handles WSL paths correctly on Windows - Works with absolute paths on all platforms - Bypasses Tauri's filesystem scope restrictions - Matches the pattern used throughout the app for file operations This fixes the "forbidden path" error when trying to read memory files on Windows whilst maintaining functionality on Linux/Mac. ✨ This fix was created by Hikari~ 🌸 --- src/lib/components/MemoryBrowserPanel.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/components/MemoryBrowserPanel.svelte b/src/lib/components/MemoryBrowserPanel.svelte index d500325..aa62a37 100644 --- a/src/lib/components/MemoryBrowserPanel.svelte +++ b/src/lib/components/MemoryBrowserPanel.svelte @@ -1,7 +1,6 @@