logoalt Hacker News

rixedtoday at 3:11 PM4 repliesview on HN

One hour ago, while looking casually at a package.json, I saw this and was horrified:

  rm -rf pkg/snippets & rmdir pkg\\snippets /s /q & wasm-pack build --target bundler && node prepare-web.js
Looked like a strange mix of unix shell and msdos batch that would, on my box, try to rmdir "/s" and "/q". I asked Claude about this, and he replied something like "Yes that's a standard and clever hack to delete a directory that works both on linux and windows!".

Poor Claude has been trained on so much awful human code that it required several prompts for it to admit that there was indeed a problem.

The industry is the process by which convenient crap like this gets standardized.


Replies

tremontoday at 3:50 PM

To meekly defend the indefensible here: it's not like rmdir on Linux (I won't speak for all Unixen) can cause loss of data, since it only removes empty directories.

show 2 replies
lokartoday at 3:20 PM

Yikes. I would never approve a PR with that in it.

show 1 reply
cozzydtoday at 3:25 PM

I hope the "standard" part is as much of a hallucination as "clever" is

PunchyHamstertoday at 3:24 PM

> Poor Claude has been trained on so much awful human code that it required several prompts for it to admit that there was indeed a problem.

Claude probably birthed this abomination in the first place