Skip to content

v2.5 Upgrade: Statusline shows all zeros — PAI_DIR not expanded, fd missing, USER files not migrated #549

@DolphusCY

Description

@DolphusCY

Summary

After upgrading to PAI v2.5, the statusline shows 0 for all memory counters (Work, Sessions, Research, Ratings) and all USER files (ABOUTME, CONTACTS, TELOS, etc.) contain only template placeholders. Three distinct bugs were found during a post-upgrade audit.

Environment

  • macOS (Darwin 25.2.0, Apple Silicon)
  • Claude Code 2.1.29
  • PAI v2.5 (fresh upgrade from v2.3)
  • Shell: zsh

Bug 1: PAI_DIR set to literal $HOME/.claude (Critical)

File: PAI/.claude/settings.json

The project-level settings.json has:

"env": {
  "PAI_DIR": "$HOME/.claude"
}

Claude Code sets environment variables from this file but does not expand shell variables. The statusline and hooks receive PAI_DIR as the literal string $HOME/.claude, not /Users/<username>/.claude. Every path lookup fails silently.

Impact: All statusline counters show 0. Any hook or tool using $PAI_DIR operates on a nonexistent path.

Fix: The installer should write the absolute expanded path:

"PAI_DIR": "/Users/<username>/.claude"

Reproduction:

# In a Claude Code session within the PAI project:
echo "$PAI_DIR"
# Expected: /Users/<username>/.claude
# Actual:   $HOME/.claude

Bug 2: fd dependency not installed / needs --no-ignore

File: ~/.claude/statusline-command.sh (lines 251-253)

The statusline uses fd to count WORK directories, JSONL sessions, and RESEARCH files:

work_count=$(fd -t d -d 1 . "$PAI_DIR/MEMORY/WORK" ...)
sessions_count=$(fd -e jsonl . "$PAI_DIR/MEMORY" ...)
research_count=$(fd -e md -e json . "$PAI_DIR/MEMORY/RESEARCH" ...)

Two issues:

  1. fd is not listed as a dependency and may not be installed (brew install fd required)
  2. Even when installed, fd respects .gitignore by default. Since MEMORY/ is gitignored, all counts return 0. The --no-ignore flag is required.

Fix: Either document fd as a required dependency and add --no-ignore, or use find as a fallback:

work_count=$(fd --no-ignore -t d -d 1 . "$PAI_DIR/MEMORY/WORK" 2>/dev/null | wc -l | tr -d ' ')

Bug 3: USER files contain only template placeholders after upgrade

Directory: ~/.claude/skills/PAI/USER/

All 43 USER files (ABOUTME.md, CONTACTS.md, BASICINFO.md, TELOS/*.md, etc.) contain only template text like [Your name], [City, Country], G0: [Primary Goal].

The v2.5 upgrade restructured from skills/CORE/USER/ to skills/PAI/USER/ but appears to have written fresh templates rather than migrating existing content. Checking all available backups (.claude-backup-20260131, .claude-v2.3-backup, .claude-backups/CORE-backup-20260114) shows the same templates — suggesting the migration tool either didn't detect populated files or the files were never populated in v2.3 either.

Note: This may not be a v2.5 bug specifically — the USER files may have been templates since v2.3 installation. The installer should either:

  • Prompt users to populate USER files post-install
  • Detect and warn if USER files still contain placeholder text
  • Provide a guided setup wizard for personal data

Fixes Applied Locally

Bug Fix Applied
PAI_DIR literal Changed to absolute path in PAI/.claude/settings.json
fd missing Installed via brew install fd
fd gitignore Added --no-ignore flag to all 3 fd calls in statusline
USER templates Not yet resolved — needs manual population

Suggested Installer Improvements

  1. Expand $HOME at install time — Write absolute paths in settings.json, not shell variables
  2. Check for fd dependency — Either install it, document it, or use find as fallback
  3. Add --no-ignore to all fd calls touching gitignored directories
  4. Post-install validation — Run a health check that verifies the statusline returns non-zero counts
  5. USER file migration — If upgrading from a previous version, detect and preserve populated USER files

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