Skip to content

SessionStart hook fragile on Windows/MSYS due to set -euo pipefail #466

@hmseeb

Description

@hmseeb

Environment: Windows (MSYS_NT-10.0), Claude Code, superpowers v4.3.0

Problem: The hooks/session-start.sh hook intermittently fails on Windows/MSYS with a SessionStart:startup hook error. The likely cause is set -euo pipefail (line 4), which makes the script exit on any error — including edge cases in path resolution (BASH_SOURCE, dirname) or unset variables that can occur transiently on MSYS/Git Bash.

Suggestion: Since the hook provides optional context injection and already has a fallback for the cat on line 18 (|| echo "Error reading..."), consider either:

  • Removing set -euo pipefail entirely, or
  • Replacing it with softer guards (e.g., set -e only, with explicit || true on fragile operations)

The script unconditionally does exit 0 at line 46, so removing strict mode won't mask real failures — it'll just prevent transient MSYS quirks from blocking context injection.

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