파일 tail, Windows/git-bash 경로 호환, watchfiles+polling fallback, cwd 필드 기반 slug 폴백, 서브에이전트 JSONL 자동 발견 작업 시 사용. watcher.py, locator.py, subagent_watcher.py, subagent_locator.py 수정 시 반드시 이 스킬을 사용할 것.
파일 tail과 세션 로케이터의 크로스 플랫폼 호환성 가이드.
locator.py의 _norm() 함수가 핵심:
def _norm(p: str) -> str:
s = p.replace("\\", "/").rstrip("/")
if len(s) >= 2 and s[1] == ":": # Windows drive letter
s = s.lower()
return s
SessionLocator.find_active() 폴백 체인:
~/.claude/projects/{slug-of-cwd}/ 하위 최신 JSONLcwd 필드를 읽어 현재 작업 디렉토리와 비교~/.claude/projects/*/ 하위 가장 최신 JSONLcwd 필드 폴백을 제거하면 Windows/git-bash에서 세션을 찾지 못한다. 이 경로는 보존해야 한다.
세션 선택 근거 추적용 리터럴:
ChosenReason = Literal[
"slug", "fallback", "cwd-match", "none",
"override", "picker", "switched", "path-input",
]
새 reason 추가 시 이 타입에 반드시 등록하라. 타입 체커가 누락을 잡아준다.
watchfiles 라이브러리 기반, 파일 변경 이벤트 구독MAX_BUFFER_BYTES = 1_048_576: 1 MiB 초과 라인 드롭subagent_watcher.py:
subagents/ 하위에서 agent-*.jsonl 패턴 감시subagent_locator.py가 agent UUID → JSONL 경로 매핑session_path_input.py 모달:
~/.claude/projects/**/ 하위 glob 해석| 플랫폼 | 핵심 검증 항목 |
|---|---|
| macOS/Linux | slug 디렉토리 매칭 |
| Windows | 드라이브 레터 정규화, 백슬래시 변환 |
| git-bash | cwd 필드 폴백 (slug 패턴 불일치) |
| CI (no watchfiles) | PollingTailer 폴백 |