claude-code - 💡(How to fix) Fix [BUG] statusline-setup agent generates jq-dependent script that fails on Windows [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#60486Fetched 2026-05-20 03:57:17
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2

Error Message

/dev/stdin throws ENOENT error

Error Messages/Logs

Root Cause

Description

The /statusline command (statusline-setup agent) generates a shell script that uses jq to parse JSON input. This script fails silently on Windows because:

Fix Action

Fix / Workaround

Workaround

Replace jq with node using process.stdin event, and convert backslash paths with tr '\\' '/' before passing to basename.

Code Example

All dynamic fields are empty — statusline shows `[] 📁 . | 🌿 branch`
  with no model name, no context %, no cost, no duration.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Environment

  • OS: Windows 11
  • Claude Code version: 2.1.144
  • Shell: Git Bash (bash)

Description

The /statusline command (statusline-setup agent) generates a shell script that uses jq to parse JSON input. This script fails silently on Windows because:

  1. jq is not available — not pre-installed on Windows, causing all fields (model, context %, project name) to show as empty
  2. /dev/stdin does not exist on Windows — Node.js fallback using /dev/stdin throws ENOENT error
  3. basename does not handle Windows backslash pathsworkspace.current_dir is returned as D:\\folder\\folder, which basename cannot parse, resulting in . as the project name

Workaround

Replace jq with node using process.stdin event, and convert backslash paths with tr '\\' '/' before passing to basename.

What Should Happen?

statusline-setup should detect the OS and use a Windows-compatible JSON parser (e.g. node with process.stdin, or python3) as a fallback when jq is not available.

Error Messages/Logs

All dynamic fields are empty — statusline shows `[] 📁 . | 🌿 branch`
  with no model name, no context %, no cost, no duration.

Steps to Reproduce

just /statusline in claude code terminal

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.144 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] statusline-setup agent generates jq-dependent script that fails on Windows [2 comments, 3 participants]