-
-
Notifications
You must be signed in to change notification settings - Fork 953
Description
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/.claudeBug 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:
fdis not listed as a dependency and may not be installed (brew install fdrequired)- Even when installed,
fdrespects.gitignoreby default. SinceMEMORY/is gitignored, all counts return 0. The--no-ignoreflag 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
- Expand
$HOMEat install time — Write absolute paths insettings.json, not shell variables - Check for
fddependency — Either install it, document it, or usefindas fallback - Add
--no-ignoreto allfdcalls touching gitignored directories - Post-install validation — Run a health check that verifies the statusline returns non-zero counts
- USER file migration — If upgrading from a previous version, detect and preserve populated USER files