Files
DefVideo/.claude/hooks/session-context.sh
한성일 82662d417d 초기 커밋: DefVideo 소스 등록
abcVideo 플레이어 소스 (client / server / shared / pythonsource / docs / .claude).
.gitignore 적용으로 node_modules·storage·samplevideo·미디어 등 대용량 일괄 제외.
103 files, ~964K.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 03:20:27 +00:00

30 lines
1.0 KiB
Bash

#!/usr/bin/env bash
# UserPromptSubmit 훅: 프로젝트 컨텍스트 주입
# path.json 의 history_path 아래 최근 작업 문서를 읽어 출력
set -euo pipefail
HOOKS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PATH_JSON="$HOOKS_DIR/path.json"
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(cd "$HOOKS_DIR/../.." && pwd)}"
if command -v jq &>/dev/null && [[ -f "$PATH_JSON" ]]; then
history_rel=$(jq -r '.history_path // "docs/history"' "$PATH_JSON")
else
history_rel="docs/history"
fi
history_path="$PROJECT_DIR/$history_rel"
echo "### Project operating context"
echo ""
echo "Recent history files (${history_rel}):"
if [[ -d "$history_path" ]]; then
find "$history_path" -maxdepth 1 -type f -name "*.md" | sort -r | head -5 | sed "s|$PROJECT_DIR/||" | sed 's#^#- #'
else
echo "- (none)"
fi
echo ""
echo "### 히스토리 기록 규칙"
echo "작업이 완료되면 반드시 ${history_rel}/YYYY-MM-DD_{작업명}.md 파일을 작성하라."
echo "필수 항목: **소요 시간**, **Context 사용량** (누락 시 저장 차단됨)"