Skip to content
This repository was archived by the owner on Oct 20, 2026. It is now read-only.

v5.18.2 — pre-tool-use-record.sh — stdin JSON 파싱으로 tool_name 추출

Choose a tag to compare

@jay-swk jay-swk released this 23 Apr 04:15
· 193 commits to main since this release

fix(v5.18.2): pre-tool-use-record.sh — stdin JSON 파싱으로 tool_name 추출

v5.18.1 marketplace pull + reload 후 실기 검증에서 tool_call 이벤트의 'tool' 값이 'unknown'으로 기록됨을 발견. 원인은 $TOOL_NAME 환경변수 가정이 Claude Code hooks 공식 스펙과 불일치 — 실제 스펙은 stdin으로 JSON 전달(.tool_name 필드).

수정

  • hooks/pre-tool-use-record.sh: stdin JSON 파싱으로 전환, jq로 .tool_name 추출
  • 3단 fallback: stdin JSON 있음 → stdin empty + TOOL_NAME env → tty 수동 실행 'manual'
  • Privacy 유지: tool_input 참조 제거 (주석 포함)

검증

  • stdin JSON {"tool_name":"Bash"} → tool:'Bash' ✓
  • stdin empty + TOOL_NAME=TestManual → tool:'TestManual' ✓
  • 전체 테스트 457/457 PASS

전체 v5.18 시리즈 클로저

  • v5.18.0: tool_call 기록 훅 인프라 (하지만 matcher '*' 결함)
  • v5.18.1: matcher '*' → '' 수정 (하지만 $TOOL_NAME env 가정 결함)
  • v5.18.2: stdin JSON 파싱 (실제 Claude Code 스펙 준수) ← 실측 tool_call 가능

본 릴리스가 Tier 3.1 Behavior Learning의 완전한 클로저.

Removed

v5.18.0~v5.18.1의 $TOOL_NAME 환경변수 가정 제거 — Claude Code hooks 공식 스펙은 stdin JSON 전달(.tool_name). 실기 검증에서 2회의 '건물은 있는데 입주자 없음' 발견(매처 regex 오류 → 환경변수 미전달). 양쪽 모두 릴리스마다 실측으로 판별, 규칙 추가-only가 아닌 가지치기 문화 유지.