Repository navigation
fix(init): fall back to Windows environment paths when home lookup fails - #4254
Open
ryanduguid wants to merge 1 commit into
Open
ryanduguid wants to merge 1 commit into
ryanduguid wants to merge 1 commit into
Conversation
📊 Automated PR Analysis
SummaryAdds a Windows-specific fallback for resolving the Claude hook directory when the native home-directory lookup fails, checking USERPROFILE then HOME while preserving CLAUDE_CONFIG_DIR and native home precedence. Includes new unit tests for the fallback, precedence, and empty-value rejection cases, plus a README update documenting the behavior. Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
ryanduguid
marked this pull request as ready for review
September 26, 2026 03:14
ryanduguid
force-pushed
the
fix/windows-claude-home-fallback
branch
from
October 10, 2026 14:03
fcaaabd to
ec09bfb
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.
Summary
When native Windows home-directory lookup fails, resolve the Claude hook directory from
USERPROFILE, thenHOME. PreserveCLAUDE_CONFIG_DIRand native-home precedence. The fallback uses RTK's isolateduser_dirsaccessors, and child test environments also clear inheritedUSERPROFILE.Integrated upstream develop ff9bd8e to resolve the merge conflict. The failure message now names the supported Windows recovery variable.
Related to #4229.
Evidence
src/hooks/init/mod.rs. The resolved patch preserves upstream environment isolation and passesgit diff --check.USERPROFILEbeforeHOME, absent and empty values, no usable home and the error text. The existing child-isolation test covers the added variable. Hook integrity tests remain in the full suite.license/clapasses at a63d4ce. Upstream'scheck-targetjob is skipped; this does not verify its test matrix.Merge danger
Door: two-way. Blast radius: Windows paths.
The fallback applies when native lookup fails; the global home resolver and legacy-hook integrity gate retain their existing behaviour.
Unverified
The native Windows API failure is injected at the resolver boundary; a live Codex sandbox reproduction remains unverified. Linux verification predates the final diagnostic-only edit because the sandbox became unreachable. Upstream test CI, macOS verification and ignored integration tests remain unverified. Aikido timed out connecting and supplies no scan result.