Claude Code now explains the risk of running env -P with a relative directory
Claude Code's bash command safety analyzer, which explains why a command might be risky before it runs, now has a specific explanation for env -P: when given a relative directory, the program env runs is looked up starting from the directory you launched the command in, not from a fixed location. This joins existing explanations for commands that wrap other commands or run without a fixed shell, like parallel, script, su, and sudo.
This helps you understand why env -P with a relative path is flagged, since it means the actual program executed depends on where you happen to be standing when you run the command.