·5 min read
Every AI run died in 2 seconds, and nothing said why
The worst kind of failure is the one that looks like success. In August every AI run in DailyBrief, whether a check, a brief, a question or a code execution, ended in about two seconds with an empty result and no visible error. The scripts ran, the CLI was called, and nothing came back.
Two seconds is far too fast for a model call. The answer was a file that was exactly where it should be and was not what it claimed to be.
- Project
- DailyBrief
- Date
- Aug 2026
- Stack
- PowerShell 5.1, Electron, Claude Code CLI
- Commit
- 0306535
What broke
DailyBrief does not call a model API. It runs the Claude Code CLI headless, from PowerShell, with the prompt on stdin. That means the whole app depends on one executable being installed correctly on the machine.
On my machine an npm global install had left things in a half-finished state. The launcher claude.cmd was in place. The platform-native binary it starts, an optional dependency of the package, was missing, and in its place node_modules\@anthropic-ai\claude-code\bin\claude.exe was a tiny text stub. When the stub is launched, Windows answers with "This version of ... is not compatible with the version of Windows you're running."
That message never reached me. The output was empty, and from the app's side the result was simply "no answer". Check, brief, ask and execute all failed the same way, in about two seconds.
What the code showed
All four scripts had the same path hardcoded at the top, one line each in ask.ps1, daily-brief.ps1, execute.ps1 and kanban-check.ps1:
$claude = 'C:\...\nvm\v22.22.3\claude.cmd'The path pointed at a .cmd file that existed, so every sanity check I could have written, such as Test-Path, would have passed. The thing that was broken was not the file the script pointed at but the file that file launched. A .cmd is only a launcher, and a launcher can be perfectly healthy while its target is a stub.
There was a second problem hiding behind the first: one path in four copies. Each fix would have needed four edits, and the next Node version bump, which moves the install folder, would have broken all four again.
The fix
Commit 0306535 (Aug 2026) moved the lookup into one file, core/claude-path.ps1, which all four scripts dot-source. It walks a list of candidate launchers and accepts one only if the binary behind it is real. The comment gives the test directly: the real binary is hundreds of MB, the stub is under 1 KB.
# Real binary is hundreds of MB; the "not installed" stub is under 1 KB.
if ((Get-Item $exe).Length -gt 1MB) { return $c }If no candidate passes, the script now throws a message a person can act on, instead of letting the failure go quiet. It says no working claude CLI was found, that the native binary is missing, and to reinstall with npm install -g @anthropic-ai/claude-code.
Stub, at most 1 KB
Threshold in the code (1 MB)
The resolver was not finished after that commit. Four days later 1ff4975 (Aug 2026) widened it. Its comment explains that only looking for claude.cmd is what made every run fail again after the CLI was reinstalled natively, as a single claude.exe with no .cmd next to it. The resolver now checks PATH, the native install location and every nvm and npm root it can find, and runs the same size test on each.
The second silent failure
On Aug 25, c452d06 fixed a failure with the same flavor. Version 1.7.0 introduced a per-user data folder, and on a fresh account that folder came up empty. The cause was in migrateLegacyData: it copied into a directory that did not exist yet, the copy threw ENOENT, and the catch around it swallowed the error. The result was a data folder that looked migrated and held nothing.
Every script then died on its first Get-Content, before it could open a log file. And because there was no log, the app reported "claude CLI wrote no log", which pointed at the one component that was working.
That fix had three parts: create the destination first and then copy, seed the files the scripts read unconditionally (an empty kanban.json, dirs.txt, GOALS.md, STATE.md, PROGRESS.md), and let kanban-check.ps1 treat a missing board as an empty one and write an unreadable one into its log. The seeds are only written when the file is absent, so they never overwrite real data.
What I would do differently
I would make a failed run say what failed on the first day, not the fifth. Both bugs had the same shape: a failure that produced no message, in a place where the app then invented one from whatever it could see. A run that exits in two seconds with an empty result should be reported as "the CLI did not produce output, here is its exit code and stderr", never as a generic empty answer.
I would also never hardcode a path to a tool I do not control. The size check is a patch on a deeper decision. A launcher found by a resolver, verified before every run, with a clear error when it fails, is how I should have started.
And I would treat a catch that swallows an error as a bug waiting to happen. In the data folder bug it turned a missing directory into a folder that looked migrated and held nothing.
Where this fits
Both bugs came from the same place: a desktop app that depends on a CLI, PowerShell and a data folder it creates on whatever machine it lands on. The full DailyBrief case study describes that whole chain and the other failures that real use turned up.
See the whole pipeline these scripts belong to, from the project registry to the model call and the board.
Read the full case study#powershell#windows#claude-cli#debugging
Keep reading
Have a project in mind?