From 7aec5006ff54c77e89c29f7971e2f9ce01318528 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 26 Jan 2026 10:27:29 +0100 Subject: [PATCH] =?UTF-8?q?SessionStart=20Hook=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - hooks/session-start.sh prüft auf Updates im Repo - settings.json mit Hook-Konfiguration erweitert - $HOME statt hardcoded Pfad für Geräte-Kompatibilität Co-Authored-By: Claude Opus 4.5 --- hooks/session-start.sh | 22 ++++++++++++++++++++++ settings.json | 15 ++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 hooks/session-start.sh 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 + } + ] + } + ] } }