Statusline not working on Windows - "Session environment not yet supported on Windows"
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The custom statusline feature stopped working after a recent update. The statusline was working previously but now
does not appear at all. Investigation of the debug log revealed the following entry after each assistant message:
Session environment not yet supported on Windows
No invocation of the configured statusline command is logged at any point during the session, confirming the script is
never called.
Configuration (~/.claude/settings.json):
{
"statusLine": {
"type": "command",
"command": "powershell -NoProfile -File C:\\Users\\<user>\\.claude\\statusline.ps1"
}
}
Statusline.ps1:
$jsonInput = [Console]::In.ReadToEnd()
$jsonInput | Out-File -FilePath "$env:USERPROFILE\.claude\statusline_debug.log" -Encoding utf8 -Append
$data = $jsonInput | ConvertFrom-Json
$cwd = $data.workspace.current_dir
$model = $data.model.display_name
$used = $data.context_window.used_percentage
$dirName = Split-Path -Leaf $cwd
$status = "$dirName"
try {
$branch = git branch --show-current 2>$null
if ($branch) {
$status += " [$branch]"
}
} catch {}
$status += " | $model"
if ($null -ne $used) {
$rounded = [Math]::Round([double]$used, 1)
$status += " | Context: ${rounded}%"
} else {
$status += " | Context: 0%"
}
Write-Output $status
What Should Happen?
Statusline should appear in Windows Terminal when using Claude Code CLI
Error Messages/Logs
Steps to Reproduce
Steps to reproduce:
- Configure a statusLine command in ~/.claude/settings.json on Windows
- Start Claude Code
- Send a message
- Observe: no statusline appears at the bottom of the interface
Expected behavior: Statusline script is invoked after each assistant message and output is displayed at the bottom of
the Claude Code interface.
Actual behavior: Statusline script is never invoked. Debug log contains Session environment not yet supported on
Windows.
Additional notes:
- The script itself works correctly when invoked manually: echo '<json>' | powershell -NoProfile -File
~/.claude/statusline.ps1 produces the expected output
- The statusLine config is correctly read (the command is registered as an allowed Bash rule in the debug log), but
the command is never executed
- This appears to be a regression introduced with the native Windows binary — the statusline worked in a previous
version
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
a few days ago it worked
Claude Code Version
2.1.49 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Additional notes:
- The script itself works correctly when invoked manually: echo '<json>' | powershell -NoProfile -File
~/.claude/statusline.ps1 produces the expected output
- The statusLine config is correctly read (the command is registered as an allowed Bash rule in the debug log), but
the command is never executed
- This appears to be a regression introduced with the native Windows binary — the statusline worked in a previous
version
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗