[BUG] anthropic.claude-code@2.1.179 VS code extension polutes the process environment of other extensions with `NoDefaultCurrentDirectoryInExePath=1`
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
anthropic.claude-code@2.1.179 polutes the process environment with NoDefaultCurrentDirectoryInExePath=1
My personal opinion is that an extension should not inject an environment variable used by other extensions. Yes, other extensions can protect themselves and sanitize the environment when spawning a command. But this is a variable that changes system behavior.
What Should Happen?
The process environment shared by apps should not be modified. Should not have NoDefaultCurrentDirectoryInExePath=1 injected into it.
Error Messages/Logs
Steps to Reproduce
Create a VS code extension with this bit of pseudo code:
// Pseudo code running in a VS code extension
const options: SpawnOptions = {
env: undefined
};
const command = "c:\\temp\\\ninja.exe";
const args = ["--version];
if (getCurrentOS() === 'win32') {
const cwd = path.dirname(command);
command = path.basename(command);
options.shell = true;
options.cwd = cwd;
}
const child = spawn(command, args, options);
The code will behave differently depending on whether the anthropic.claude-code extension is in use or not.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.179 of the VS code extension for Claude
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗