<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Peter Mamrukov]]></title><description><![CDATA[Peter Mamrukov]]></description><link>https://netbka.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 01 Nov 2026 07:19:32 GMT</lastBuildDate><atom:link href="https://netbka.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Stop syncing your work folder: let the AI work where the files live]]></title><description><![CDATA[Laptop, desktop, phone, and one project folder fighting OneDrive. A simpler pattern: keep the work on one machine and let the AI reach it from any device.]]></description><link>https://netbka.hashnode.dev/stop-syncing-your-work-folder</link><guid isPermaLink="true">https://netbka.hashnode.dev/stop-syncing-your-work-folder</guid><category><![CDATA[AI]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[Git]]></category><category><![CDATA[claude]]></category><dc:creator><![CDATA[Peter Mamrukov]]></dc:creator><pubDate>Sat, 31 Oct 2026 09:54:11 GMT</pubDate><content:encoded><![CDATA[<p>You work on a desktop at home and a laptop everywhere else. The project folder lives in OneDrive or Dropbox so both machines have it. Then an AI agent edits forty files on the desktop while the laptop is asleep, the laptop wakes up, and you get <code>report (Laptop's conflicted copy).docx</code>, a half-synced <code>node_modules</code>, and a Git repo that says every file changed.</p>
<p>Sync services were built for people saving a document now and then. Agents write many files fast, delete and recreate them, and keep lock files open. That's the worst case for sync.</p>
<h2>Fix 1: for code, Git is the sync</h2>
<p>If it's code, take the folder out of OneDrive and use Git as the only way the two machines share it. Commit and push from one, pull on the other. Exclude build output and dependencies in <code>.gitignore</code>. It's boring and it works, and the AI is good at writing the commit message.</p>
<p>The catch: you have to remember to push before you leave the desk. When you forget, the laptop has yesterday's code.</p>
<h2>Fix 2: one home for the work</h2>
<p>The other pattern is to stop copying the work at all. Pick one machine, usually the desktop that's always on, as the home of the project. Everything happens there. Other devices don't hold a copy; they reach in.</p>
<p>You can do that with remote desktop, which is fine for an hour of real work and painful on a phone. Or you can do it from the AI chat you already use, which is what I do.</p>
<p>I build Local Commander, so I'm biased. An agent runs on the desktop; ChatGPT or Claude on any device can read, edit and run things there. From the laptop at a café:</p>
<blockquote>
<p>On Home PC, open the Q3 report folder, update the totals in summary.xlsx from the three CSVs that came in today, and tell me what changed.</p>
</blockquote>
<p>From the phone, later:</p>
<blockquote>
<p>On Home PC, did the build of the site pass? If it did, show me the git log for today.</p>
</blockquote>
<p>Nothing moves between devices except the conversation. The files stay on the desktop, the build runs on the desktop, and there's nothing to resolve when you get home.</p>
<p>That is how this site is maintained. The repository lives on my home PC; I write and review from wherever I am, and the AI edits, runs the checks and opens the pull request on that machine. Nothing is synced to the laptop or the phone, because nothing needs to be.</p>
<h2>When sync is simpler</h2>
<p>Sometimes the boring answer wins. Sync is the better fit when:</p>
<ul>
<li>the files are documents and photos that several people open by hand, not a project an agent works on;</li>
<li>you need them on a plane, in a meeting room without Wi-Fi, or on a phone that only opens attachments;</li>
<li>the "home" machine is a laptop that travels, so there is no always-on home.</li>
</ul>
<p>In those cases keep OneDrive or Dropbox, and keep agents out of the synced folder.</p>
<h2>What changes in practice</h2>
<ul>
<li><strong>No conflicted copies.</strong> There's one copy.</li>
<li><strong>No "which machine has the latest version".</strong> The home machine does, always.</li>
<li><strong>Heavy work stays on the strong machine.</strong> The laptop doesn't need the 10 GB of dependencies or the GPU.</li>
<li><strong>The phone becomes useful.</strong> You can't edit a spreadsheet on a phone, but you can ask for the edit.</li>
</ul>
<h2>Where it stops</h2>
<ul>
<li>The home machine has to be on and online. If it's a desktop, turn sleep off; if it's a laptop that travels, this pattern doesn't fit.</li>
<li>It's not a file-sync service and not a backup. The one copy on the home machine is still one copy; if that disk dies, so does the work. Keep Git for code and a real backup (a second disk, a cloud backup of that folder) for everything else.</li>
<li>It works through files and commands, not the screen. For layout work in a GUI app, use remote desktop.</li>
<li>It isn't a sandbox. An approved computer lets the AI do what your user account can do; choose only the folders it needs when you set it up.</li>
</ul>
<h2>Setting it up</h2>
<ol>
<li>On the home machine, run <code>npx local-commander-agent@latest</code> (Node.js 20+) and approve it in the browser.</li>
<li>Choose access: the whole user account, or only the project folders.</li>
<li>Add <code>https://localcmd.app/mcp</code> as a connector in ChatGPT or Claude (and Cursor, if you use it on the laptop) and sign in.</li>
<li>Take the project folder out of OneDrive. Keep backups the normal way.</li>
</ol>
<p>You can cut the machine off from your account at any time.</p>
<p><a href="https://localcmd.app/control-multiple-computers-with-ai">https://localcmd.app/control-multiple-computers-with-ai</a></p>
<hr />
<p><em>Originally published at <a href="https://localcmd.app/use-cases/stop-syncing-your-work-folder">localcmd.app</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Start a long job on your PC and check it from your phone]]></title><description><![CDATA[Three ways to start a long job and check on it from your phone later: tmux plus SSH, Claude Code's remote control, or asking your AI chat to run it.]]></description><link>https://netbka.hashnode.dev/start-a-long-job-on-your-pc-and-check-it-from-your-phone</link><guid isPermaLink="true">https://netbka.hashnode.dev/start-a-long-job-on-your-pc-and-check-it-from-your-phone</guid><category><![CDATA[AI]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[claude]]></category><category><![CDATA[Devops]]></category><dc:creator><![CDATA[Peter Mamrukov]]></dc:creator><pubDate>Wed, 28 Oct 2026 16:04:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ad487953d6ebca4a9ee5230/029d90b8-785e-4238-8507-c32df6f7b4c8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Some jobs take an hour: the full test suite, a video export, copying a photo archive to a new disk, re-indexing a database. You start it, and then you want to leave. The question in every thread about this is the same: how do I see how it's going without walking back to that screen?</p>
<p>There are three good answers, and they suit different jobs.</p>
<h2>1. tmux plus SSH: the terminal, from anywhere</h2>
<p>Start the job inside <code>tmux</code> (or <code>screen</code>) on the machine. Reach the machine over Tailscale or your VPN, SSH in from your phone with an app like Termius or Blink, and run <code>tmux attach</code>. You see exactly what you'd see at the desk.</p>
<p>Good for: anything you started by hand in a terminal, and anyone comfortable with a terminal on a phone keyboard.
Watch out for: the job dies if you started it outside tmux and the terminal closes. And a 6-inch screen full of compiler output isn't a summary.</p>
<h2>2. Claude Code's Remote Control: the same coding session, on another device</h2>
<p>If the long job is a Claude Code session, Claude Code has this built in. Run <code>claude remote-control</code> on the machine (or type <code>/remote-control</code> inside a session) and pick the session up from claude.ai/code or the Claude app. The work keeps running on your computer; the phone is a second window onto the same conversation. It needs a paid Claude plan and a claude.ai login.</p>
<p>Good for: an interactive coding session you want to steer from the couch.
Watch out for: it's one session on one machine. It doesn't help with a backup script or a job on a second computer.</p>
<h2>3. Ask your AI chat to start it, then ask again later</h2>
<p>The third pattern starts the job from the chat itself. You ask ChatGPT or Claude to run the job on a named computer; the job keeps running on that computer after the chat answers; later you come back to the same conversation and ask how it's going. Your chats sync between desktop and phone, so "later" can be from the train.</p>
<p>I build Local Commander, which works this way, so I'm biased. A real exchange looks like this:</p>
<blockquote>
<p>On Home PC, copy D:\Photos to the new disk E:\Photos with robocopy, keeping timestamps. Log to E:\copy.log. Tell me when it's started; don't delete anything on D.</p>
</blockquote>
<p>The command starts and the chat answers within seconds with "started". An hour later, from the phone, in the same chat:</p>
<blockquote>
<p>How's the copy going? Show me the last lines of the log and whether it finished with errors.</p>
</blockquote>
<p>The AI asks the computer for the job's status and output and gives you a one-paragraph answer instead of a wall of log. If something is wrong: "Stop the copy." It sends the cancel to that computer.</p>
<p>What makes "ask again later" work is that the job has an identity. When the chat starts it, the computer hands back an operation ID, and the job is written to a small journal on that computer. Later questions ("how's it going", "show me the log", "stop it") refer to that ID, so the answer is about the job you started, not a fresh guess. If the connection between the chat and the computer drops for a moment, the job keeps running where it is; the result waits in the journal until the chat asks for it.</p>
<p>The real one I checked from the phone this week was not a photo copy. I ship the Local Commander website itself this way: from the chat I start the release script on the server, it rebuilds the site image and runs its checks for a minute or two, and I ask for the result from wherever I am.</p>
<p>Good for: jobs that aren't a coding session — copies, backups, test runs, exports — and machines other than the one in front of you.
Watch out for: it reports output and status, not the screen. And as with the other two, the computer has to stay awake.</p>
<h2>Which one when</h2>
<table>
<thead>
<tr>
<th>Job</th>
<th>Best fit</th>
</tr>
</thead>
<tbody><tr>
<td>Something you started by hand in a terminal</td>
<td>tmux + SSH</td>
</tr>
<tr>
<td>A Claude Code session you want to keep steering</td>
<td>Remote Control</td>
</tr>
<tr>
<td>A copy, backup, export or test run you'd rather describe than type</td>
<td>Ask the chat to start it</td>
</tr>
<tr>
<td>Several jobs on several computers</td>
<td>Ask the chat; name each computer</td>
</tr>
</tbody></table>
<h2>The part everyone forgets: sleep, offline, restart</h2>
<p>Whatever you pick, a laptop that sleeps when you leave stops the job. On Windows, set "When plugged in, put my device to sleep after" to Never for the duration, or run <code>powercfg /change standby-timeout-ac 0</code> and set it back later. On macOS, <code>caffeinate -i</code> in front of the command keeps the Mac awake until it finishes. On Linux, <code>systemd-inhibit</code> does the same.</p>
<p>Three different things can happen while you are away, and it helps to know which one you got:</p>
<ul>
<li><strong>Offline for a while</strong> (Wi-Fi hiccup, the relay restarts): the job keeps running on the computer. When the connection is back, "how's it going" gets the real status from the journal.</li>
<li><strong>Asleep</strong>: the job is paused with the computer. It resumes when the computer wakes, but a copy with a timeout or a test with a clock may have failed by then. The status tells you.</li>
<li><strong>Restarted</strong> (power cut, Windows Update): the job is gone. Nothing here restarts it for you, and it is not re-run on a guess; the chat reports the outcome as unknown, and you decide whether to start it again. Check the log before you do, so a half-finished copy is not copied twice.</li>
</ul>
<h2>Setting up the chat way</h2>
<ol>
<li>On the computer, run <code>npx local-commander-agent@latest</code> (Node.js 20+) and approve it in the browser.</li>
<li>Choose its access: the whole user account, or only the folders the job needs.</li>
<li>Add <code>https://localcmd.app/mcp</code> as a connector in ChatGPT or Claude and sign in.</li>
</ol>
<p>It isn't a sandbox: an approved computer lets the AI do what your account can do, so for a long unattended job, give it only the folders it needs. You can cancel the job or cut the computer off at any time.</p>
<p>Steps and examples: <a href="https://localcmd.app/control-multiple-computers-with-ai">https://localcmd.app/control-multiple-computers-with-ai</a></p>
<hr />
<p><em>Originally published at <a href="https://localcmd.app/use-cases/check-a-long-job-from-your-phone">localcmd.app</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[My PC started lagging once AI agents moved in. Two causes, both fixable by hand]]></title><description><![CDATA[Two causes my PC lagged once AI agents moved in: Defender scanning every file and caches filling drive C. How to check and fix both by hand.]]></description><link>https://netbka.hashnode.dev/my-pc-started-lagging-once-ai-agents-moved-in-two-causes-both-fixable-by-hand</link><guid isPermaLink="true">https://netbka.hashnode.dev/my-pc-started-lagging-once-ai-agents-moved-in-two-causes-both-fixable-by-hand</guid><category><![CDATA[Windows]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[Powershell]]></category><category><![CDATA[Productivity]]></category><dc:creator><![CDATA[Peter Mamrukov]]></dc:creator><pubDate>Mon, 26 Oct 2026 19:45:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ad487953d6ebca4a9ee5230/99a89f97-dec8-4f57-822e-c733a0ff476e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>At some point my home PC started to lag. Not crash, just hesitate: a window takes a second to open, the cursor freezes for a beat. That machine runs AI coding agents almost around the clock, Claude Code and Codex, editing code, installing packages, running builds and tests.</p>
<p>I didn't go digging myself. I asked one line in a chat: "Why is my home PC lagging? Look at what's loading the CPU and disk and name the main cause. Don't change anything." The chat reached the computer, looked at processes and disks, and came back with two causes. I would have spent a long time finding either of them.</p>
<h2>Cause one: Defender scans every file the agents write</h2>
<p>Windows' built-in antivirus checks every created and modified file in real time. A person changes a few dozen files a day. An agent changes tens of thousands: package installs, builds, a separate copy of the project for every task. Defender opens and scans each one. In Task Manager it shows up as "Antimalware Service Executable" eating CPU while you seem to be doing nothing.</p>
<p>How to check by hand. In an elevated PowerShell, record Defender's work for a couple of minutes:</p>
<pre><code class="language-powershell">New-MpPerformanceRecording -RecordTo C:\Temp\defender.etl
# let your agents work for a couple of minutes, then press Enter
Get-MpPerformanceReport -Path C:\Temp\defender.etl -TopProcesses 10 -TopExtensions 10 -TopFiles 10
</code></pre>
<p>The report shows whose files took Defender the longest. If node, git and your project folders are at the top, that's your answer.</p>
<p>Two ways to deal with it:</p>
<ul>
<li>Exclude the agents' working folders from scanning. The price is clear: Defender won't catch anything in those folders any more. Agents download packages from the internet, so exclude only code folders, not Downloads and not a whole drive.</li>
<li>Windows 11 has a Dev Drive, a separate volume for development work. Defender scans it in a lighter mode that doesn't hold up writes. It's a middle ground between "scan everything" and "scan nothing".</li>
</ul>
<p>We took the first route and went a bit further. We excluded the working folders where agents create files, and the agent programs themselves: Claude Code, Codex, Antigravity, Cursor.</p>
<pre><code class="language-powershell">Add-MpPreference -ExclusionPath "D:\Work"
Add-MpPreference -ExclusionProcess "C:\path\to\agent.exe"
</code></pre>
<p>Excluding a program is a bigger step than excluding a folder. Defender stops scanning the files that program opens and writes, in any folder. Agents pull other people's packages from the internet, so I took that risk on purpose: it's a work machine, and the lag was costing me more. If that's not true for you, start with folders only, or with a Dev Drive.</p>
<h2>Cause two: the agents wrote to drive C even though they were told not to</h2>
<p>Every one of my agents has the same line in its instructions: work on drive D only. The projects really are on D. And yet the system drive C kept filling up.</p>
<p>It turned out it wasn't the agents writing there, it was the programs they run, and the agent apps themselves: package caches, app data, temp files. By default all of that lands in the user's AppData on drive C. The agent honestly works in D:, and the gigabytes pile up in C:\Users\…\AppData.</p>
<p>This is the part worth remembering: an instruction controls what the agent does, not where the programs it launches write.</p>
<p>How to see which AppData folders are the biggest:</p>
<pre><code class="language-powershell">Get-ChildItem $env:LOCALAPPDATA, $env:APPDATA -Directory -ErrorAction SilentlyContinue | ForEach-Object {
  $s = (Get-ChildItem $_.FullName -Recurse -File -Force -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum
  [pscustomobject]@{ Folder = $_.FullName; GB = [math]::Round($s / 1GB, 2) }
} | Sort-Object GB -Descending | Select-Object -First 10
</code></pre>
<p>On my machine the top entries were the npm cache (including the npx cache, which lives inside it) and Docker's data. Agents run all sorts of things through npx, and every version stays in the cache. We cleaned up like this:</p>
<pre><code class="language-powershell">npm cache clean --force          # npm cache, including packages fetched by npx
docker system df                 # how much images, containers and build cache take
docker system prune              # remove stopped containers and anything unused
</code></pre>
<p>Cleaning treats the symptom: in a month the caches grow back. So we also moved the folders themselves to D and left a link on C pointing to the new place. Programs still write "to AppData", while the files physically live on D. Close the program that owns the folder first:</p>
<pre><code class="language-powershell">robocopy "$env:LOCALAPPDATA\SomeTool" "D:\AppData\SomeTool" /E /COPY:DAT
Rename-Item "$env:LOCALAPPDATA\SomeTool" "SomeTool.old"
cmd /c mklink /J "$env:LOCALAPPDATA\SomeTool" "D:\AppData\SomeTool"
# check the program still works, and only then delete SomeTool.old
</code></pre>
<p>Some programs offer a cleaner route: tell them to keep their cache elsewhere. For npm, for example: <code>npm config set cache D:\npm-cache</code>.</p>
<h2>The result</h2>
<p>CPU load dropped from 67% to about 12%. No new hardware, no reinstall: Defender simply stopped re-scanning files we were creating ourselves. The PC stopped lagging, and I went back to work.</p>
<h2>What I took from it</h2>
<ul>
<li>A computer running agents is a different kind of load. It writes files hundreds of times more often, and anything that inspects files starts to drag.</li>
<li>Checking what the agent does isn't enough. Check where the traces of its work end up.</li>
<li>You can hand the diagnosis to an AI in one question. Just add "don't change anything" and ask what the conclusion is based on.</li>
</ul>
<p>I asked through <a href="https://localcmd.app">Local Commander</a>, my own project, which lets a chat reach my computers. But both checks above take half an hour by hand without it.</p>
<p>Have your agents ever slowed a machine down in a way you had to hunt for?</p>
]]></content:encoded></item><item><title><![CDATA[A read-only first week: three questions to ask your computers]]></title><description><![CDATA[Why is the disk full, why is it slow, did the backup copy everything. Three jobs an AI can do on your computers without changing a file.]]></description><link>https://netbka.hashnode.dev/a-read-only-first-week-three-questions-to-ask-your-computers</link><guid isPermaLink="true">https://netbka.hashnode.dev/a-read-only-first-week-three-questions-to-ask-your-computers</guid><category><![CDATA[AI]]></category><category><![CDATA[Devops]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[mcp]]></category><category><![CDATA[Powershell]]></category><dc:creator><![CDATA[Peter Mamrukov]]></dc:creator><pubDate>Sat, 24 Oct 2026 11:44:40 GMT</pubDate><content:encoded><![CDATA[<p><em>Originally published at <a href="https://localcmd.app/use-cases/read-only-first-week">localcmd.app/use-cases/read-only-first-week</a>.</em></p>
<p>Most people's first worry about letting an AI near their computers is the same: what if it deletes something. So don't start there. Spend the first week on questions that only need looking.</p>
<p>Here are three. Each one comes with the manual way first, because you should be able to do it without any tool, and then what it looks like when your AI does it for you.</p>
<h2>1. Why is my disk full?</h2>
<p><strong>By hand.</strong> On Windows, open PowerShell and list the biggest top-level folders:</p>
<pre><code class="language-powershell">Get-ChildItem C:\ -Force -Directory | ForEach-Object {
  $s = (Get-ChildItem $_.FullName -Recurse -Force -File -ErrorAction SilentlyContinue | Measure-Object Length -Sum).Sum
  [pscustomobject]@{Folder = $_.Name; GB = [math]::Round($s/1GB, 2)}
} | Sort-Object GB -Descending | Select-Object -First 8
</code></pre>
<p>On a Mac or Linux machine, <code>du -xsk ~/* | sort -rn | head</code> does the same for your home folder.</p>
<p>Two things catch people out. First, a full scan of a big disk takes minutes, not seconds; on my Windows machine it took about two and a half. Second, on a Mac the obvious command lies: <code>df -h /</code> shows only the small system volume. Your files live on a separate one, so check <code>df -h /System/Volumes/Data</code> instead. The folder sizes also never add up to the used space, because of system files and folders you don't have rights to read. Expect a gap.</p>
<p><strong>With your AI.</strong> Ask: "Why is the disk on my work PC almost full? Show me the ten biggest folders and tell me what each one is. Don't delete anything." You get a ranked list in plain words ("this is an app cache, that is your photo library, that is old installers") instead of a wall of numbers. The deleting, if any, is a separate step that starts only after you say yes.</p>
<h2>2. Why is it slow, or why did it restart?</h2>
<p><strong>By hand.</strong> How long has it been on, what is using the memory, how many programs start with it, and did it restart by itself. On Windows:</p>
<pre><code class="language-powershell">$os = Get-CimInstance Win32_OperatingSystem
"Uptime hours: " + [math]::Round(((Get-Date) - $os.LastBootUpTime).TotalHours, 1)
Get-Process | Sort-Object WS -Descending | Select-Object -First 5 Name, @{n='MB'; e={[math]::Round($_.WS/1MB)}}
(Get-CimInstance Win32_StartupCommand | Measure-Object).Count
Get-WinEvent -FilterHashtable @{LogName='System'; Id=41,1074,6008; StartTime=(Get-Date).AddDays(-7)}
</code></pre>
<p>On a Mac, <code>uptime</code>, <code>last reboot | head</code> and <code>ps -Aceo rss,comm -m | head</code> cover the same ground.</p>
<p>A quiet answer is still an answer. If the restart log is empty, nothing restarted it, and your slow day has another cause. One of my machines had been running for 53 days without a reboot, which explained more than any single program did.</p>
<p><strong>With your AI.</strong> Ask: "My laptop feels slow. Check how long it has been on, what uses the memory, what starts at login and whether it restarted recently, then tell me the most likely cause." The useful part is the last sentence. You get one conclusion, or an honest "I didn't find a clear cause", and you can ask for the evidence behind it.</p>
<h2>3. Did my backup copy everything?</h2>
<p><strong>By hand.</strong> Compare the original and the copy. On a Mac or Linux machine <code>diff -rq source backup</code> lists files that are missing or differ. On Windows, hash both folders and compare:</p>
<pre><code class="language-powershell">$s = (Resolve-Path .\source).Path; $d = (Resolve-Path .\backup).Path
$a = Get-ChildItem $s -Recurse -File | ForEach-Object { [pscustomobject]@{P=$_.FullName.Substring($s.Length); H=(Get-FileHash $_.FullName).Hash} }
$b = Get-ChildItem $d -Recurse -File | ForEach-Object { [pscustomobject]@{P=$_.FullName.Substring($d.Length); H=(Get-FileHash $_.FullName).Hash} }
Compare-Object $a $b -Property P, H
</code></pre>
<p>I tried this on a test folder where I had deleted one file and edited another in the copy. Both showed up straight away: one missing, one changed. A comparison by size and date is faster; one by content is slower but catches more. Say which one you want.</p>
<p><strong>With your AI.</strong> Ask: "Compare the Photos folder on my desktop with the copy on the external drive. List what is missing or different. Don't copy or fix anything." You get a short list of exceptions instead of a feeling that it probably worked.</p>
<h2>Why start here</h2>
<p>None of these changes a file. If the AI misreads something, the worst result is a wrong sentence, and you can check it against the commands above. After a week of that, you know how it answers, how it explains itself and how often it says "I'm not sure". That is a better basis for the day you let it change something.</p>
<p>I build Local Commander, so this is the setup I tried it with: a small agent on each computer, and your ChatGPT or Claude chat connects to it. Every example above ran on my own Windows PC and my own Mac. It works through commands and files, not through the screen, so it won't click a dialog for you, and the computer has to be on. You choose what each computer allows, and you can switch any of them off.</p>
<p>If you try the three questions on your own machines, I'd like to hear which one gave a useful answer and which one didn't.</p>
<p>Setup steps and the other first-week questions: <a href="https://localcmd.app/use-cases/read-only-first-week">https://localcmd.app/use-cases/read-only-first-week</a></p>
]]></content:encoded></item><item><title><![CDATA[We Run Commands from Forums. Why Does AI Access Feel Different?]]></title><description><![CDATA[A practical comparison of utilities, reviewed commands and AI access, with a Windows disk-space walkthrough and clear permission boundaries.]]></description><link>https://netbka.hashnode.dev/commands-from-forums-and-ai-access</link><guid isPermaLink="true">https://netbka.hashnode.dev/commands-from-forums-and-ai-access</guid><dc:creator><![CDATA[Peter Mamrukov]]></dc:creator><pubDate>Fri, 23 Oct 2026 12:56:27 GMT</pubDate><content:encoded><![CDATA[<p>A PC runs low on disk space. A support reply suggests a utility, a batch file or a PowerShell command. Now offer a fourth option: let an AI assistant inspect the computer.</p>
<p>The question changes quickly from “What should I run?” to “Should I let it access my machine?”</p>
<p>I work on Local Commander, so this is a practical question for me. It is also a useful question for anyone choosing between a utility, a script and an agent. The answer depends on what each option can read, change and send elsewhere.</p>
<h2>The contrast exists, but it is not universal</h2>
<p>In a <a href="https://www.reddit.com/r/PowerShell/comments/1p5vxxg/what_does_it_mean_to_learnknow_powershell/">PowerShell discussion</a>, a user describes finding a command for an Exchange task, pasting it into the terminal and getting a result without understanding what happened.</p>
<p>Under a <a href="https://www.reddit.com/r/OpenAI/comments/1viys4l/free_ai_chatbot_bridge_to_your_local_files/">local AI bridge project</a>, a commenter immediately asks what permissions the AI's file writes run with.</p>
<p>Those are separate people and situations. They do not prove that the same users trust arbitrary scripts but reject AI. There is also a counterexample: a <a href="https://www.reddit.com/r/selfhosted/comments/1tabfx2/karakeep_extension_new_permissions/">Karakeep user</a> stopped to investigate when an ordinary extension requested access to all websites.</p>
<p>What these examples support is a more useful question: how clearly can someone understand the access needed for a particular task?</p>
<h2>Use one small task for the comparison</h2>
<p>Consider the first step of a disk-space investigation: report the size and free space of drive C. Do not delete, move or install anything.</p>
<p>Explorer can show this directly. Windows Storage can help with a broader investigation. For that small question, no AI or extra utility is necessary.</p>
<p>A reviewed command is another option:</p>
<pre><code class="language-powershell">Get-Volume -DriveLetter C |
  Select-Object DriveLetter, FileSystem, Size, SizeRemaining
</code></pre>
<p>The command obtains volume information. It does not establish which folder filled the disk. Understanding this boundary is more useful than deciding that PowerShell itself is safe or dangerous.</p>
<p>We ran that query through hosted Local Commander on a Windows 11 x64 computer on October 20, 2026. At that moment, C had 284,543,627,264 bytes total and 39,215,185,920 bytes free, about 265.00 and 36.52 GiB.</p>
<p>For a folder-level step, we used three synthetic files. A metadata scan returned 2,424,832 logical bytes and correctly identified cache, at 2,097,152 bytes, as the largest subfolder. It did not read those files' contents or change them.</p>
<p>These are results from a small controlled walkthrough. They do not identify the cause of real whole-drive usage or show that AI was faster than a utility. We did not run a comparative benchmark.</p>
<h2>Compare the authority, not just the interface</h2>
<table>
<thead>
<tr>
<th>Option</th>
<th>What to examine</th>
</tr>
</thead>
<tbody><tr>
<td>Built-in view or installed utility</td>
<td>Publisher, permissions, scanned scope, background behavior and data handling</td>
</tr>
<tr>
<td>Reviewed command</td>
<td>Exact code, account privileges, inputs, side effects and output</td>
</tr>
<tr>
<td>AI with execution tools</td>
<td>All of the above, plus which further actions the agent can choose and what context reaches the model</td>
</tr>
</tbody></table>
<p>A fixed command and an agent are not identical. An agent can inspect one result and decide to continue. A broad request such as “sort out my disk” leaves more room for unexpected choices than a narrowly reviewed query.</p>
<p>Untrusted text can also influence an agent. Anthropic's <a href="https://support.claude.com/en/articles/13364135-use-claude-cowork-safely">safety guidance</a> discusses mistakes and prompt injection. Concern about AI access therefore has a technical basis.</p>
<p>The useful response is to make the task, permissions and evidence visible.</p>
<h2>What that means for Local Commander</h2>
<p>Local Commander's hosted connector lets a connected AI client perform owner-approved work on a selected computer. In this walkthrough, the conversation selected the target, executed a diagnostic procedure and inspected its actual result.</p>
<p>After owner approval, Full Access uses the user account's rights on that computer by default. The owner can narrow or revoke access. It is not an operating-system sandbox. “Do not delete anything” is an instruction to the assistant; it does not itself create a technical deletion restriction.</p>
<p>Returned command output reaches the connected AI service. In this example, that meant volume information and a synthetic folder report. A task involving documents or logs can expose different data.</p>
<p>For a single free-space number, Explorer is likely the shortest route. The connector is useful when an AI conversation needs evidence from the chosen computer and a clear record of what was checked.</p>
<p>The first demonstration should be easy to inspect: this computer, this command, this output, these limits. A repair or cleanup is another decision.</p>
<p>People do not owe a tool unconditional trust. A better starting point is a task small enough to understand and a result concrete enough to check.</p>
<p>Disclosure: I work on <a href="https://localcmd.app/">Local Commander</a>. This is a developer's walkthrough, not an independent product review.</p>
<p>Technical reference: <a href="https://learn.microsoft.com/en-us/powershell/module/storage/get-volume">Get-Volume</a>.</p>
<p><em>Originally published at <a href="https://localcmd.app/use-cases/commands-from-forums-and-ai-access">localcmd.app</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to connect ChatGPT or Claude on the web to your own computer, without opening a port]]></title><description><![CDATA[You got a local MCP server working. Claude Desktop sees it, your editor sees it, and the model runs your build without you pasting anything. Then you open…]]></description><link>https://netbka.hashnode.dev/how-to-connect-chatgpt-or-claude-on-the-web-to-your-own-computer-without-opening-a-port</link><guid isPermaLink="true">https://netbka.hashnode.dev/how-to-connect-chatgpt-or-claude-on-the-web-to-your-own-computer-without-opening-a-port</guid><dc:creator><![CDATA[Peter Mamrukov]]></dc:creator><pubDate>Fri, 23 Oct 2026 10:52:12 GMT</pubDate><content:encoded><![CDATA[<p>You got a local MCP server working. Claude Desktop sees it, your editor sees it, and the model runs your build without you pasting anything. Then you open ChatGPT in a browser tab, or Claude on your phone on the way home, and the tools are gone. The chat is right there, the computer is right there, and the two never meet.</p>
<p>Someone on r/mcp put it in one line: "ChatGPT and Claude web can't run local MCP servers." They can't, for a plain reason. Here's why, the two ways around it, and how to choose.</p>
<h2>Why the web chat can't see localhost</h2>
<p>When you add a connector in ChatGPT or Claude on the web, your browser doesn't talk to the MCP server. The provider's servers do: when the model wants a tool, their backend calls the URL you gave it. From there, <code>localhost</code> means their machine, not yours, and your PC usually sits behind a home router without a public address anyway. The phone apps work the same way.</p>
<p>So the web and phone apps can only use an MCP server at a public HTTPS address. Desktop apps can start a local server as a child process and talk to it over stdio, which is why the same server works in one place and not the other.</p>
<p>That leaves two ways to give your computer a reachable endpoint without forwarding a port on your router.</p>
<h2>Option A: a tunnel to your own MCP server</h2>
<p>A tunnel tool such as cloudflared or ngrok runs on your computer, opens an outgoing connection to the tunnel provider, and gives you a public HTTPS URL that forwards to a local port. I started this way myself: a small server on my PC, a tunnel, and a login so not just anyone could walk in. It worked.</p>
<p>The steps, at a high level:</p>
<ol>
<li><strong>Serve MCP over HTTP.</strong> Many local servers only speak stdio. You need one that speaks Streamable HTTP, or a small bridge that wraps a stdio server in HTTP. Bind it to <code>127.0.0.1</code>, not to every network interface.</li>
<li><strong>Start the tunnel.</strong> For example <code>cloudflared tunnel --url http://localhost:8080</code> or <code>ngrok http 8080</code>. Depending on the tool and setup, the URL may change on each start; a fixed hostname saves re-adding the connector.</li>
<li><strong>Put OAuth in front.</strong> Either the server implements MCP's OAuth-based authorization, or a proxy in front of it does. This is usually the bulk of the work, and it's the step you can't skip.</li>
<li><strong>Add the connector.</strong> Paste the public URL, including the MCP path, as a custom connector in ChatGPT or Claude, and sign in.</li>
</ol>
<p>The risks come with the URL. The moment the tunnel is up, your tools have a public address. Without sign-in, anyone who finds the URL can call them, and a hard-to-guess URL isn't a password: URLs leak through logs, browser history and screenshots. Run the server as a normal user, never as administrator or root, so a bad call can't do more than that account can. Expose only the tools you need. Close the tunnel when you're done, not weeks later.</p>
<h2>Option B: let the computer dial out</h2>
<p>The other pattern turns the connection around. A small agent on your computer opens an outgoing connection to a hosted MCP service and keeps it open. Your AI app connects to that service over HTTPS, with sign-in. When the model calls a tool, the service passes the request down the open connection to your computer, the agent runs it, and the result comes back the same way. Nothing on your computer listens on the internet, so there is no URL pointing at your machine to leak.</p>
<p>The trade-off is trust: requests and their output pass through the hosted service, so you are trusting whoever runs it.</p>
<p>I build Local Commander, which works this way, so I'm biased. The agent on each computer opens an outgoing WebSocket to localcmd.app and waits for work. Your AI app connects to <code>https://localcmd.app/mcp</code> and signs in with OAuth. From then on, a message typed into Claude on your phone can run on the PC under your desk:</p>
<blockquote>
<p>On Home PC, run the tests in my project folder and tell me what failed and why.</p>
</blockquote>
<p>The model reads files, runs commands, checks Git or asks a local web service whether it answers, on the computer you named. If more than one computer is online and you didn't say which, the server's instructions tell the model to ask instead of guessing. It works from ChatGPT, Claude, Cursor and other apps that support remote MCP with sign-in.</p>
<p>Setup takes four steps and no code:</p>
<ol>
<li><strong>Install.</strong> On each computer, run <code>npx local-commander-agent@latest</code>. You need Node.js 20 or later, on Windows, macOS or Linux.</li>
<li><strong>Approve.</strong> Confirm the pairing in your browser at localcmd.app.</li>
<li><strong>Choose access.</strong> Your whole user account, which is the default once you approve, or only the folders you pick.</li>
<li><strong>Connect your AI.</strong> Add <code>https://localcmd.app/mcp</code> as a remote MCP server in ChatGPT, Claude, Cursor or another app, and sign in with your Local Commander account.</li>
</ol>
<p>No router settings, no tunnel. If you have more than one computer, the same chat reaches all of them; I wrote about that in <a href="https://netbka.hashnode.dev/how-to-run-one-task-on-all-your-computers-from-a-single-chatgpt-or-claude-chat">How to run one task on all your computers from a single ChatGPT or Claude chat</a>.</p>
<h2>Which one to choose</h2>
<ul>
<li><strong>A tunnel</strong>, if you already run your own MCP server, want to own every piece of it, and are ready to build and maintain the sign-in. The tunnel provider still carries the traffic, but the server, the tools and the login are yours.</li>
<li><strong>A relay</strong>, if you want several computers in one chat, don't want anything on your machines reachable from the internet, or don't want to run an OAuth setup yourself.</li>
<li><strong>Neither</strong>, if you only use a desktop app on one computer. A local MCP server over stdio is simpler.</li>
</ul>
<h2>Limits, stated plainly</h2>
<p>For the relay route, and for Local Commander in particular:</p>
<ul>
<li><strong>The computer has to be on.</strong> Awake, online and running the agent. A sleeping laptop can't answer.</li>
<li><strong>One agent per computer.</strong> Each machine you want to reach needs its own install and approval.</li>
<li><strong>Commands and files, not the screen.</strong> It isn't screen sharing, and there's no mouse control. If a job only works by clicking through an app, use remote desktop or a computer-use tool.</li>
<li><strong>It isn't a sandbox.</strong> Once a computer is approved, the AI can do what your user account can do there. Folder rules prevent accidents, like the wrong folder or a stray delete, but they aren't a wall. For stronger isolation, run the agent under a separate user account.</li>
<li><strong>Output goes to your AI app.</strong> Whatever a command returns goes back to the chat, and from there it follows that app's rules.</li>
</ul>
<h2>FAQ</h2>
<p><strong>Do I need to open a port on my router for either option?</strong> No. Both dial out from your computer. The difference is what ends up public: a tunnel gives your own server a public URL, while a relay gives your computer none. The public endpoint is the hosted service, behind sign-in.</p>
<p><strong>Does this work from the phone app?</strong> Yes, wherever the phone app supports the connector you added: it calls tools from the provider's side, like the web app. With Local Commander, the computer still has to be awake, online and running the agent.</p>
<p>If you've hit this wall, I'd like to hear which route you took and where it got in your way. The setup steps are also on the guide page: <a href="https://localcmd.app/control-multiple-computers-with-ai">https://localcmd.app/control-multiple-computers-with-ai</a>. You can block commands and revoke a computer or an AI app at localcmd.app at any time.</p>
<p><em>Originally published at <a href="https://localcmd.app/use-cases/connect-web-ai-to-your-computer">localcmd.app</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to run one task on all your computers from a single ChatGPT or Claude chat]]></title><description><![CDATA[Few people who work with computers have just one. There's the work machine, the PC at home, maybe a small server or a cloud VM, and a parent's laptop in…]]></description><link>https://netbka.hashnode.dev/how-to-run-one-task-on-all-your-computers-from-a-single-chatgpt-or-claude-chat</link><guid isPermaLink="true">https://netbka.hashnode.dev/how-to-run-one-task-on-all-your-computers-from-a-single-chatgpt-or-claude-chat</guid><dc:creator><![CDATA[Peter Mamrukov]]></dc:creator><pubDate>Fri, 23 Oct 2026 08:51:32 GMT</pubDate><content:encoded><![CDATA[<p>Few people who work with computers have just one. There's the work machine, the PC at home, maybe a small server or a cloud VM, and a parent's laptop in another city that only gets attention when it breaks.</p>
<p>Each of them is a separate trip. Open a remote session, SSH in, walk to the other room, or talk your mom through Settings over the phone. Then do the same thing again on the next machine.</p>
<p>The AI chat you already use knows most of the commands for those jobs. What it lacks is a way onto your computers. This post shows one way to give it that: real prompts, the setup, and where it stops being the right tool.</p>
<h2>How it works</h2>
<p>I build Local Commander, so this is the setup I know best. It has two parts. A small agent runs on each computer under your user account; it opens an outgoing connection to localcmd.app and waits for work, so there's no port forwarding to set up. Your AI app connects to the hosted MCP server at <code>https://localcmd.app/mcp</code> (Streamable HTTP, OAuth sign-in). When you ask for something, the model calls tools on that server, such as read a file, search, run a command, check Git or ask a local web service whether it answers, and each call runs on the computer it was addressed to. Independent tasks on different computers run side by side; work on the same folder waits its turn. If more than one computer is online and you didn't say which one, the server's instructions tell the model to ask instead of guessing. It works from ChatGPT, Claude, Cursor and other apps that support remote MCP with sign-in.</p>
<h2>Three things to ask</h2>
<p>Name computers the way they appear in your account. The prompts below are examples; change the names and details to match yours.</p>
<h3>1. Which server needs attention?</h3>
<p>You have a few machines that are supposed to just run. Instead of logging in to each one:</p>
<blockquote>
<p>Check disk space, memory and failed services on all my servers and tell me which one needs attention.</p>
</blockquote>
<p>The model sends the same kind of check to each computer, reads what comes back and gives you one answer instead of a row of terminal windows. Then follow up with "Show me the command and output you based that on." Ask for the evidence, not only the verdict.</p>
<h3>2. Same project, two machines, different results</h3>
<p>The build passes on your desktop and fails on the laptop. Before anyone touches code:</p>
<blockquote>
<p>Compare this project on Work PC and Laptop: Git revision, Node and package-manager versions, the lockfile and the build command. Then run the build on both at the same time and show me the first difference that matters, as a table with one column per computer. Don't install anything or edit files.</p>
</blockquote>
<p>If the two machines are on different revisions, you see that before anyone starts blaming the environment.</p>
<h3>3. Every computer in the family</h3>
<p>Disk space is the classic. Include the machines you would otherwise have to visit:</p>
<blockquote>
<p>Check free disk space on every computer, including Mom's laptop. On any with less than 10% free, list the biggest folders in the user's profile. Don't delete or move anything.</p>
</blockquote>
<p>When one of them turns out to be the real problem, stay in the same chat and narrow it down:</p>
<blockquote>
<p>On Mom's laptop, find out why her photo app no longer starts. Check its error logs, whether it is running, and free disk space. Explain it in plain words I can read to her over the phone. Don't uninstall anything, restart the computer or change settings.</p>
</blockquote>
<p>The "don't" lines are worth keeping in any prompt that only needs to look. They steer the model, but they are not a lock; that is what access settings are for (more below).</p>
<h2>Set it up in four steps</h2>
<ol>
<li><strong>Install.</strong> On each computer, run <code>npx local-commander-agent@latest</code>. You need Node.js 20 or later.</li>
<li><strong>Approve.</strong> Confirm the pairing in your browser.</li>
<li><strong>Choose access.</strong> Your whole user account, which is the default once you approve, or only the folders you pick.</li>
<li><strong>Connect your AI.</strong> Add <code>https://localcmd.app/mcp</code> as a remote MCP server in ChatGPT, Claude, Cursor or another app, and sign in with your Local Commander account.</li>
</ol>
<p>There's no code to write. Do the install before you need it: a laptop in another city has to be set up while someone is sitting at it, ideally its owner, and with their permission.</p>
<h2>Limits, stated plainly</h2>
<ul>
<li><strong>It is not a sandbox.</strong> Once a computer is approved, the AI can do what your user account can do there, like you at the keyboard. Folder rules prevent accidents such as the wrong folder or a stray delete, but they aren't a wall. For stronger isolation, run the agent under a separate user account.</li>
<li><strong>The computer has to be reachable.</strong> Awake, online and running the agent. A machine that is off or offline can't be reached.</li>
<li><strong>Dropped connections aren't papered over.</strong> If a computer drops in the middle of a task, the work is not re-run on a guess. Each request ends as done, failed or unknown, and an unknown one waits for you to check.</li>
<li><strong>It works on your computers, not your network.</strong> The server's instructions tell the model to decline port scans and probes of other hosts.</li>
<li><strong>The model can be wrong.</strong> It can misread output or pick the wrong fix. Ask for the commands and output behind an answer before you act on it.</li>
<li><strong>Output goes to your AI app.</strong> Whatever a command returns goes back to the AI app, and from there it follows that app's rules.</li>
</ul>
<p>You can block commands and revoke a computer or an AI app at localcmd.app at any time.</p>
<h2>When something else fits</h2>
<ul>
<li><strong>Tasks that only work through the screen</strong>, such as clicking through an app with no command line. Use remote desktop or a computer-use tool.</li>
<li><strong>Repeatable admin jobs across many servers.</strong> Have the AI write the script, then run it with Ansible or over SSH against an inventory you keep. That gives you something you can review and rerun, which a chat doesn't.</li>
<li><strong>A managed company fleet with patching and compliance.</strong> That is what remote monitoring and management (RMM) products are for; this doesn't replace them.</li>
<li><strong>One computer and one AI app.</strong> That app's own computer features may be simpler.</li>
<li><strong>Web tasks that don't touch files on your machines.</strong> A cloud agent needs nothing installed.</li>
<li><strong>One computer, nothing hosted.</strong> The open-source edition (MIT) is a local MCP server for desktop clients such as Claude Desktop, Cursor and Cline, and runs without an account: <a href="https://github.com/netbka/local-commander-mcp-agent">https://github.com/netbka/local-commander-mcp-agent</a></li>
</ul>
<h2>FAQ</h2>
<p><strong>Can I do this from my phone?</strong> Yes, through any AI app on your phone that is connected to Local Commander. The computer must be awake, online and running the agent. If your deploy runs from your work PC, you can start it from a train, as long as that PC is on.</p>
<p><strong>Do I need to write code?</strong> No. Install the agent, approve it, and type requests in the AI chat you already use.</p>
<p><strong>Can it run the same task on all my computers at once?</strong> Yes. Ask for it in one message. Independent tasks run side by side; work on the same folder waits its turn.</p>
<p><strong>Which systems does the agent support?</strong> Windows 11 x64, macOS 14 or later on Apple Silicon, and Linux with a systemd user session (Ubuntu 24.04 x64 or arm64), with Node.js 20 or later.</p>
<p><strong>Does it show me the other computer's screen?</strong> It isn't a screen-sharing tool. It works through commands, files and logs, with no mouse control. If a fix needs someone to click through a dialog, use screen sharing.</p>
<p>If your machines are spread across more than one place, I'd like to hear which job you would hand over first, and where this setup gets in your way. The same steps are on the guide page: <a href="https://localcmd.app/control-multiple-computers-with-ai">https://localcmd.app/control-multiple-computers-with-ai</a></p>
<p><em>Originally published at <a href="https://localcmd.app/use-cases/run-one-task-on-all-your-computers">localcmd.app</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Why your coding agent keeps breaking on Windows, and four fixes that hold]]></title><description><![CDATA[For a while my workflow with AI was: the chat suggests a fix, I paste it into the terminal, run the tests, copy the error back. I was a very slow USB cable…]]></description><link>https://netbka.hashnode.dev/why-your-coding-agent-keeps-breaking-on-windows-and-four-fixes-that-hold</link><guid isPermaLink="true">https://netbka.hashnode.dev/why-your-coding-agent-keeps-breaking-on-windows-and-four-fixes-that-hold</guid><category><![CDATA[Windows]]></category><category><![CDATA[Powershell]]></category><category><![CDATA[ai agents]]></category><category><![CDATA[Developer Tools]]></category><dc:creator><![CDATA[Peter Mamrukov]]></dc:creator><pubDate>Sun, 18 Oct 2026 09:01:12 GMT</pubDate><content:encoded><![CDATA[<p>For a while my workflow with AI was: the chat suggests a fix, I paste it into the terminal, run the tests, copy the error back. I was a very slow USB cable between the model and my Windows PC. Agent modes were supposed to end that. On Windows they often don't, and the reasons are fixable.</p>
<h2>Two failures you've probably seen</h2>
<p><strong>The agent writes a command your shell won't parse.</strong> It chains steps with <code>&amp;&amp;</code> in Windows PowerShell 5.1, mangles backslashes, or runs a bash-style command that resolves to a different Windows program. A Cursor forum thread calls <a href="https://forum.cursor.com/t/powershell-in-cursor-is-consistently-broken-endless-syntax-errors-not-isolated-cases/149548">PowerShell in Cursor "consistently broken"</a>, and a Claude Code issue reports that <a href="https://github.com/anthropics/claude-code/issues/5049">native Windows runs aren't really shell aware</a>: <code>move</code> not found, backslashes broken, <code>find</code> resolving to the Windows binary.</p>
<p><strong>The agent starts a dev server and the chat never comes back.</strong> <code>npm run dev</code> doesn't exit, so the tool call waits forever, or the agent decides the server started when it didn't. Kill the terminal and the server often keeps its port; <a href="https://forum.cursor.com/t/cursor-occupying-ports-and-not-freeing-up-when-the-terminal-window-is-killed/134793">one Cursor user</a> put it as "I have to manually kill it."</p>
<p>Both come from the same place. The agent is handed a terminal and expected to type into it like a person. A person knows which shell they're in and when to stop waiting. A model guesses.</p>
<h2>Fix 1: pass a program and its arguments, not a command string</h2>
<p>Most quoting bugs disappear when nothing parses a command line. If you write your own agent tools or scripts, start real executables directly:</p>
<pre><code class="language-js">// Node: no shell in between
import { execFile } from "node:child_process";
execFile("git", ["status", "--short"], { cwd: "C:\\work\\my-app" }, (err, stdout, stderr) =&gt; { /* ... */ });
</code></pre>
<pre><code class="language-python"># Python: a list, and no shell=True
subprocess.run(["git", "status", "--short"], cwd=r"C:\work\my-app", check=True)
</code></pre>
<p>One Windows catch: <code>npm</code>, <code>npx</code>, <code>pnpm</code> and <code>yarn</code> are usually <code>.cmd</code> shims, and since Node's April 2024 security release, spawning a <code>.cmd</code> or <code>.bat</code> file needs <code>shell: true</code>, so <code>cmd.exe</code> gets involved after all. Keep that safe by refusing arguments that contain cmd metacharacters (<code>&amp; | &lt; &gt; ^ % !</code>) and quoting each argument yourself, or by running <code>node</code> on the tool's JavaScript entry point. If your agent talks to tools over MCP, prefer a command tool that takes <code>command</code> and <code>args</code> as separate fields over one that takes a shell string.</p>
<h2>Fix 2: stop PowerShell-only mistakes before they run</h2>
<p>A rule in your agent's instructions is a hint; a hook is enforced. In Claude Code, a <code>PreToolUse</code> hook with matcher <code>PowerShell</code> sees each command first, and exit code 2 blocks it and sends your message back to the model:</p>
<pre><code class="language-python">import json, sys
cmd = json.load(sys.stdin).get("tool_input", {}).get("command", "")
if "&lt;&lt;" in cmd:
    sys.stderr.write("PowerShell has no heredoc. Write the file with the Write tool, or use a @'...'@ here-string.")
    sys.exit(2)
</code></pre>
<p>The model reads the message and retries another way. The same pattern catches <code>&amp;&amp;</code> on Windows PowerShell 5.1, or helper functions named after built-in aliases such as <code>rd</code>.</p>
<h2>Fix 3: treat dev servers as processes, not terminal sessions</h2>
<p>Start long-running servers in the background and come back for the log, instead of waiting for them to exit. When one is left behind, the port leads you to it:</p>
<pre><code class="language-shell">netstat -ano | findstr :5173
taskkill /PID &lt;pid&gt; /T /F
</code></pre>
<p>The PID is the last column of the LISTENING line. <code>/T</code> stops the process together with everything it started (for Vite that includes esbuild); plain <code>Stop-Process</code> only takes the one PID. And before believing "the server is running", ask it:</p>
<pre><code class="language-shell">curl.exe -s -o NUL -w "%{http_code}" http://localhost:5173/
</code></pre>
<p><code>curl.exe</code> ships with current Windows 10 and 11; a <code>200</code> is worth more than a log line that says "ready".</p>
<h2>Fix 4: know where your guard rails end</h2>
<p>Limiting an agent to certain folders and keeping it away from <code>.env</code> and private keys stops the everyday accidents. People have <a href="https://www.theregister.com/2026/01/28/claude_code_ai_secrets_files/">watched agents read secret files</a> and <a href="https://www.docker.com/blog/coding-agent-horror-stories-the-rm-rf-incident/">delete home directories</a>; those are mostly habits, and habits can be blocked.</p>
<p>None of that is a sandbox. If <code>node</code> or <code>python</code> is allowed, a script can do anything your account can do, including deleting files. For a real wall, run the agent's tools in a container, under a separate low-privilege account, or in a VM.</p>
<h2>Where these notes come from</h2>
<p>I maintain an open-source MCP server, local-commander-mcp-agent (MIT), that packages fixes 1, 3 and part of 4 for agents; it was built around exactly these problems: <a href="https://github.com/netbka/local-commander-mcp-agent">https://github.com/netbka/local-commander-mcp-agent</a>. If you have a Windows setup that still trips your agent up (unusual paths, non-English usernames, locked-down corporate machines), I'd like to hear about it.</p>
<p><em>This article was drafted by an AI agent from my project notes and the threads linked above; every command, quote and link was checked before publishing.</em></p>
<p><em>Originally published at <a href="https://localcmd.app/use-cases/coding-agents-on-windows">localcmd.app</a>.</em></p>
]]></content:encoded></item></channel></rss>