[Bug] explanatory-output-style plugin: session-start.sh has CRLF line endings, fails on macOS/Linux

Resolved 💬 6 comments Opened Jan 9, 2026 by hluisi Closed Mar 6, 2026

Bug Description

The explanatory-output-style plugin's session-start.sh hook script is packaged with Windows-style CRLF (\r\n) line endings. On macOS and Linux, bash interprets the carriage return as part of the command, causing the script to fail.

Steps to Reproduce

  1. Enable the explanatory-output-style plugin
  2. Start a new Claude Code session
  3. Observe "SessionStart:startup hook error" in the status line

Root Cause

$ file ~/.claude/plugins/cache/claude-plugins-official/explanatory-output-style/*/hooks-handlers/session-start.sh
# Output: ... with CRLF line terminators

$ hexdump -C ~/.claude/plugins/cache/claude-plugins-official/explanatory-output-style/48c672698523/hooks-handlers/session-start.sh | head -5
00000000  23 21 2f 75 73 72 2f 62  69 6e 2f 65 6e 76 20 62  |#!/usr/bin/env b|
00000010  61 73 68 0d 0a 0d 0a 23  ...                      |ash....# ...|
#                ^^^^^ CRLF here should be just 0a (LF)

When executed, bash produces errors like:

line 2: : command not found
exit: 0: numeric argument required

Workaround

Convert line endings manually:

sed -i '' 's/\r$//' ~/.claude/plugins/cache/claude-plugins-official/explanatory-output-style/*/hooks-handlers/session-start.sh

Expected Behavior

Plugin scripts should be packaged with Unix line endings (LF only) since they run in bash on macOS/Linux.

Environment

  • Claude Code: 2.1.2
  • Platform: macOS (darwin)
  • Shell: zsh/bash

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗