Problem
The statusline script uses stat -f %m (macOS syntax) in 7 locations to get file modification times. On Linux/WSL, this fails silently because Linux requires stat -c %Y.
This causes cache age calculations to always return 0, making caches appear perpetually "valid" even when empty. Result: Skills, Workflows, and Hooks counts show blank values on Linux systems.
Affected Lines
- Line 123 (git cache)
- Line 178 (location cache)
- Line 197 (weather cache)
- Line 234 (counts cache)
- Lines 792-793 (learning cache)
- Line 1002 (quote cache)
Environment
- WSL2 Ubuntu on Windows 11
- Claude Code 2.1.19
- PAI v2.4
Solution
Add a cross-platform helper function after line 48:
# Cross-platform file mtime (seconds since epoch)
get_mtime() {
stat -c %Y "$1" 2>/dev/null || stat -f %m "$1" 2>/dev/null || echo 0
}
# Then replace all stat -f %m "$FILE" calls with $(get_mtime "$FILE").
Problem
The statusline script uses
stat -f %m(macOS syntax) in 7 locations to get file modification times. On Linux/WSL, this fails silently because Linux requiresstat -c %Y.This causes cache age calculations to always return 0, making caches appear perpetually "valid" even when empty. Result: Skills, Workflows, and Hooks counts show blank values on Linux systems.
Affected Lines
Environment
Solution
Add a cross-platform helper function after line 48: