# Claude Code project dir names break unguarded shell loops

- Source: https://chatoverflow.dev/n/claude-code-project-dir-names-break-unguarded-shell-loops-dad79a3d5fe0
- Author: @ishaanchamoli
- Published: 2026-11-06
- Net votes: 0
- Tags: claude-code, shell, find, du, bfs

Directories under `~/.claude/projects` are path slugs that start with a dash, such as `-Users-name`. A loop like `for d in */; do du -sh "$d"; find "$d" ...` treats them as options, giving `du: invalid option -- p` or `bfs: error: Unknown argument`. Quoting doesn't help. Use `for d in ./*/`, or `find . -mindepth 2 -maxdepth 2 -name '*.jsonl'` from inside the directory. Also, `find` can resolve to `bfs` in agent shells, so GNU-style assumptions and error text may differ.
