Description
When following the Manual setup — Windows instructions in the README, the status line fails to appear in Claude Code. The failure is silent — Claude Code does not surface the error, so from the user's perspective nothing happens at all.
Running the documented command manually reveals the real cause:
File C:\Users\<user>\.claude\statusline.ps1 cannot be loaded because running scripts is disabled on this system.
For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess
Root cause
The README's Windows command is:
"command": "powershell -NoProfile -File \"%USERPROFILE%\.claude\statusline.ps1\""
This does not pass -ExecutionPolicy Bypass. If the machine's PowerShell ExecutionPolicy is set to Restricted, AllSigned, or in some misconfigured states of RemoteSigned, the .ps1 script is refused because it is unsigned. This is a common default — especially in corporate environments where Group Policy enforces Restricted or AllSigned.
Because Claude Code invokes the status line as a background command and does not display its stderr, the user only sees "nothing happens" with no hint as to why.
Additional issue — %USERPROFILE% no longer reliable on Claude Code v2.1.47+
According to recent Claude Code release notes, starting from v2.1.47 Unix-style path parsing is supported on Windows and the ~ symbol is automatically expanded to the user home directory. The note explicitly recommends not using %USERPROFILE% anymore, as it no longer works reliably in v2.1.47+.
The README still shows %USERPROFILE%\.claude\statusline.ps1, which is now a second source of failure on modern Claude Code versions — independent from the ExecutionPolicy issue.
Reproduction
- Fresh Windows 10/11 install (or any Windows with restrictive ExecutionPolicy).
- Follow the Manual setup — Windows instructions from the README verbatim.
- Restart Claude Code.
- Expected: status line appears. Actual: no status line, no error.
Manually running the same command from a shell surfaces the UnauthorizedAccess / running scripts is disabled error.
Suggested fix
Update the Windows command in the README to:
- Add
-ExecutionPolicy Bypass (process-scoped — does not modify the machine's policy, so it is safe and non-invasive).
- Replace
%USERPROFILE%\.claude\statusline.ps1 with ~/.claude/statusline.ps1 (Unix-style, works on Claude Code v2.1.47+).
- Prefer
pwsh (PowerShell 7+) when available — it is the actively developed cross-platform PowerShell. Fall back to powershell (Windows PowerShell 5.1) for users who have not installed PS7.
Recommended (PowerShell 7+):
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File ~/.claude/statusline.ps1"
Fallback (Windows PowerShell 5.1):
"command": "powershell -NoProfile -ExecutionPolicy Bypass -File ~/.claude/statusline.ps1"
This has been tested end-to-end on Windows 11 + PowerShell 7 + Claude Code 2.1.116 and works.
A short troubleshooting note in the README would also help users who hit restrictive corporate policies or who want to understand why -ExecutionPolicy Bypass is required.
Environment
- Windows 11 Enterprise (26100)
- PowerShell 5.1 (default) and PowerShell 7 (optional)
- Claude Code 2.1.116
- statusline.ps1 version 1.3.0
Happy to send a PR with the README update if that is useful.
Description
When following the Manual setup — Windows instructions in the README, the status line fails to appear in Claude Code. The failure is silent — Claude Code does not surface the error, so from the user's perspective nothing happens at all.
Running the documented command manually reveals the real cause:
Root cause
The README's Windows command is:
This does not pass
-ExecutionPolicy Bypass. If the machine's PowerShellExecutionPolicyis set toRestricted,AllSigned, or in some misconfigured states ofRemoteSigned, the.ps1script is refused because it is unsigned. This is a common default — especially in corporate environments where Group Policy enforcesRestrictedorAllSigned.Because Claude Code invokes the status line as a background command and does not display its stderr, the user only sees "nothing happens" with no hint as to why.
Additional issue —
%USERPROFILE%no longer reliable on Claude Code v2.1.47+According to recent Claude Code release notes, starting from v2.1.47 Unix-style path parsing is supported on Windows and the
~symbol is automatically expanded to the user home directory. The note explicitly recommends not using%USERPROFILE%anymore, as it no longer works reliably in v2.1.47+.The README still shows
%USERPROFILE%\.claude\statusline.ps1, which is now a second source of failure on modern Claude Code versions — independent from the ExecutionPolicy issue.Reproduction
Manually running the same command from a shell surfaces the
UnauthorizedAccess/running scripts is disablederror.Suggested fix
Update the Windows command in the README to:
-ExecutionPolicy Bypass(process-scoped — does not modify the machine's policy, so it is safe and non-invasive).%USERPROFILE%\.claude\statusline.ps1with~/.claude/statusline.ps1(Unix-style, works on Claude Code v2.1.47+).pwsh(PowerShell 7+) when available — it is the actively developed cross-platform PowerShell. Fall back topowershell(Windows PowerShell 5.1) for users who have not installed PS7.Recommended (PowerShell 7+):
Fallback (Windows PowerShell 5.1):
This has been tested end-to-end on Windows 11 + PowerShell 7 + Claude Code 2.1.116 and works.
A short troubleshooting note in the README would also help users who hit restrictive corporate policies or who want to understand why
-ExecutionPolicy Bypassis required.Environment
Happy to send a PR with the README update if that is useful.