The check-config.sh SessionStart hook exits with code 1 on every session start when the plugin is configured, so Claude Code shows "SessionStart:startup hook error" in the header.
What's happening
The script has set -euo pipefail on line 2. The unconfigured code path (line 104-113) ends with exit 0, but the configured paths (lines 160-173) just fall through to end-of-script. The last thing that runs is:
[[ -n "$LAST_RUN_LINE" ]] && echo "$LAST_RUN_LINE"
When last-run.json doesn't exist (pretty common -- it's only created after the first /last30days run), $LAST_RUN_LINE is empty, the [[ -n ... ]] test returns false (exit code 1), and set -e makes that the script's exit code.
Fix
Add exit 0 at the end of the script (after line 173). Or swap the [[ -n ... ]] && echo pattern for an if-statement.
Environment
- Version: 3.3.0
- Platform: Ubuntu Linux
- Node: v24.15.0
Repro
export CLAUDE_PLUGIN_ROOT="/path/to/last30days/3.3.0"
bash "$CLAUDE_PLUGIN_ROOT/hooks/scripts/check-config.sh"
echo $? # prints 1
The
check-config.shSessionStart hook exits with code 1 on every session start when the plugin is configured, so Claude Code shows "SessionStart:startup hook error" in the header.What's happening
The script has
set -euo pipefailon line 2. The unconfigured code path (line 104-113) ends withexit 0, but the configured paths (lines 160-173) just fall through to end-of-script. The last thing that runs is:When
last-run.jsondoesn't exist (pretty common -- it's only created after the first/last30daysrun),$LAST_RUN_LINEis empty, the[[ -n ... ]]test returns false (exit code 1), andset -emakes that the script's exit code.Fix
Add
exit 0at the end of the script (after line 173). Or swap the[[ -n ... ]] && echopattern for an if-statement.Environment
Repro