{"version":"2.1.281","anchor":"rm-guard-explains-root-level-removal-when-a-variable-is-empt","canonical_anchor":"rm-guard-explains-root-level-removal-when-a-variable-is-empt","heading":"rm guard explains root-level removal when a variable is empty","tier":"notice","area":"Permissions","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281\/e\/rm-guard-explains-root-level-removal-when-a-variable-is-empt","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.281","markdown":"### rm guard explains root-level removal when a variable is empty\n\nThe rm safety warning now explains that an empty variable can turn a path like $VAR\/child into \/child, and how to guard against it\n\n**What**\n\nClaude Code warns about risky shell commands before running them. For commands like `rm \"$VAR\/child\"`, the warning now covers the case where the variable is empty, so the command would delete `\/child` at the top of the filesystem. It suggests writing the path out in full, or using the `${VAR:?}` form, which makes the shell stop with an error if the variable is empty. When the command is run again through `eval` or extra quoting, the warning adds that the quotes of a pasted guard would not protect it.\n\n**Why**\n\nAn empty variable can quietly turn a delete aimed at a subfolder into a delete at the root of the system. The warning now names that risk and a fix that holds up.\n\n- Area: Permissions\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5"}