diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 301e454..23997cc 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -164,6 +164,23 @@ Never ask "What did we do last time?" or "What's the server IP?" — read the CO - **Sequential Thinking:** Use for genuine complexity — rejection loops, 3+ critical issues, architectural decisions - **Task Management:** Complex work (>3 steps) → TaskCreate. Persist to `.claude/active-tasks.json`. +### Cross-User Messages (MANDATORY) + +After every `/sync` — and whenever reading any session log from another user — scan for sections named `## Note for ` or `## Message for `. If found: + +1. Display the full note content **prominently at the top of the response**, before sync status or anything else, formatted as: + ``` + ============================================================ + MESSAGE FROM () + ============================================================ + + ============================================================ + ``` +2. Explicitly address each action item or question in the note before moving on. +3. Do not bury these in the sync summary or skip them because other work is in progress. + +This applies to ALL session logs pulled during sync, not just the most recent one. + --- ## Context Recovery diff --git a/.claude/scripts/sync.sh b/.claude/scripts/sync.sh index 4a3957b..c47b69f 100755 --- a/.claude/scripts/sync.sh +++ b/.claude/scripts/sync.sh @@ -156,12 +156,54 @@ else echo -e "${GREEN}[OK]${NC} Nothing to push." fi -# Phase 5: Summary +# Phase 5: Scan pulled session logs for cross-user messages +# Look for "## Note for" or "## Message for" sections in any session log +# touched by incoming commits. Print them prominently so they aren't missed. +if [ "$INCOMING_COUNT" -gt 0 ] && [ -n "$LOCAL_BEFORE" ]; then + CHANGED_LOGS=$(git diff --name-only "$LOCAL_BEFORE"..HEAD -- '**/session-logs/*.md' 'session-logs/*.md' 2>/dev/null || true) + if [ -n "$CHANGED_LOGS" ]; then + NOTES_FOUND=0 + for LOG_FILE in $CHANGED_LOGS; do + if [ -f "$LOG_FILE" ]; then + # Extract author from "## User" block and any "## Note for" / "## Message for" sections + NOTE_CONTENT=$(awk ' + /^## (Note|Message) for /{ in_note=1; header=$0; next } + in_note && /^## /{ in_note=0 } + in_note{ buf=buf"\n"$0 } + END{ if(buf) print header buf } + ' "$LOG_FILE") + if [ -n "$NOTE_CONTENT" ]; then + if [ "$NOTES_FOUND" -eq 0 ]; then + echo "" + echo -e "${YELLOW}============================================================${NC}" + echo -e "${YELLOW} MESSAGES FROM OTHER TEAM MEMBERS${NC}" + echo -e "${YELLOW}============================================================${NC}" + NOTES_FOUND=1 + fi + LOG_AUTHOR=$(awk '/^- \*\*User:\*\*/{print; exit}' "$LOG_FILE" | sed 's/.*\*\*User:\*\* //') + LOG_DATE=$(basename "$LOG_FILE" | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}' | head -1) + echo "" + echo -e "${YELLOW} From: ${LOG_AUTHOR:-unknown} | ${LOG_DATE:-unknown date} | ${LOG_FILE}${NC}" + echo -e "${YELLOW}------------------------------------------------------------${NC}" + echo "$NOTE_CONTENT" + fi + fi + done + if [ "$NOTES_FOUND" -gt 0 ]; then + echo "" + echo -e "${YELLOW}============================================================${NC}" + echo -e "${YELLOW} Address the above before continuing with other work.${NC}" + echo -e "${YELLOW}============================================================${NC}" + echo "" + fi + fi +fi + +# Phase 6: Summary echo "" echo "=== Sync Summary ===" if [ "$INCOMING_COUNT" -gt 0 ]; then - # Count commits by author INCOMING_AUTHORS=$(git log --format='%an' $LOCAL_BEFORE..HEAD 2>/dev/null | sort | uniq -c | sort -rn | awk '{printf "%s (%s), ", substr($0, index($0,$2)), $1}' | sed 's/, $//') echo -e "${CYAN}Pulled in:${NC} $INCOMING_COUNT commit(s) — authors: ${INCOMING_AUTHORS:-unknown}" fi