[BUG] Claude Code VSCode Extension sets NODE_ENV=production in child process environment

Resolved 💬 2 comments Opened Jan 13, 2026 by ianderrington Closed Jan 21, 2026

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?

The Claude Code VSCode extension (v2.1.5) sets NODE_ENV=production in the environment inherited by all child processes (Bash tool executions, etc.). This causes unexpected behavior in development workflows.

What Should Happen?

Description

The Claude Code VSCode extension (v2.1.5) sets NODE_ENV=production in the environment inherited by all child processes (Bash tool executions, etc.). This causes unexpected behavior in development workflows.

To Reproduce

Open a project in VSCode with Claude Code extension installed
Ask Claude to run printenv | grep NODE_ENV
Observe output: NODE_ENV=production
Expected Behavior

The extension should either:

Not set NODE_ENV at all (inherit from user's environment)
Set NODE_ENV=development for development workflows
Provide a configuration option to control this behavior
Actual Behavior

NODE_ENV=production is hardcoded in the extension, affecting:

npm scripts that check NODE_ENV
Build tools (webpack, Next.js, etc.) that behave differently in production
Test frameworks
Any code with process.env.NODE_ENV conditionals
Impact

Development servers may not enable HMR or dev tooling
Debug/verbose logging may be suppressed
Source maps may not be generated
Tests may behave unexpectedly
Users have no visibility into why their environment behaves differently
Workaround

Explicitly set NODE_ENV in npm scripts:

"dev": "NODE_ENV=development next dev",
"test": "NODE_ENV=test jest"
Or use env -u NODE_ENV to unset before commands.

Environment

VSCode Version: 1.99.2 (Universal)
Claude Code Extension Version: 2.1.5
OS: macOS (darwin-arm64)

Error Messages/Logs

Steps to Reproduce

Open a project in VSCode with Claude Code extension installed
Ask Claude to run printenv | grep NODE_ENV
Observe output: NODE_ENV=production

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.3 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

Description

The Claude Code VSCode extension (v2.1.5) sets NODE_ENV=production in the environment inherited by all child processes (Bash tool executions, etc.). This causes unexpected behavior in development workflows.

To Reproduce

Open a project in VSCode with Claude Code extension installed
Ask Claude to run printenv | grep NODE_ENV
Observe output: NODE_ENV=production
Expected Behavior

The extension should either:

Not set NODE_ENV at all (inherit from user's environment)
Set NODE_ENV=development for development workflows
Provide a configuration option to control this behavior
Actual Behavior

NODE_ENV=production is hardcoded in the extension, affecting:

npm scripts that check NODE_ENV
Build tools (webpack, Next.js, etc.) that behave differently in production
Test frameworks
Any code with process.env.NODE_ENV conditionals
Impact

Development servers may not enable HMR or dev tooling
Debug/verbose logging may be suppressed
Source maps may not be generated
Tests may behave unexpectedly
Users have no visibility into why their environment behaves differently
Workaround

Explicitly set NODE_ENV in npm scripts:

"dev": "NODE_ENV=development next dev",
"test": "NODE_ENV=test jest"
Or use env -u NODE_ENV to unset before commands.

Environment

VSCode Version: [your version]
Claude Code Extension Version: 2.1.5
OS: macOS (darwin-arm64)

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗