Summary
On a fresh Ubuntu 24.04 / WSL2 install, jq is not present by default. statusline-command.sh depends on jq for every piece of data it displays — parsing stdin from Claude Code, reading settings.json, extracting model/context/cost/version info, counts, weather, location, etc.
Because every jq invocation in the script is defensively wrapped in 2>/dev/null with fallback defaults, a missing jq produces silent, confusing degradation instead of a loud error. The status line renders successfully but every field shows its empty default:
LOC: Unknown,
ENV: CC: 2.1.104 | PAI:— ALG:—
CONTEXT: 0%
PWD: (empty)
MEMORY: 0 Work | 0 Ratings | 0 Sessions | 0 Research
LEARNING: No ratings yet
Users understandably assume the status line is broken. In my case I spent time investigating Claude Code's refresh cadence, tty detection, and WSL rendering before checking which jq and finding it wasn't installed. Once I ran sudo apt-get install -y jq, every field populated correctly on the next refresh.
Platform
- Ubuntu 24.04 on WSL2 (Windows 11)
- Claude Code 2.1.104
- PAI v4.0.3
Reproduction
- Fresh Ubuntu / WSL2 install (or any Linux env without
jq preinstalled)
- Install PAI normally
- Open Claude Code
- Observe the status line shows empty defaults for every field
which jq returns nothing
Suggested fixes (in order of increasing scope)
-
Minimal: Add a loud check at the top of statusline-command.sh that prints a clear single-line error if jq isn't on PATH, e.g.:
if ! command -v jq >/dev/null 2>&1; then
echo "PAI statusline: jq not found. Install with: sudo apt-get install -y jq (or brew install jq)"
exit 0
fi
This turns a silent failure into an actionable one-line message.
-
Better: Have install.sh check for and install hard dependencies on Linux, mirroring what most users have on macOS via Homebrew. In practice the full list for a functional PAI install on Ubuntu/WSL is approximately:
-
Most complete: Add a bin/check-dependencies.sh that runs at SessionStart via hook, validates all hard dependencies, and warns the user once with a copy-pasteable install command for their distro.
I'm happy to submit a PR for option (1) immediately — it's a ~5-line change and turns an opaque failure into an actionable one. Options (2) and (3) are bigger conversations.
Related
Summary
On a fresh Ubuntu 24.04 / WSL2 install,
jqis not present by default.statusline-command.shdepends onjqfor every piece of data it displays — parsing stdin from Claude Code, readingsettings.json, extracting model/context/cost/version info, counts, weather, location, etc.Because every
jqinvocation in the script is defensively wrapped in2>/dev/nullwith fallback defaults, a missingjqproduces silent, confusing degradation instead of a loud error. The status line renders successfully but every field shows its empty default:Users understandably assume the status line is broken. In my case I spent time investigating Claude Code's refresh cadence, tty detection, and WSL rendering before checking
which jqand finding it wasn't installed. Once I ransudo apt-get install -y jq, every field populated correctly on the next refresh.Platform
Reproduction
jqpreinstalled)which jqreturns nothingSuggested fixes (in order of increasing scope)
Minimal: Add a loud check at the top of
statusline-command.shthat prints a clear single-line error ifjqisn't onPATH, e.g.:This turns a silent failure into an actionable one-line message.
Better: Have
install.shcheck for and install hard dependencies on Linux, mirroring what most users have on macOS via Homebrew. In practice the full list for a functional PAI install on Ubuntu/WSL is approximately:jq(statusline parsing — this issue)mpg123and/orffmpeg(VoiceServer audio playback — see VoiceServer: afplay (macOS-only) breaks audio on Linux — silent failure #855 and PR fix(VoiceServer): cross-platform audio playback in playAudio() #1061)poppler-utils(PDF reading via Read tool)These are all one-line apt installs.
Most complete: Add a
bin/check-dependencies.shthat runs at SessionStart via hook, validates all hard dependencies, and warns the user once with a copy-pasteable install command for their distro.I'm happy to submit a PR for option (1) immediately — it's a ~5-line change and turns an opaque failure into an actionable one. Options (2) and (3) are bigger conversations.
Related
afplaymissing on Linux