Repository navigation
Look for the other clients' configuration where Windows puts it - #120
Merged
Merged
Conversation
…uts it Claude Desktop's config path was written out three times -- the MCP target list, the scan's source list, and once more in a test -- and all three said `Library/Application Support/`. On Windows it is under the roaming AppData instead, so all three were simply wrong there, and the shape of being wrong is that this machine's Claude Desktop is never found. For the scan that matters more than it sounds: missing an MCP configuration is exactly the hole it exists to close. One home for the path now, because three copies of an answer that differs by platform is three copies that drift, and the one that drifts is the one nobody looked at. The paths stay relative to `home` rather than reading `%APPDATA%`. This crate writes other people's configuration files, so its tests have to be isolatable by handing it a temporary directory; reading the environment takes that away, and a test that escapes isolation edits the real `~/.claude`. The cost is a machine whose AppData has been redirected, where the file is not found -- and not finding it is far cheaper than editing the wrong one. The managed-policy file has no home to be relative to, so that one does read the environment. It is `%PROGRAMDATA%` rather than a hardcoded `C:\ProgramData`, because the system drive is not always C and the consequence of assuming it is reporting "this machine has no managed policy" about a file that overrides the user's own configuration. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude Desktop's config path was written out three times — the MCP target list, the scan's source list, and once more in a test — and all three said
Library/Application Support/. On Windows it lives under the roaming AppData instead, so all three were simply wrong there.The shape of being wrong is that this machine's Claude Desktop is never found. For the scan that matters more than it sounds: missing an MCP configuration is exactly the hole it exists to close, and the code comment right above that line says so.
One home for the path now. Three copies of an answer that differs by platform is three copies that drift, and the one that drifts is the one nobody looked at — the test being the third copy is the proof: on Windows it would have created a file nobody looks for and then reported that the scan missed it.
Why the paths stay relative to
homeThis crate writes other people's configuration files, so its tests have to be isolatable by handing it a temporary directory. Reading
%APPDATA%directly takes that away, and a test that escapes isolation edits the real~/.claude.The cost is a machine whose AppData has been redirected (roaming profiles, or the user moved it), where the file is not found. Not finding it is far cheaper than editing the wrong one.
The one exception
The managed-policy file has no home to be relative to, so that one does read the environment.
%PROGRAMDATA%rather than a hardcodedC:\ProgramData, because the system drive is not always C — and the consequence of assuming it is reporting "this machine has no managed policy" about a file that overrides the user's own configuration.Worth a second pair of eyes
The Windows managed-settings location (
%PROGRAMDATA%\ClaudeCode\managed-settings.json) is taken from Anthropic's documented path rather than observed on a real machine. Worth spot-checking on Windows before the adoption work in earnest.Verified
clippy clean workspace-wide, full test suite green. Three new tests: the desktop path staying relative (an absolute one would make
home.join()silently discardhome), the managed path staying machine-wide, and each platform pointing at its own convention.🤖 Generated with Claude Code