From 8684c3e6db15c0069092dfd0d168ee5f2e9125f2 Mon Sep 17 00:00:00 2001 From: swrring Date: Thu, 16 Apr 2026 21:18:40 +0900 Subject: [PATCH] =?UTF-8?q?fix(live):=20SessionStart=20hook=EC=97=90=20?= =?UTF-8?q?=EB=8D=94=EB=AF=B8=20=EF=BF=BD=EF=BF=BD=EF=BF=BD=EC=9D=BC=20?= =?UTF-8?q?=EC=9E=90=EB=8F=99=20=EB=B9=84=EC=9A=B0=EA=B8=B0=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 세션 ��시작 시 원본이 ��로 로드되므로 더미는 역할 완료. live_session_load.sh가 로드 후 자동 삭제 + 증분 카운터 정리. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/live_session_load.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/scripts/live_session_load.sh b/scripts/live_session_load.sh index 2f6a953..939f56d 100644 --- a/scripts/live_session_load.sh +++ b/scripts/live_session_load.sh @@ -1,7 +1,7 @@ #!/bin/bash -# SessionStart hook — .claude/live/ 전량 로드 (세션 시작 시) -# 세션 시작 시점에 모든 live 더미 파일을 읽어서 컨텍스트에 주입 -# 증분 카운터도 리셋하여 다음 턴부터 증분 추적 시작 +# SessionStart hook — .claude/live/ 전량 로드 + 자동 비우기 (세션 시작 시) +# 세션 재시작 시 원본이 새로 로드되므로 더미는 역할 완료 → 비우기 +# 흐름: 더미 로드(알림) → 더미 삭제 → 증분 카운터 정리 REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) [ -z "$REPO_ROOT" ] && exit 0 @@ -42,6 +42,22 @@ done if [ "$FILE_COUNT" -gt 0 ]; then echo "📝 [Live 세션 로드] ${FILE_COUNT}개 더미 파일:$OUTPUT" + + # 원본이 새로 로드되었으므로 더미 파일 자동 비우기 (README.md 제외) + CLEANED=0 + for LIVE_FILE in "$LIVE_DIR"/*.md "$LIVE_DIR"/*.json; do + [ ! -f "$LIVE_FILE" ] && continue + BASENAME=$(basename "$LIVE_FILE") + [ "$BASENAME" = "README.md" ] && continue + rm -f "$LIVE_FILE" 2>/dev/null && CLEANED=$((CLEANED + 1)) + done + + # 증분 카운터도 정리 + rm -f "$THROTTLE_DIR"/live_lastline_* 2>/dev/null + + if [ "$CLEANED" -gt 0 ]; then + echo "🧹 [Live 정리] ${CLEANED}개 더미 파일 자동 삭제 완료 (원본 로드됨)" + fi fi exit 0