feat: surface cross-user messages prominently on sync
sync.sh: after pull, scan changed session logs for "## Note for" / "## Message for" sections and print them in a highlighted block before the sync summary. Forces attention on inter-team messages. CLAUDE.md: document mandatory behavior — cross-user notes displayed at top of response with full content, action items addressed before continuing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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 <user>` or `## Message for <user>`. 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 <AUTHOR> (<date>)
|
||||
============================================================
|
||||
<full note content>
|
||||
============================================================
|
||||
```
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user