Files
gh-jamsajones-claude-squad/hooks/sessionStart.sh
2025-11-29 18:50:01 +08:00

38 lines
1.3 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Claude Squad Plugin - Session Start Hook
# Loads squad orchestration rules and agent delegation system
# Get the plugin directory path
PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# Check if squad is enabled (check both global and local)
SQUAD_ENABLED=false
if [ -f "$HOME/.claude/.squad_enabled" ] || [ -f "$PLUGIN_DIR/.squad_enabled" ]; then
SQUAD_ENABLED=true
fi
if [ "$SQUAD_ENABLED" = true ]; then
# Look for CLAUDE.md in plugin directory first, then global location
CLAUDE_FILE=""
if [ -f "$PLUGIN_DIR/CLAUDE.md" ]; then
CLAUDE_FILE="$PLUGIN_DIR/CLAUDE.md"
elif [ -f "$HOME/.claude/CLAUDE.md" ]; then
CLAUDE_FILE="$HOME/.claude/CLAUDE.md"
fi
# Check if CLAUDE.md exists
if [ -n "$CLAUDE_FILE" ] && [ -f "$CLAUDE_FILE" ]; then
echo "🤖 Claude Squad Plugin loaded - Agent delegation active"
echo "📋 Loading orchestration rules from CLAUDE.md..."
cat "$CLAUDE_FILE"
else
echo "⚠️ Warning: CLAUDE.md not found"
echo "Agent orchestration rules may not be properly configured."
echo "Plugin directory: $PLUGIN_DIR"
fi
else
echo " Claude Squad functionality disabled."
echo "Use /squad-on to enable agent delegation or install the claude-squad plugin."
fi