#!/usr/bin/env bash
set -euo pipefail
: "${REAL_CLAUDE:?Set REAL_CLAUDE to the real Claude executable}"
: "${STARTUP_DELAY_LOG:?Set STARTUP_DELAY_LOG to a fresh log file}"
case " $* " in
  *stream-json*)
    printf 'BOOT_DELAY_BEGIN %s pid=%s\n' "$(date -u +%FT%T.%3NZ)" "$$" >> "$STARTUP_DELAY_LOG"
    sleep 15
    printf 'BOOT_DELAY_END %s pid=%s\n' "$(date -u +%FT%T.%3NZ)" "$$" >> "$STARTUP_DELAY_LOG"
    ;;
esac
exec "$REAL_CLAUDE" "$@"
