Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
18 posts · #powershell
Clear filters·5 min read

DailyBrief · Story
My workspace on G: was invisible to DailyBrief, and the fix exposed a 3 minute scan
Every scan root was hardcoded under the user profile, so a workspace on another drive never showed up. Making folders configurable meant fixing a walk that entered every node_modules first.
In short
- The scan roots were a hardcoded list of folders under %USERPROFILE%, so a workspace on another drive was invisible to every script.
- Get-ChildItem -Recurse entered every nodemodules and .git folder and filtered the results afterwards; the source comment in core/walk.ps1 puts that at three minutes per monitor run on G:\Desktop.
- A shared roots.ps1 now feeds every script, a pruned walk never enters dependency folders, and removing a folder no longer triggers a full rescan.
#powershell#filesystem#performance#electron
·5 min read

A publish step that never worked, because headless Claude has no Artifact tool
DailyBrief asked a headless CLI run to use a tool it does not have. The rewrite builds the markdown in PowerShell, serializes every argument itself and treats the model's reply as untrusted.
In short
- The old publisher told a headless claude -p run to use the Artifact tool, which a headless session does not have, so it never worked.
- The new one builds the markdown in PowerShell, serializes every tool argument itself, and gives a small model only the job of passing them on.
- Everything the model returns is treated as untrusted: the doc link is stored only if it is plausible, and the body id only if it matches an id pattern.
#claude-cli#powershell#automation#llm
·5 min read

DailyBrief · Story
My task check said nothing happened, but git evidence was failing silently
A baseline..HEAD range missed feature branches, broke after an amend, and one stderr line under PowerShell 5.1 threw away a task's whole diff. Here is how I rebuilt the evidence.
In short
- The task check built its git evidence from <baseline sha>..HEAD, which misses feature branches, breaks silently after an amend or rebase, and resets every time a check runs.
- Under PowerShell 5.1 with $ErrorActionPreference = 'Stop', one stderr line from git ("unknown revision") became a terminating error and discarded the whole scan diff.
- The fix keeps two baselines, reads every local branch, bounds the window by time as well as by sha, relinks moved folders by root commit, and ships with a digest-only mode and a fixture script.
#powershell#git#debugging#electron
·5 min read

DailyBrief · Story
The app blamed the claude CLI, but my migration had swallowed an ENOENT
A fresh DailyBrief 1.7.0 account reported 'claude CLI wrote no log'. The CLI was fine: a migration copied into a folder that did not exist and a catch hid the error.
In short
- 1.7.0 moved user data into a per-user data folder, but the migration copied into a directory that did not exist yet. ENOENT was thrown and then swallowed by a catch.
- Every run on a fresh or migrated account then died inside Get-Content on a missing file, before it could open a log, so the app blamed the claude CLI.
- The fix creates the destination first, seeds the files the scripts read unconditionally, and makes the scripts treat a missing board as an empty one.
#electron#powershell#error-handling#migration#debugging
·5 min read

DailyBrief · Story
Four kanban cards shared one repo, so every one got the same evidence
Four tasks in one folder received the same 187 changed files and 8 commits, so the AI check either said nothing or closed a card off a neighbour's commit. The fix moved the decision into the script.
In short
- Tasks that share one folder all received the folder's whole diff, so no card could be told apart from its neighbours.
- Evidence is now attributed per task by matching the names in its title and checklist against changed files and each new commit's file list; closing a task requires a hit.
- Fixing it exposed a baseline that was consumed too early, a noise filter that matched nothing on Windows paths, and a few smaller bugs.
#powershell#git#ai-agents#debugging#windows
·6 min read

Parallel AI checks kept overwriting my kanban board, so I added a lock and a merge
Several AI runs and the page saved the same kanban.json, and the last writer won. A shared lock file was not enough, so saves became a three-way merge.
In short
- Parallel AI checks and the user's own board saves all did read-modify-write on the same kanban.json, so the last writer dropped everyone else's changes.
- I added one lock file that both Node and PowerShell take, and a three-way merge so a page save is merged with what the scripts wrote meanwhile instead of overwriting it.
- If the lock cannot be taken, nothing is written and the user sees an error, because an unlocked write is exactly the bug being fixed.
#electron#concurrency#file-locking#powershell
·5 min read

DailyBrief · Story
A stray PowerShell error turned my digest into 391 MB
One unsuppressed script call inside a foreach expression put a .NET error object into DailyBrief's digest. The same commit fixed a Georgian text repair that had never worked.
In short
- A call inside a foreach expression leaked an error object into the captured array, and ConvertTo-Json serialized its whole object graph.
- The fix is $null = ... 2>$null, plus a comment so nobody removes it.
- fixMojibake inverted a cp1252 corruption with latin1, so it always rejected its own output.
#powershell#debugging#encoding#electron
·5 min read

DailyBrief · Story
Every AI run died in 2 seconds, and nothing said why
A one-kilobyte stub where the claude binary should be made every DailyBrief run end silently. The fix was checking file size, and a second silent failure taught me the same lesson.
In short
- After a global npm install, claude.cmd was present but bin\claude.exe was a tiny text stub that Windows refused to run.
- Test-Path says yes to a stub, so the fix checks the binary's size, in one shared file instead of four hardcoded paths.
- Five days later a swallowed ENOENT made the app blame the CLI for a problem it did not have (c452d06).
#powershell#windows#claude-cli#debugging