Hacker News new | ask | show | jobs
by pmarreck 480 days ago
Claude 3.7 just rewrote the whole thing (just based on reading the webpage description) as a commandline app for me, so there's that.

And because it has no Internet access yet (and because I prompted it to use a workaround like this in that circumstance), the first thing it asked me to do (after hallucinating the functionality first, and then catching itself) was run `curl https://hypercritical.co/hyperspace/ | sed 's/<[^>]*>//g' | grep -v "^$" | clip`

("clip" is a bash function I wrote to pipe things onto the clipboard or spit them back out in a cross-platform linux/mac way)

    clip() {
      if command -v pbcopy > /dev/null; then
        [ -t 0 ] && pbpaste || pbcopy;
      else
        if command -v xclip > /dev/null; then
          [ -t 0 ] && xclip -o -selection clipboard || xclip -selection clipboard;
        else
          echo "clip function error: Neither pbcopy/pbpaste nor xclip are available." >&2;
          return 1;
        fi;
      fi
    }
2 comments

Ooh, could you share the source code? That seems like a perfect example for my "relying on AI code generation will subtly destroy your data" presentation.
Hah, I have not actually had a chance to run it as a test yet
Best upload the source code somewhere, before you do. Otherwise, we'll never know why you lost all your files.
I had to do additional work on it, and it’s slower than the posted app, but it works
Would you trust Claude with your hard drive?
Trust, but verify. We should always read and understand what gets spit out anyways.

When doing something with any risk potential I first ask the model for potential risks with the output, and then I manually read the code.

I also "recreated" this tool with Sonnet 3.7. The initial bash script worked (but was slow), and after a few iterations we landed on an fclones one-liner. I hadn't heard of fclones before, but works great! Saved a bunch of disk space today.

wow, just learned about fclones, does this also work with OS X’s CoW cloning?
Yes.