Summary
hooks/scripts/check-config.sh exits with status 1 on every Claude Code session start when ~/.config/last30days/last-run.json does not yet exist (i.e. the user has installed the plugin and completed setup, but hasn't run /last30days yet, or LAST30DAYS_CONFIG_DIR points somewhere without a last-run.json).
Claude Code surfaces this as:
SessionStart:startup hook error
Failed with non-blocking status code: No stderr output
…on every startup, even though the hook is functionally succeeding.
Root cause
The script has set -euo pipefail and ends with:
if [[ -n "$HAS_SCRAPECREATORS" ]]; then
echo "/last30days: Ready — ${SOURCE_COUNT} sources active."
echo " Research any topic across social + market + web sources (last 30 days)."
[[ -n "$LAST_RUN_LINE" ]] && echo "$LAST_RUN_LINE"
else
...
[[ -n "$LAST_RUN_LINE" ]] && echo "$LAST_RUN_LINE"
echo " Tip: ..."
echo " ..."
echo " last30days has no affiliation with any API provider."
fi
In the if branch (ScrapeCreators configured), the last command executed is [[ -n "$LAST_RUN_LINE" ]] && echo "$LAST_RUN_LINE". When LAST_RUN_LINE is empty, the [[ ... ]] test fails, the short-circuit && skips the echo, and the script's final exit status becomes 1. set -e doesn't kill the script (an && chain in a compound statement is "tested"), but the script returns with $? = 1.
The else branch is fine because subsequent echo lines mask it.
Repro
- Install plugin (v3.2.4), complete setup so
SCRAPECREATORS_API_KEY is set.
- Don't run
/last30days (so no last-run.json).
- Start a new Claude Code session → "SessionStart:startup hook error".
$ bash hooks/scripts/check-config.sh; echo "exit=$?"
/last30days: Ready — 6 sources active.
Research any topic across social + market + web sources (last 30 days).
exit=1
Fix
Append exit 0 at the end of the script, or replace the trailing test with one that doesn't poison $?:
if [[ -n "$LAST_RUN_LINE" ]]; then echo "$LAST_RUN_LINE"; fi
Happy to send a PR if useful.
Environment
- macOS, /bin/bash 3.2
- last30days-skill 3.2.4
- Claude Code
Summary
hooks/scripts/check-config.shexits with status 1 on every Claude Code session start when~/.config/last30days/last-run.jsondoes not yet exist (i.e. the user has installed the plugin and completed setup, but hasn't run/last30daysyet, orLAST30DAYS_CONFIG_DIRpoints somewhere without alast-run.json).Claude Code surfaces this as:
…on every startup, even though the hook is functionally succeeding.
Root cause
The script has
set -euo pipefailand ends with:In the
ifbranch (ScrapeCreators configured), the last command executed is[[ -n "$LAST_RUN_LINE" ]] && echo "$LAST_RUN_LINE". WhenLAST_RUN_LINEis empty, the[[ ... ]]test fails, the short-circuit&&skips the echo, and the script's final exit status becomes 1.set -edoesn't kill the script (an&&chain in a compound statement is "tested"), but the script returns with$? = 1.The
elsebranch is fine because subsequentecholines mask it.Repro
SCRAPECREATORS_API_KEYis set./last30days(so nolast-run.json).Fix
Append
exit 0at the end of the script, or replace the trailing test with one that doesn't poison$?:Happy to send a PR if useful.
Environment