How a Claude Code session froze my Mac with a 288 GB text file A developer traced a frozen Mac to a Claude Code session whose shell loop grew a single text file to 288 GB in about 12 minutes. The loop redirected output to /tmp/qa/review-all.txt while globbing /tmp/qa/review-*.txt, so the output file matched its own input pattern; BSD cat on macOS, unlike GNU coreutils, does not detect that an input is the output file and kept appending until a write failed at 96% disk usage. The developer killed the lingering cat and grep processes, deleted the file to recover space from 37 GiB to 306 GiB, and recommended excluding the output path from the glob, checking file sizes with stat, and setting ulimit -f for agent-run commands. My Mac suddenly became unresponsive this morning. The disk was almost full, and one text file in /tmp had grown to 288 GB in about 12 minutes. I run a lot of Claude Code sessions at once, so the first question was which one, if any, was writing it. lsof lists the processes that have a file open: lsof /tmp/qa/review-all.txt It showed a cat and a grep . Walking up the parent chain with ps -o pid,ppid,command -p