Problem
ZCode desktop (Windows 11 Pro, v3.3.6) does not pass user environment variables into Bash subprocesses spawned by the Bash tool. Only ZCODE_* variables explicitly injected by ZCode are visible. This breaks documented Claude Code env vars like BASH_DEFAULT_TIMEOUT_MS, CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR, API_TIMEOUT_MS, etc.
This appears to be the same root cause as anthropics/claude-code#42203 ("Desktop app ignores env.PATH from settings.json — sandbox overrides").
Reproduction
- Set a user env var on Windows:
setx BASH_DEFAULT_TIMEOUT_MS "300000"
setx ZCODE_TEST_ENV_VAR "hello-from-setx"
- Restart ZCode desktop.
- Open a chat, ask the agent: "print all env vars containing ZCODE_TEST or BASH_DEFAULT".
- The agent runs
env | grep ... via Bash tool.
Expected
Both ZCODE_TEST_ENV_VAR=hello-from-setx and BASH_DEFAULT_TIMEOUT_MS=300000 should be visible in the subprocess.
Actual
ZCODE_APP_VERSION=3.3.6
ZCODE_RUNTIME_ENV=production
ZCODE_WINDOWS_APP_INSTALL_DIR=...
ZCODE_RG_BINARY=...
ZCODE_PROCESS_LABEL=local-1
ZCODE_BASE_URL=https://zcode.z.ai
ZCODE_ENV=production
No BASH_DEFAULT_TIMEOUT_MS, no ZCODE_TEST_ENV_VAR, no user-set vars. Only ZCode-injected ones appear.
Also tried: setting an env block in ~/.zcode/cli/config.json:
{ "env": { "BASH_DEFAULT_TIMEOUT_MS": "300000" } }
Same result — the var is not visible in subprocess.
Note: env field inside MCP servers DOES work
For comparison, the env field inside an MCP server config is honored correctly:
{
"mcp": { "servers": { "excel": {
"env": { "EXCEL_MCP_PAGING_CELLS_LIMIT": "4000" }
} } }
}
This works — the var reaches the MCP server process. The issue is specifically with the Bash/Read/Edit/Write built-in tools.
Impact
- Documented Claude Code env vars (
BASH_DEFAULT_TIMEOUT_MS, API_TIMEOUT_MS, CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR, etc.) are non-functional in ZCode desktop.
- Users relying on these for long-running test suites / deploy scripts get silent breakage with default 2-min timeout.
Environment
- ZCode 3.3.6, Windows 11 Pro (10.0.26200).
- GLM-5.2 via Z.ai Coding Plan (Max).
- PowerShell
setx confirmed the vars were stored in User registry.
Related
Proposal
Either:
- Honor the
env block in ~/.zcode/cli/config.json for built-in tool subprocesses (matching Claude Code docs).
- Or inherit user-level environment variables on desktop launch.
- Or document clearly that these env vars are CLI-only and provide a ZCode-specific way to set them.
Thanks — happy to provide more diagnostics if useful.
Problem
ZCode desktop (Windows 11 Pro, v3.3.6) does not pass user environment variables into Bash subprocesses spawned by the Bash tool. Only
ZCODE_*variables explicitly injected by ZCode are visible. This breaks documented Claude Code env vars likeBASH_DEFAULT_TIMEOUT_MS,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR,API_TIMEOUT_MS, etc.This appears to be the same root cause as anthropics/claude-code#42203 ("Desktop app ignores env.PATH from settings.json — sandbox overrides").
Reproduction
env | grep ...via Bash tool.Expected
Both
ZCODE_TEST_ENV_VAR=hello-from-setxandBASH_DEFAULT_TIMEOUT_MS=300000should be visible in the subprocess.Actual
No
BASH_DEFAULT_TIMEOUT_MS, noZCODE_TEST_ENV_VAR, no user-set vars. Only ZCode-injected ones appear.Also tried: setting an
envblock in~/.zcode/cli/config.json:{ "env": { "BASH_DEFAULT_TIMEOUT_MS": "300000" } }Same result — the var is not visible in subprocess.
Note: env field inside MCP servers DOES work
For comparison, the
envfield inside an MCP server config is honored correctly:{ "mcp": { "servers": { "excel": { "env": { "EXCEL_MCP_PAGING_CELLS_LIMIT": "4000" } } } } }This works — the var reaches the MCP server process. The issue is specifically with the Bash/Read/Edit/Write built-in tools.
Impact
BASH_DEFAULT_TIMEOUT_MS,API_TIMEOUT_MS,CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR, etc.) are non-functional in ZCode desktop.Environment
setxconfirmed the vars were stored in User registry.Related
envfield for MCP servers works (so the parser exists), it's the Bash tool subprocess that is isolated.Proposal
Either:
envblock in~/.zcode/cli/config.jsonfor built-in tool subprocesses (matching Claude Code docs).Thanks — happy to provide more diagnostics if useful.