From 54d97c0349dab1dd7db0e0040858b0ffbdedaa5c Mon Sep 17 00:00:00 2001 From: Marius Mutu Date: Wed, 5 Aug 2026 22:21:32 +0300 Subject: [PATCH] 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) Claude-Session: https://claude.ai/code/session_01UKTBDwMB1dAoN4DPBa1b2m --- utile/context_watch.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utile/context_watch.ps1 b/utile/context_watch.ps1 index cadd815..78e1745 100644 --- a/utile/context_watch.ps1 +++ b/utile/context_watch.ps1 @@ -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