feat(windows): add Windows support - #1
Merged
Conversation
Adds Windows to the supported endpoint set so baseline/project scans discover MCP configs (%APPDATA%\Claude, Continue), Chromium-family extensions (Chrome/Edge/Brave/Chromium/Vivaldi/Arc under %LOCALAPPDATA%), and Firefox-family profiles (%APPDATA%\Mozilla\...). isBroadHomeRoot now recognises Windows drive roots and bare <drive>:\Users[\<name>] homes. Endpoint UID stays empty on Windows rather than emitting "-1" when user.Current fails. setHomeDir test helper sets HOME/USERPROFILE/APPDATA/LOCALAPPDATA together so existing home-based tests run on all three platforms. CI matrix gains windows-latest and goreleaser builds windows amd64/arm64 zip archives. Tracks perplexityai#2; implemented from scratch rather than adopting any of the open upstream PRs (#4, perplexityai#16, perplexityai#30).
Follow-up to the initial Windows support, from reviewing the earlier upstream Windows attempts (#3, #4, perplexityai#16, perplexityai#30). Two of these would have made CI red on the windows-latest runner the previous commit added. CI-breaking: - The selftest step had no `shell: bash`. windows-latest defaults to PowerShell, where invoking the extensionless build output does not work as it does in a POSIX shell. The gofmt step already pinned bash; this one did not. - scanner_test.go asserted on literal "/proj/" and "/dup/" substrings of source_file, which is a native path, so TestEndToEndScan could only have passed on Unix. Now normalized before matching. Correctness: - npm and pnpm derived project_path by slash-joining segments after an internal filepath.ToSlash, so a Windows record carried C:/src/app instead of C:\src\app. This is issue #1 ("Windows package records should preserve native project paths"); PR #3 was closed with the note that it would be folded into the broader Windows work, and it then was not. Both now convert back with filepath.FromSlash, with regression tests. - DefaultExcludes had no Windows entries, so a deep sweep of %USERPROFILE% descended into AppData/Local/{Temp,Microsoft,Packages} and AppData/LocalLow — the Windows analogue of the macOS Library subtrees already excluded there. - systemRoots returned nil on Windows, missing machine-wide Python under %ProgramFiles%\PythonNN\Lib\site-packages, and per-user Python under %LOCALAPPDATA%\Programs\Python\* was missing as well.
The windows-latest job added in the preceding commits fails on the gofmt step, listing every .go file in the repository — including files no branch here touches. It is not a formatting problem: actions/checkout on Windows inherits git's default core.autocrlf=true and rewrites the tree to CRLF, and gofmt reports a CRLF file as unformatted. A .gitattributes pinning LF for Go sources fixes the checkout, so the repo-wide `gofmt -l .` check stays meaningful on all three runners rather than having to be skipped on Windows. It also matches what gofmt writes when a contributor runs it on Windows locally.
TestIsPnpmStorePackageJSON hardcoded proj == "/x/proj". That assertion encoded the bug this branch fixes: IsPnpmStorePackageJSON now returns a native path, so on Windows it correctly yields `\x\proj` and the literal comparison failed. Converting the expectation with filepath.FromSlash keeps the test correct on every platform. The input paths stay slash-written, since the matcher normalizes internally and accepts either form. Caught by the windows-latest runner, which reached the test step for the first time now that the CRLF checkout issue is fixed.
Niicolaa
force-pushed
the
claude/windows-support-planning-tb6ae
branch
from
August 4, 2026 14:31
3f055c4 to
e62c2c6
Compare
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.
Adds Windows to the supported endpoint set, so
baselineandprojectscans work on Windows developer machines the same way they do on macOS and Linux.This is PR 1 of 2.
claude/ecosystem-sources-tb6ae(new ecosystem coverage) is stacked on top of this branch and should be merged after it.What's covered
Root discovery —
cmd/bumblebee/roots.gogains acase "windows"in each of the fourswitch runtime.GOOSblocks:%APPDATA%\Claude,%APPDATA%\Continue. Cursor, Windsurf and Claude Code already resolve through the existing cross-platform dotfile roots.%LOCALAPPDATA%: Chrome, Edge, Brave, Chromium, Vivaldi, Arc.%APPDATA%: Firefox, LibreWolf, Waterfox.%ProgramFiles%\PythonNN\Lib\site-packages, plus per-user Python under%LOCALAPPDATA%\Programs\Python\*.%APPDATA%/%LOCALAPPDATA%are read from the environment first (so enterprise folder redirection is honoured) and fall back to<home>\AppData\....Safety contract —
isBroadHomeRootnow recognises Windows drive roots and bare homes:<drive>:\,<drive>:\Users, and<drive>:\Users\<name>. Comparisons are case-insensitive, since Windows filesystems are.baselineandprojectrefuse these exactly as they refuse$HOMEand/Users/<name>today.Walker excludes —
walk.DefaultExcludesgainsAppData/Local/{Temp,Microsoft,Packages,CrashDumps}andAppData/LocalLow. These are the Windows analogue of the macOSLibrarysubtrees already excluded: large, OS-managed, and holding no inventory. Without them a deep sweep of%USERPROFILE%descends into all of them.Native project paths — npm and pnpm derived
project_pathby slash-joining segments after an internalfilepath.ToSlash, so a Windows record carriedC:/src/appinstead ofC:\src\app. Both now convert back withfilepath.FromSlash, with regression tests. This is upstream issue #1; upstream PR #3 was closed with the note that it would be folded into the broader Windows work, and it then wasn't.Endpoint metadata —
os.Getuid()returns-1on Windows, so that fallback is now Unix-only anduidis left empty rather than emitting a misleading sentinel. Whenuser.Current()succeeds, Go returns the user's SID on Windows, which is kept as-is.Build and CI —
windows-latestadded to the test matrix; goreleaser buildswindowsamd64 + arm64 as.zip. The selftest step now pinsshell: bash:windows-latestdefaults to PowerShell, where invoking the extensionless build output doesn't work as it does in a POSIX shell.Tests — a
setHomeDirhelper setsHOME,USERPROFILE,APPDATAandLOCALAPPDATAtogether so the existing home-based tests are hermetic on all three platforms.scanner_test.goasserted on literal"/proj/"and"/dup/"substrings ofsource_file— a native path — soTestEndToEndScancould only ever have passed on Unix; those are now normalized before matching.--all-usersstays macOS-only and its darwin-only test guards are unchanged.Verification
go test -race ./...— greengofmt -l .andgo vet ./...— cleanGOOS=windowsamd64andarm64— build and vet cleanbumblebee selftest— OKThe one thing this can't demonstrate from a Linux host is a green run on Windows. Every path assumption I could find has been fixed by inspection and cross-compilation, but the real signal is the
windows-latestjob on this PR.Includes one unrelated commit:
cmd/threatintel-fetch/datadog.gohas a stray trailing newline that fails the repo-widegofmt -l .gate on every branch. Whitespace only — drop that commit if you'd rather fix it separately.Prior art
Reviewed against the four earlier upstream Windows attempts (#3, #4, perplexityai#16, perplexityai#30). None were rejected on merit — #3 was closed by a collaborator as "we're going to handle native Windows paths as part of the broader experimental Windows support work", and the others are open and unreviewed. Where they had coverage this lacked (AppData excludes, the CI shell, Windows Python roots), it's incorporated here.
🤖 Generated with Claude Code
https://claude.ai/code/session_01H9erz849YcDcunP7sWteMu
Generated by Claude Code