Add history tracking hooks and project structure
- Add docs/history/ directory for work history files - Add PROGRESS.md for project status tracking - Add .claude/settings.json with Gitea MCP permissions - Gitea issue #1: 히스토리 및 AI 사용량 추적 시스템 설정 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
38
historyhooks/guard-history-reminder.sh
Normal file
38
historyhooks/guard-history-reminder.sh
Normal file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# Stop 훅: 작업 완료 후 히스토리 기록 리마인더
|
||||
# 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_path=$(jq -r '.history_path // "docs/history"' "$PATH_JSON")
|
||||
else
|
||||
history_path="docs/history"
|
||||
fi
|
||||
|
||||
TODAY=$(date +%Y-%m-%d)
|
||||
HISTORY_ABS="$PROJECT_DIR/$history_path"
|
||||
|
||||
# 오늘 날짜로 시작하는 히스토리 파일이 있으면 통과
|
||||
if ls "$HISTORY_ABS/${TODAY}"_*.md 2>/dev/null | grep -q .; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cat >&2 <<EOF
|
||||
[HISTORY REQUIRED] 오늘(${TODAY}) 작업 히스토리가 없습니다.
|
||||
|
||||
아래 형식으로 파일을 작성하고 저장하세요:
|
||||
${history_path}/${TODAY}_{작업명}.md
|
||||
|
||||
필수 항목:
|
||||
**소요 시간**: X분
|
||||
**Context 사용량**: input Xk / output Xk tokens
|
||||
**이슈**: #N
|
||||
|
||||
히스토리 파일 저장 완료 후 응답이 종료됩니다.
|
||||
EOF
|
||||
|
||||
exit 2
|
||||
Reference in New Issue
Block a user