{"version":"2.1.311","anchor":"shell-exec-now-re-checks-the-working-directory-before-spawn","canonical_anchor":"shell-exec-now-re-checks-the-working-directory-before-spawn","heading":"Shell commands are refused if their working folder changed after approval","tier":"notice","area":"Bash Safety","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.311\/e\/shell-exec-now-re-checks-the-working-directory-before-spawn","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.311","markdown":"### Shell commands are refused if their working folder changed after approval\n\nClaude Code now refuses a shell command if its working folder points somewhere else, or is gone, since the command's permission check\n\n**What**\n\nBefore Claude Code runs a shell command (for example through the Bash tool), it checks whether the command is allowed. This is the permission check. The command then runs in a working folder. Claude Code now checks again, just before it starts the shell, that this folder still leads to the same place it did at the permission check.\n\n- If the folder now leads somewhere else, the command is refused.\n\n- If the folder is gone, the command is refused.\n\nThe refusal message says the working directory \"no longer leads where it did when this command was permission-checked\". It also tells Claude to issue the command again. The previous check caught only a folder that had gone missing. Claude Code also now records how much processor time the command uses.\n\n**Why**\n\nThis is a safety measure. A command you approved for one folder cannot quietly run in a different one. Some shell commands that used to run may now be refused and have to be issued again.\n\n- Area: Bash Safety\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: yes"}