{"version":"2.1.314","anchor":"bash-commands-now-unalias-and-unset-which-and-unsetenv-s","canonical_anchor":"bash-commands-now-unalias-and-unset-which-and-unsetenv-s","heading":"Shell commands now clear any which or unsetenv override before running","tier":"notice","area":"Bash Tool","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.314\/e\/bash-commands-now-unalias-and-unset-which-and-unsetenv-s","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.314","markdown":"### Shell commands now clear any `which` or `unsetenv` override before running\n\nBefore each shell command, Claude Code removes any alias or function named `unsetenv`, and, behind a switch, one named `which`\n\n**What**\n\nBefore Claude Code runs a shell command, it puts a short setup step in front of it, called a prefix. That prefix now removes any alias or shell function named `unsetenv`, so the standard command is used instead. An alias or shell function is a user-defined shortcut that replaces a command. A matching step for `which` is also added, but only when a server-controlled switch is turned on.\n\nClaude Code also now recognises the environment variables bash uses to hand such functions from one shell to the next: `BASH_FUNC_which%%` and `BASH_FUNC_unsetenv%%`, plus their `()` and `__BASH_FUNC<...>()` forms. The parts of the prefix are now joined into one chain. If you set a wrapper with `CLAUDE_CODE_SHELL_PREFIX`, it is still applied around the whole chain.\n\n**Why**\n\nIf your shell setup defines its own `which` or `unsetenv`, those versions could change how Claude Code's shell setup behaves. Clearing them first means Claude Code works with the standard commands. The `which` step depends on a switch, so the part that always applies is the `unsetenv` cleanup.\n\n- Area: Bash Tool\n- Tier: You'll notice\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}