Skip to content

Look for the other clients' configuration where Windows puts it - #120

Merged
fylorn merged 1 commit into
mainfrom
feat/windows-client-paths
Sep 23, 2026
Merged

fylorn merged 1 commit into
mainfrom
feat/windows-client-paths

Conversation

@fylorn

@fylorn fylorn commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

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 home

This 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 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.

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 discard home), the managed path staying machine-wide, and each platform pointing at its own convention.

🤖 Generated with Claude Code

…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>
@fylorn
fylorn merged commit f89fad6 into main Sep 23, 2026
1 check passed
@fylorn
fylorn deleted the feat/windows-client-paths branch September 23, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant