- New skills: clawddocs, claude-code-usage, summarize, homeassistant, humanizer, self-improving-agent - Add .learnings/ for self-improvement tracking - Document proaktive cron config (LRN-20260126-001) - Update USER.md: Löchgau as former residence - Update TOOLS.md: Peekaboo workaround - Memory files for 2026-01-25 and 2026-01-26
18 lines
707 B
Bash
Executable File
18 lines
707 B
Bash
Executable File
#!/bin/bash
|
|
# Monitor Claude Code usage and send Telegram notifications on resets
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
OUTPUT=$("$SCRIPT_DIR/monitor-usage.sh" 2>&1)
|
|
|
|
# Check if a reset was detected (output contains "Reset notification sent")
|
|
if echo "$OUTPUT" | grep -q "Reset notification sent"; then
|
|
# Extract just the notification message (before "✅ Reset notification sent")
|
|
MESSAGE=$(echo "$OUTPUT" | sed '/✅ Reset notification sent/q' | sed '$ d')
|
|
|
|
# Send via Telegram using clawdbot
|
|
if command -v clawdbot >/dev/null 2>&1; then
|
|
# Use printf to handle newlines properly
|
|
printf '%s' "$MESSAGE" | clawdbot message send --telegram --target 5259918241
|
|
fi
|
|
fi
|