diff --git a/hooks/session-start.sh b/hooks/session-start.sh new file mode 100755 index 0000000..c777561 --- /dev/null +++ b/hooks/session-start.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# Claude Code Session-Start Hook +# Prüft auf Updates im Settings-Repo + +REPO_DIR="$HOME/dotfiles/claude_settings" + +cd "$REPO_DIR" 2>/dev/null || exit 0 + +# Fetch ohne Output +git fetch origin --quiet 2>/dev/null || exit 0 + +# Prüfe ob Updates vorhanden +LOCAL=$(git rev-parse HEAD 2>/dev/null) +REMOTE=$(git rev-parse origin/main 2>/dev/null) + +if [ "$LOCAL" != "$REMOTE" ]; then + BEHIND=$(git rev-list HEAD..origin/main --count 2>/dev/null) + echo "⚠ Claude Settings: $BEHIND neue Commits verfügbar!" + echo " → cd ~/dotfiles/claude_settings && git pull" +fi + +exit 0 diff --git a/settings.json b/settings.json index ffd8097..15ec8f4 100644 --- a/settings.json +++ b/settings.json @@ -1,9 +1,22 @@ { "statusLine": { "type": "command", - "command": "/home/rwiegand/.claude/statusline-command.sh" + "command": "$HOME/.claude/statusline-command.sh" }, "enabledPlugins": { "superpowers@claude-plugins-official": true + }, + "hooks": { + "SessionStart": [ + { + "hooks": [ + { + "type": "command", + "command": "$HOME/.claude/hooks/session-start.sh", + "timeout": 30 + } + ] + } + ] } }