Skip to content

Statusline pack reads PAI version from invalid settings.json field #446

Description

@jmatthewpryor

Problem

The statusline pack (Packs/pai-statusline/src/statusline-command.sh) attempts to read the PAI version from settings.json at .pai.version:

# Line 93-95
PAI_VERSION=$(jq -r '.pai.version // "—"' "$SETTINGS_FILE" 2>/dev/null)
PAI_VERSION="${PAI_VERSION:-—}"

However, Claude Code's settings.json schema does not allow arbitrary fields like pai. Adding this field causes a validation error:

Settings validation failed:
- : Unrecognized field: pai

As a result, the statusline always shows PAI: v— instead of the actual version.

Suggested Fix

The script already sources ~/.claude/.env on line 42:

[ -f "$PAI_DIR/.env" ] && source "$PAI_DIR/.env"

Change the version retrieval to read from the environment variable (with fallback):

# Get PAI version from environment (set in .env) or default
PAI_VERSION="${PAI_VERSION:-2.3}"

And document that users should add PAI_VERSION=2.3 to their ~/.claude/.env.

Affected Files

  • Packs/pai-statusline/src/statusline-command.sh (lines 93-95)
  • Releases/v2.3/.claude/statusline-command.sh (same location)

Environment

  • Claude Code version: 1.0.33
  • PAI version: 2.3
  • macOS Darwin 24.6.0

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