Skip to content

SessionStart hook check-config.sh exits 1 when configured #449

@edimuj

Description

@edimuj

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

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