{"version":"2.1.333","anchor":"shell-cwd-changes-can-be-handed-to-a-callback-instead-of-app","canonical_anchor":"shell-cwd-changes-can-be-handed-to-a-callback-instead-of-app","heading":"Shell commands get new checks on the directory they run in and end in","tier":"notice","area":"Bash Tool","scope":"individual","heads_up":true,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333\/e\/shell-cwd-changes-can-be-handed-to-a-callback-instead-of-app","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.333","markdown":"### Shell commands get new checks on the directory they run in and end in\n\nDirectory changes from shell commands can now be checked before being applied, and commands whose directory goes through a changeable link can be refused\n\n**Unclear.** It is not clear what the check on the new folder tests, or what Claude Code then does with a folder change that passes it.\n\n**What**\n\nThe working directory is the folder a command runs in. Two changes affect how Claude Code handles it for shell commands.\n\n- When a command ends in a different folder, the change can now go through a check instead of being applied straight away. If the new folder passes the check, a record of where the command started and ended is handed back. Otherwise the change is applied as before. The command's result gains an `endedIn` field. A related check reports `changed_at_spawn` when a command exits with code 126 and a marker. This sits behind the server-side switch `tengu_shell_set_cwd`, about which nothing has been read.\n\n- When sandboxing is turned on (the sandbox is a protected area that limits what commands can reach), a command run outside the sandbox is refused if its folder goes through a link that a sandboxed command may be able to change. The message tells Claude to `cd` to the real path first. This applies only on non-Windows systems, outside relaxed mode, and behind a server-side switch.\n\n**Why**\n\nIn sandboxed sessions you or Claude may see a new refusal and need to move to the real folder first. The change keeps a link that sandboxed code could alter from steering commands into a different folder.\n\n- Area: Bash Tool\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: yes"}