context_watch.ps1: nu mai raporteaza contextul altei sesiuni

La primul mesaj dintr-o sesiune noua transcriptul .jsonl inca nu e creat, asa
ca Test-Path pica si scriptul cadea pe fallback-ul "cel mai recent .jsonl din
directorul proiectului" - adica transcriptul sesiunii precedente, anuntand un
context de sute de k intr-o sesiune goala. Cand calea vine ca parametru sau pe
stdin si nu exista, iese tacut; fallback-ul pe director ramane doar pentru
invocarea manuala, fara cale.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UKTBDwMB1dAoN4DPBa1b2m
This commit is contained in:
2026-08-05 22:21:32 +03:00
parent 4d1179f8e5
commit 54d97c0349

View File

@@ -19,7 +19,9 @@ if (-not $TranscriptPath) {
try { $TranscriptPath = (ConvertFrom-Json $stdin).transcript_path } catch { }
}
}
if (-not $TranscriptPath -or -not (Test-Path $TranscriptPath)) {
# la primul mesaj al unei sesiuni noi transcriptul inca nu e creat: fara fallback, ca sa nu raporteze alta sesiune
if ($TranscriptPath -and -not (Test-Path $TranscriptPath)) { exit 0 }
if (-not $TranscriptPath) {
$dir = Join-Path $env:USERPROFILE ".claude\projects\$((Get-Location).Path -replace '[:\\/]','-')"
if (Test-Path $dir) {
$f = Get-ChildItem "$dir\*.jsonl" | Sort-Object LastWriteTime -Descending | Select-Object -First 1