fix: document -ExecutionPolicy Bypass and ~ path for Windows install#36
Merged
Merged
Conversation
Closes #25. On a default Windows install the PowerShell ExecutionPolicy is Restricted (or AllSigned on corporate machines via Group Policy). Claude Code invokes the status-line command with stderr muted, so when powershell.exe refuses to run the unsigned statusline.ps1 the user sees nothing — no status line, no error — and has no hint where to look. Fix the documented Windows command: * Add -ExecutionPolicy Bypass (process-scoped, does not touch the machine policy) so the script runs under default Restricted or AllSigned policies. * Prefer pwsh (PowerShell 7+) with a documented fallback to the built-in powershell 5.1. * Replace %USERPROFILE%\.claude\... with the Unix-style ~/.claude/... path that Claude Code v2.1.47+ now expands on Windows. Keep the legacy %USERPROFILE% / $USERPROFILE variants in a note for users still on older Claude Code builds. * Collapse the separate CMD/PowerShell and Git Bash / WSL blocks into a single command now that ~ works in both.
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.
Closes #25.
Summary
On a default Windows install, PowerShell's
ExecutionPolicyisRestricted— and on corporate machines Group Policy frequently enforcesAllSigned. The previous"powershell -NoProfile -File ..."command is refused withUnauthorizedAccessin both cases. Because Claude Code invokes the status line with stderr muted, the refusal is silent: no status line renders, no error surfaces, no hint points the user at the execution policy.The reporter in #25 diagnosed this cleanly and provided a tested fix. Adopt it in
INSTALL.md.Code changes
INSTALL.md— Windows section-ExecutionPolicy Bypassto the command. This is process-scoped — the machine's policy is untouched, but the unsignedstatusline.ps1is allowed to run in this one invocation.pwsh(PowerShell 7+, the actively developed cross-platform shell). Provide a documented fallback to Windows PowerShell 5.1 for users who have not installed PS7.%USERPROFILE%\.claude\statusline\statusline.ps1with~/.claude/statusline/statusline.ps1. Claude Code v2.1.47+ expands~on Windows, and the release notes explicitly recommend dropping%USERPROFILE%.~works in both, so the split is no longer needed. Keep the legacy%USERPROFILE%/$USERPROFILEvariants in a note for users still on older Claude Code builds.-ExecutionPolicy Bypassis required, so the next user who hits a locked-down machine understands what the flag does and that it is safe.How to test
Restricted(or corporateAllSigned) ExecutionPolicy, follow the updatedINSTALL.mdWindows section.Get-ExecutionPolicy -Listafterwards — the machine's policy should be unchanged; the bypass only applied to the status-line'spwsh/powershellprocess.