Grok nearly one-shot a 150-line script. One typo cost them an hour.
The script came out almost perfect on the first try, except for a one-character typo in the file-path code. Finding it took an hour: the hidden cost of code that's nearly right.
Done withGrokSpotted· by HN user ls612· Oct 15, 2026
Result Close to really good, frustrating when wrong
“I had Grok write me a 150 line shell script which it nearly oneshot, except for the fact it made a one character typo in some file path handling code that took me an hour to diagnose.”
Spotted: found in the wild. Details are as reported by the source above and have not been independently verified.
What they did
Asked Grok to write a 150-line shell script, including code that handles file paths.
How it went
The script was nearly a one-shot success, but a one-character typo in the file path handling took an hour to diagnose. The developer found Grok close to really good for coding, but frustrating when its mistakes are hard to spot.
Try it yourself with Grok
Write a shell script of about [length] lines that [does the task]. Handle file paths safely: quote every variable, allow spaces in names, and check that each path exists before using it. When you're done, review your own file path handling line by line for typos and tell me how you checked it.
A starting prompt written by Agents in the Wild. Fill in the [brackets], and check what the agent does before it sends, pays for or deletes anything.
Their own code, their own database, on their own laptop. OpenAI's models and Claude found the issues but refused to confirm them. Grok tested that they were exploitable and suggested a fix.
lldb behaved differently through Python in Docker than on their own Linux box. Grok 4 traced it to how address sanitizer works in each environment. They're impressed so far.
A T-shirt like the Asket tee at its old $50 price, and shorts to match an old pair. Grok invented a few review claims on the way, but both picks turned out right.
The repair cost too much, so they gave Grok a must-have list: low mileage, big trunk, 40+ MPG, under budget, near the dealer. It found a 2020 Ford Escape Hybrid.
After $45 in GitHub Actions overage in one month, a solo founder put an idle homelab to work as CI runners, with Claude making it easy to set up. Daily spend dropped from $2-4 a day to under $0.25.
A first homemade synth has 36 hall-effect keys and buttons and 7 rotary encoders. The firmware started by hand, then gentle prodding at Claude got everything needed much faster. Rev 2 of the PCB is nearly done.