Skip to content

Commit 1313bef

Browse files
committed
Fix: Intelligent notifications now show periodic reminders
- Updated conversation-capture-user-prompt.sh notification logic - Replaced daily suppression (sync-notified- flag) with 2-hour periodic reminders - New system tracks last notification time in last-sync-notification file - Shows notification every 2 hours during high activity (>50 ops) - Updated memory-sync command to record sync timestamp - Added step 2 in memory-sync process to update last-memory-sync file - Fixes issue where notifications only showed once per day Impact: - Notifications now visible when activity > 50 ops - Users get periodic reminders if they don't run /memory-sync - System tracks actual sync execution via timestamp file - Better user experience with actionable reminders Testing: - Verified with 162 ops showing notification correctly - Tested periodic reminder logic (2-hour intervals) - Confirmed notification suppression works between intervals
1 parent 0f49a00 commit 1313bef

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.claude/commands/memory-sync.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Synchronize all memory bank files with current session context
33
argument-hint: "[--full] [--quick]"
4-
allowed-tools: Read(*), Write(*), Edit(*), Bash(date:*)
4+
allowed-tools: Read(*), Write(*), Edit(*), Bash(date:*), Bash(echo:*)
55
---
66

77
# Memory Sync — Universal Context Synchronization
@@ -50,24 +50,28 @@ The `/memory-sync` command provides intelligent synchronization of your memory b
5050
- Detect technical decisions made
5151
- Extract progress milestones
5252

53-
2. **Update Active Context**
53+
2. **Record Sync Timestamp** (IMPORTANT - do this FIRST)
54+
- Update `.claude/tmp/last-memory-sync` with current Unix timestamp: `date +%s > .claude/tmp/last-memory-sync`
55+
- This tracks when sync was performed for notification system
56+
57+
3. **Update Active Context**
5458
- Append session summary with timestamp
5559
- Update current focus if changed
5660
- Add new blockers discovered
5761
- Record achievements completed
5862

59-
3. **Update Progress (if --full)**
63+
4. **Update Progress (if --full)**
6064
- Move completed items to ✅ COMPLETED section
6165
- Update in-progress status
6266
- Add new pending tasks
6367
- Update sprint progress percentage
6468

65-
4. **Record Decisions (if --full)**
69+
5. **Record Decisions (if --full)**
6670
- Extract technical decisions from conversation
6771
- Format as ADR (Architecture Decision Record)
6872
- Append to decisionLog.md with timestamp
6973

70-
5. **Update Patterns (if applicable)**
74+
6. **Update Patterns (if applicable)**
7175
- Detect new coding patterns adopted
7276
- Record architectural changes
7377
- Update technology stack if changed

.claude/hooks/conversation-capture-user-prompt.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,22 @@ if [ "$activity_count" -gt 50 ]; then
9292
notifications="${notifications}🔄 High activity ($activity_count ops) + ${hours_since_sync}h since last sync. Run /memory-sync --full. "
9393
fi
9494
else
95-
# No sync record exists, suggest it
96-
sync_notified_flag="$CLAUDE_TMP/sync-notified-$today"
97-
if [ ! -f "$sync_notified_flag" ]; then
95+
# No sync record exists - check when we last notified
96+
last_notification_file="$CLAUDE_TMP/last-sync-notification"
97+
98+
if [ -f "$last_notification_file" ]; then
99+
last_notification=$(cat "$last_notification_file" 2>/dev/null || echo "0")
100+
hours_since_notification=$(( (current_time - last_notification) / 3600 ))
101+
102+
# Show reminder every 2 hours during high activity
103+
if [ "$hours_since_notification" -gt 2 ]; then
104+
notifications="${notifications}🔄 High activity ($activity_count ops) - no sync record. Consider /memory-sync --full. "
105+
echo "$current_time" > "$last_notification_file"
106+
fi
107+
else
108+
# First notification
98109
notifications="${notifications}🔄 High activity detected ($activity_count ops). Consider /memory-sync --full. "
99-
touch "$sync_notified_flag"
110+
echo "$current_time" > "$last_notification_file"
100111
fi
101112
fi
102113
fi

0 commit comments

Comments
 (0)