[BUG] VSCode extension sets DEBUG=1, causing shell environment polution
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?
We've been struggling to figure this out for a few days, but finally found it. The VSCode Claude Extension (extension.js) is explicitly setting DEBUG=1 in the shell environment:
% prettier ~/.vscode/extensions/anthropic.claude-code-2.0.24-darwin-arm64/extension.js > extension.js
% grep 'process.env.DEBUG = "1"' extension.js -B10 -A10
}
}
async launchClaude(e, r, s, a, i, n) {
if (
(this.logger.log(`Launching Claude on channel: ${e}`),
this.channels.has(e))
)
throw new Error(`Channel already exists: ${e}`);
try {
let o = new $n();
process.env.DEBUG = "1";
let l = this.spawnClaude(
o,
r,
async (c, u, p) =>
this.requestToolPermission(e, c, u, p.suggestions || []),
a || null,
s,
i,
this.getMaxThinkingTokensForModel(n),
);
Setting DEBUG=1 causes all kinds of noise to be emitted by common packages like kube-ps1.sh. Related issue https://github.com/anthropics/claude-code/issues/10027 is simillar.
Ultimately I don't think the claude code action should be setting ANY environment variables that are not explicitly targeted at Claude behavior.
What Should Happen?
Do not set/override environment variables
Error Messages/Logs
Steps to Reproduce
Load the extension, createa claude window, and open a shell.. then echo $DEBUG
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.13
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗