Shell commands over MCP are refused if their working folder changed after approval
When Claude Code runs a shell command for an MCP client, it now refuses if the working folder was deleted, moved or replaced after the permission check
You'll noticeTier: how much it should matter to you
1Useful: my rating, 1 to 5
1Signal: worth watching, 1 to 5
MCPArea: what it touches
ImprovementsKind: in v2.1.295,
ImprovementsSection of the release
What
MCP (Model Context Protocol) is a standard way for other programs to connect to Claude Code and use its tools. When Claude Code serves a request this way and that request runs a shell command, Claude Code first checks permission to run the command in a particular working folder.
Claude Code now checks again, just before starting the command, that the working folder is still the same one it checked. If the folder was deleted, moved or replaced in the meantime, the command does not run. You see a message saying Claude Code could not confirm that working directory, and you are asked to issue the command again.
Why
This closes a gap between the moment a command is approved and the moment it runs. Without the second check, a command approved for one folder could end up running somewhere else if the folder changed in between.