Reviews a long-running Node.js script on Windows (a watcher, poller or worker that runs day and night) and the .cmd or .bat file that starts and stops it, for the ways it freezes or dies without a trace. Finds a script that prints to its console window (one click in the window freezes it), a script started in a console window that ends when someone closes it, a lock file that holds only a PID, a state file written without fsync and read back as empty when broken, a .pipe() into gunzip that kills the process when a connection drops, process.exit() after fetch ending in code 127, a parenthesis inside an if block of a .cmd, timeout in a .cmd with no console, and a .cmd saved with LF line endings. Gives the fix in code for each finding and ends a review with VERDICT: OK or VERDICT: CHANGE; a symptom question gets the cause first. Use when asked to review a 24/7 Node script or its start and stop .cmd on Windows, or why such a script stopped, froze, or says it is already running.
Windows Background Script Review for Node.js is a SKILL.md that reviews a long-running Node.js script on Windows (a watcher, poller or worker that runs day and night) and the .cmd or .bat file that starts and stops it, for the ways it freezes or dies without a trace; an agent buys it once for $0.05 over x402.
Not for
Linux, macOS and Windows services written in other languages. It does not choose a process manager, set up restart after a reboot, or judge the PC's power settings. The facts come from a single Windows 11 PC running Node 24; other Windows builds were not tried. It reviews code and answers questions; it does not run or stop anything on your computer.
Tested, honestly
Tested 2026-11-22 with a strong and a weak model.
With and without the skill
Results with and without the skill, for Sonnet and Haiku |
| with | without | with | without |
|---|
| Inputs judged right (12 inputs) |
| Inputs judged right (12 inputs) | 12/12 | 8/12 | 10/12 | 5/12 |
|---|
Same request on both sides, scored on the point in any words. Read by hand, Sonnet without the skill already knew the .pipe() crash on a dropped download, the 127 exit after fetch, the bracket inside an if block, timeout with no console, and fsync with a kept copy. It missed two measured facts that break a running setup: it never said that closing the minimized window ends the script (it only switched QuickEdit off), and it judged a stale lock by the image name node.exe instead of the command line. On a sound stop file and a sound lock it raised two dangers measured not to happen. Haiku without the skill was right on five: it missed the closed window and the bracket in the echo, and raised a false alarm on every sound input. With the skill Haiku was right on ten, with extra edge cases on two sound inputs.
Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.
- SonnetStrong model, claude-sonnet-5-5
- Right on all 12 inputs on the 1.0.1 bytes, read by hand. It said that closing the minimized console window ends the script, as a finding of its own next to the click freeze, and moved the start to Start-Process -WindowStyle Hidden with a window that only reads the log. It replaced a bare-PID lock check with the command line of that process, named the ) that an echo line ends inside an if block of the stop file, timeout with no console under execFile, the save without fsync together with the load that turns a broken file into an empty state, and .pipe() into gunzip that takes the whole process down, and it traced exit code 127 to process.exit() after fetch. It answered OK on all five sound inputs, including the stop file that runs PowerShell from execFile and the lock that links its file and checks the command line.
- HaikuWeak model, claude-haiku-5-5
- Right on 10 of 12 on the 1.0.1 bytes, read by hand. It found the console window that ends the script when closed, the bare-PID lock, the bracket in an echo inside an if block, timeout with no console, the save without fsync, .pipe() into gunzip and the 127 exit after fetch, and it answered OK on three sound inputs, the stop file among them, but it missed the OK verdict on two: on the sound lock it asked for a guard against two copies started in the same moment, which the skill lists as measured not to be needed, and on the sound pipeline it raised the exit code of the crash handler, which nothing reads.
Full test summary
Example
Our own test text, before and after the skill ran. Excerpts only.
English · claude-sonnet-5-5
Before
Before I start using it: our catalog scout has to run day and night on the office PC (Windows 11). I start it by
double-clicking start-scout.cmd; between cycles the scout sleeps, and everything it does goes through log() below.
:: start-scout.cmd
@echo off
rem start-scout.cmd - starts the catalog scout; it keeps running day and night, minimized on the taskbar
cd /d "%~dp0"…
After
**[WINDOW-DEATH]** `start-scout.cmd`, last line: `start "catalog-scout" /min node scout.mjs`
The scout runs inside a minimized console window and belongs to it. A minimized window looks idle, so someone will close it, and the scout ends with it, with no error and no last line in the log. The comment "minimized on the taskbar" describes exactly this setup.…
What is in the file
- Facts this review rests on
- What to check, in this order
- 1. Where the script lives
- 2. The lock
- 3. Saving state
- 4. Streams, crashes and the exit code
- 5. The start and stop `.cmd` files
- Symptom questions
- Answer format
- Not a finding
- What not to do
Languages
Any language. Tried in: English.
License
Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.
Versions
Current version 1.0.1, updated 2026-11-22. Whoever bought an earlier version gets new ones free through the same re-download token.
v1.0.1 · 2026-11-22
Two sentences reworded with the same meaning, so that no published post on our blog shares a run of five words with the file (the blog build checks this). The side with the skill was run again in full on the new bytes, one run per model and input: Sonnet 12 of 12, Haiku 10 of 12 (was 9). The side without the skill is unchanged: 8 and 5 of 12.
v1.0.0 · 2026-11-22
- First version. - Changed before the first publish, after the first model run: a closed console window is now a finding of its own, kept apart from the click freeze in every review; a correct hidden start (and its log viewer) is named as fine; a start or stop .cmd that nobody has run yet is no longer a finding, because that code had turned a sound start file into a change request. Running a fixed .cmd in both states stays as advice inside the fix. - Test: the check for the closed-window fact was widened for both sides after reading the answers, to accept the window named in one sentence and closed as "it" in the next; the control gained that phrasing as a right answer and "closing it is harmless" as a wrong one. - Model run (22 November 2026, one run per model and input): on the final wording Sonnet was right on 12 of 12 with the skill and 8 of 12 without, Haiku on 10 of 12 with and 5 of 12 without. The first wording, run once before the fix above: Sonnet 11 of 12, Haiku 9 of 12. Price: 0.05 USD (50000 micro), set by a Sonnet gain of four inputs (two measured facts it lacked, two measured non-problems it raised). - After that run, two lines were reworded for the safety gate with no change in behaviour: the hidden start line in the .cmd example begins with @, which a batch file runs the same way, and the ping wait names localhost (measured on 22 November 2026 with no console on input: 3.1 s, the same as the numeric loopback address). - Skill side re-run in full on the final bytes, 22 November 2026: Sonnet 12 of 12, Haiku 9 of 12.
FAQ
Long-running Node scripts: which ones does it review?
A Node.js program that is meant to run for days on a Windows PC without anyone watching, such as a crawler, a feed watcher or a queue worker, together with the .cmd file that starts it and the one that stops it. The review looks for what ends or freezes such a program without leaving a message: a click inside its console window, a window someone closes, a lock file left over from before a power cut, a half-written state file, a stream that kills the process, and a batch file that quietly stops halfway.
How does it tell a stale lock from a running script?
Windows hands out process numbers again after a restart, so a number in a lock file proves nothing, and neither does the name node.exe. The skill asks for the command line of that process and compares it with the script's own file name. The question takes about half a second, so it is asked once at start. If the check itself cannot be made, the safer answer is to assume the holder is real and not start a second copy.
Does it help Claude Sonnet?
On four inputs out of twelve, yes. Sonnet got the same twelve requests with and without the skill: seven start files, stop files and modules with a planted Windows fault or a symptom, plus five sound twins. Alone it got eight; it knew the .pipe() crash, the 127 exit after fetch, the bracket in an if block, timeout with no console and the missing fsync. It never said that closing the minimized window ends the script, trusted node.exe in tasklist for an old lock, and raised two measured non-problems on sound inputs. With the skill: twelve. Haiku went from five to ten.