fix: 코드리뷰 보강 — .gitignore 화이트리스트 + 훅 case 정밀화
- .gitignore: .claude/** 차단 + settings.json·md negation 화이트리스트로 전환. settings.local.json/projects·history·todos·cache 등 머신 전용 파일 누수 차단. - .claude/settings.json: PreToolUse 훅 case 패턴을 첫 토큰 정확 매칭으로 교체. *grep* 과매칭(egrep·git grep·grepl) 및 rg 단독 미매칭 문제 해소. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
26b1e31d74
commit
29c60c0b54
@ -6,7 +6,7 @@
|
|||||||
"hooks": [
|
"hooks": [
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "CMD=$(python3 -c \"import json,sys; d=json.load(sys.stdin); print(d.get('tool_input',d).get('command',''))\" 2>/dev/null || true); case \"$CMD\" in *grep*|*rg\\ *|*ripgrep*|*find\\ *|*fd\\ *|*ack\\ *|*ag\\ *) [ -f graphify-out/graph.json ] && echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"graphify: Knowledge graph exists. Read graphify-out/GRAPH_REPORT.md for god nodes and community structure before searching raw files.\"}}' || true ;; esac"
|
"command": "CMD=$(python3 -c \"import json,sys; d=json.load(sys.stdin); print(d.get('tool_input',d).get('command',''))\" 2>/dev/null || true); set -- $CMD; case \"$1\" in grep|egrep|fgrep|rg|ripgrep|find|fd|ack|ag) [ -f graphify-out/graph.json ] && echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"graphify: Knowledge graph exists. Read graphify-out/GRAPH_REPORT.md for god nodes and community structure before searching raw files.\"}}' || true ;; esac"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
8
.gitignore
vendored
8
.gitignore
vendored
@ -65,5 +65,11 @@ graphify-out/
|
|||||||
!.agents/**/*.md
|
!.agents/**/*.md
|
||||||
!.claude/**/*.md
|
!.claude/**/*.md
|
||||||
|
|
||||||
# [local-only 2026-05-12] .claude/worktrees 는 git worktree 메타라 추적 제외
|
# [local-only 2026-05-12] .claude 는 화이트리스트 방식 — settings.json + md 만 추적
|
||||||
|
# 머신 전용(settings.local.json, projects/, history.jsonl, todos/, cache/ …) 은 모두 차단
|
||||||
|
.claude/**
|
||||||
|
!.claude/**/
|
||||||
|
!.claude/settings.json
|
||||||
|
!.claude/**/*.md
|
||||||
|
.claude/settings.local.json
|
||||||
.claude/worktrees/
|
.claude/worktrees/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user