diff --git a/CHANGELOG.md b/CHANGELOG.md index 6de8adb..08d8265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.12.2 — 2026-11-04 + +- Fixed: newer Claude Desktop versions keep their configuration in `%LOCALAPPDATA%\Claude-Data\\` and leave only a + marker in `%APPDATA%\Claude`. ADO Lens looked in the old place, so every install found the registration "to be + changed", asked to quit Claude, waited, and then wrote where Claude Desktop no longer reads - on a new installation + of Claude, ADO Lens never appeared in Claude Desktop. The new place is used now, and the old one is skipped when it + was left. (The Microsoft Store copy of AppData is still used for older versions.) + ## 0.12.1 — 2026-11-04 - Fixed: the install (`get.ps1` / `install.ps1`) could wait for Claude Desktop to close forever, although it was diff --git a/src/AdoLens/AdoLens.csproj b/src/AdoLens/AdoLens.csproj index 32960db..991eceb 100644 --- a/src/AdoLens/AdoLens.csproj +++ b/src/AdoLens/AdoLens.csproj @@ -25,7 +25,7 @@ ADO Lens for Azure DevOps Azure DevOps (work items, boards, wiki, Git and TFVC, pipelines) served to AI assistants over MCP Copyright © 2026 WillowDev - 0.12.1 + 0.12.2 diff --git a/src/AdoLens/ClaudeConfigs.cs b/src/AdoLens/ClaudeConfigs.cs index 9d36cab..1ce0155 100644 --- a/src/AdoLens/ClaudeConfigs.cs +++ b/src/AdoLens/ClaudeConfigs.cs @@ -10,20 +10,35 @@ public static class ClaudeConfigs public const string DefaultServerName = "ado-lens"; static readonly JsonSerializerOptions Indented = new() { WriteIndented = true }; - /// Claude Desktop config files: %APPDATA%\Claude and, for the Microsoft Store (MSIX) app, its private copy of AppData. - public static List DesktopConfigPaths() + /// + /// Claude Desktop config files. Newer versions keep their data in %LOCALAPPDATA%\Claude-Data\<app id>\ and leave + /// only a marker (.user-data-left.*) in %APPDATA%\Claude, which they no longer read; older ones use %APPDATA%\Claude, + /// and the Microsoft Store (MSIX) app of that time its private copy of AppData. + /// + public static List DesktopConfigPaths() => DesktopConfigPaths( + Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)); + + internal static List DesktopConfigPaths(string appData, string localAppData) { var list = new List(); - var roaming = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Claude", "claude_desktop_config.json"); - if (File.Exists(roaming) || Directory.Exists(Path.GetDirectoryName(roaming))) + const string File_ = "claude_desktop_config.json"; + var data = Path.Combine(localAppData, "Claude-Data"); + if (Directory.Exists(data)) + foreach (var app in Directory.EnumerateDirectories(data)) + list.Add(Path.Combine(app, File_)); + + var roamingDir = Path.Combine(appData, "Claude"); + var roaming = Path.Combine(roamingDir, File_); + var moved = Directory.Exists(roamingDir) && Directory.EnumerateFiles(roamingDir, ".user-data-left.*").Any(); + if (File.Exists(roaming) && !moved || Directory.Exists(roamingDir) && !moved && list.Count == 0) list.Add(roaming); - var packages = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Packages"); + var packages = Path.Combine(localAppData, "Packages"); if (Directory.Exists(packages)) foreach (var pkg in Directory.EnumerateDirectories(packages, "Claude_*")) { - var p = Path.Combine(pkg, "LocalCache", "Roaming", "Claude", "claude_desktop_config.json"); - if (File.Exists(p)) list.Add(p); + var p = Path.Combine(pkg, "LocalCache", "Roaming", "Claude", File_); + if (File.Exists(p) && !moved) list.Add(p); } return list; } diff --git a/tests/AdoLens.Tests/ImprovementTests.cs b/tests/AdoLens.Tests/ImprovementTests.cs index 39f989b..cbdb33f 100644 --- a/tests/AdoLens.Tests/ImprovementTests.cs +++ b/tests/AdoLens.Tests/ImprovementTests.cs @@ -51,6 +51,30 @@ public void Code_can_live_in_another_project_than_the_work_items() } } + [Fact] + public void The_Claude_Desktop_config_is_found_where_the_installed_version_keeps_it() + { + var root = Path.Combine(Path.GetTempPath(), $"adolens-claude-{Guid.NewGuid():N}"); + var appData = Path.Combine(root, "Roaming"); + var local = Path.Combine(root, "Local"); + try + { + // An older Claude Desktop: %APPDATA%\Claude. + Directory.CreateDirectory(Path.Combine(appData, "Claude")); + Assert.Equal([Path.Combine(appData, "Claude", "claude_desktop_config.json")], ClaudeConfigs.DesktopConfigPaths(appData, local)); + + // A newer one moved its data to %LOCALAPPDATA%\Claude-Data\ and left a marker: the old place is not read. + Directory.CreateDirectory(Path.Combine(local, "Claude-Data", "claude_abc")); + File.WriteAllText(Path.Combine(appData, "Claude", ".user-data-left.claude_abc"), "{}"); + File.WriteAllText(Path.Combine(appData, "Claude", "claude_desktop_config.json"), "{}"); + Assert.Equal([Path.Combine(local, "Claude-Data", "claude_abc", "claude_desktop_config.json")], ClaudeConfigs.DesktopConfigPaths(appData, local)); + } + finally + { + if (Directory.Exists(root)) Directory.Delete(root, recursive: true); + } + } + [Theory] [InlineData(@"C:\Program Files\WindowsApps\Claude_4.1_x64__abc\app\Claude.exe", true)] [InlineData(@"C:\Users\x\AppData\Local\AnthropicClaude\app-1.2.3\claude.exe", true)]