Files
claude-code/automation/pa-summarize
2025-12-29 02:17:56 -08:00

22 lines
813 B
Bash
Executable File

#!/usr/bin/env bash
# PA Summarize - Extract session summary before shutdown
set -euo pipefail
# This script is called by tmux hook or manually
# It sends a summarization request to the running claude session
SESSION_NAME="pa"
if ! tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
echo "No PA session running"
exit 1
fi
# Send summarization prompt to the tmux pane
# The PA agent will handle extracting and saving to memory files
tmux send-keys -t "$SESSION_NAME" \
"Please summarize this session for long-term memory. Extract key decisions, preferences learned, project context, and facts into the appropriate memory files in ~/.claude/state/personal-assistant/memory/. Then mark this session as summarized in the history index." \
Enter
echo "Summarization request sent to PA session"