Skip to content

statusline-command.sh uses macOS-only stat syntax, breaks on Linux/WSL #495

Description

@GregorLinksys

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").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions