[Bug] /statusline generates bash/Unix commands on native Windows
Description
The /statusline skill generates a statusline command using bash/Unix syntax (cat, jq, basename, echo) even when running on native Windows. The generated command silently fails, resulting in no statusline being displayed after restart.
Environment
- Claude Code version: 2.1.37 (native Windows binary, not Node)
- OS: Windows 11
- Shell: PowerShell / cmd.exe
Steps to Reproduce
- Run
/statuslineon Windows - Request a statusline showing directory, git branch, model name, and context usage
- The skill generates a command using bash syntax:
``json``
"statusLine": {
"type": "command",
"command": "input=$(cat); cwd=$(echo \"$input\" | jq -r '.workspace.current_dir'); model=$(echo \"$input\" | jq -r '.model.display_name'); used=$(echo \"$input\" | jq -r '.context_window.used_percentage // empty'); git_branch=\"\"; if git rev-parse --git-dir > /dev/null 2>&1; then git_branch=$(git -c core.useBuiltinFSMonitor=false branch --show-current 2>/dev/null || echo \"\"); [ -n \"$git_branch\" ] && git_branch=\" [$git_branch]\"; fi; dir_name=$(basename \"$cwd\"); status=\"${dir_name}${git_branch} | ${model}\"; [ -n \"$used\" ] && status=\"${status} | Context: $(printf \"%.1f\" \"$used\")%\"; echo \"$status\""
}
- Restart Claude Code
- No statusline appears
Expected Behavior
On Windows, the /statusline skill should either:
- Generate a PowerShell-compatible command (e.g.,
powershell -NoProfile -File <script>) - Detect the platform and generate platform-appropriate syntax
- Document that the feature requires a bash-compatible shell on Windows
Workaround
Manually create a PowerShell script and update ~/.claude/settings.json to reference it:
~/.claude/statusline.ps1:
$jsonInput = [Console]::In.ReadToEnd()
$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 ($used) {
$rounded = [Math]::Round([double]$used, 1)
$status += " | Context: ${rounded}%"
}
Write-Output $status
~/.claude/settings.json:
"statusLine": {
"type": "command",
"command": "powershell -NoProfile -File C:\path\to\.claude\statusline.ps1"
}
Related Issues
- #23994 — StatusLine not executing in VS Code on Windows (Node version)
- #12870 — Status line output truncated on Windows
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗