Conda Environment Activation Fails in Windows Terminal CLI Mode
Bug Description
I'm using Claude code on Windows with the Windows Terminal and in command prompt mode. I'm using it for AI training and inference with multiple miniforge conda enviroments. When I try and activate conda environments inside the Claude prompt either by prompting Claude or by using the!bash command, I always get an error message which says I have to run conda init before conda activate. However, if I exit from Claude and run conda_activate directly from my command prompt command line, it works fine.If I then restart Claude, it will be able to execute Python within the activated Conda environment. I also have a WSL environment working which I have used with Claude. It seems like when I run conda activate, it is defaulting back to that bash Linux environment. Some other conda commands, like conda env list, seem to work fine with the ! inside Claude.
Environment Info
- Platform: win32
- Terminal: windows-terminal
- Version: 1.0.58
- Feedback ID: bfc78654-aa24-4910-bc29-aaf9082363f4
Errors
[{"error":"Error: Command failed: tasklist | findstr /I \"Code.exe Cursor.exe Windsurf.exe idea64.exe pycharm64.exe webstorm64.exe phpstorm64.exe rubymine64.exe clion64.exe goland64.exe rider64.exe datagrip64.exe appcode.exe dataspell64.exe aqua64.exe gateway64.exe fleet.exe studio64.exe\"\nFINDSTR: Cannot open Code.exe Cursor.exe Windsurf.exe idea64.exe pycharm64.exe webstorm64.exe phpstorm64.exe rubymine64.exe clion64.exe goland64.exe rider64.exe datagrip64.exe appcode.exe dataspell64.exe aqua64.exe gateway64.exe fleet.exe studio64.exe\r\n\n at genericNodeError (node:internal/errors:983:15)\n at wrappedFn (node:internal/errors:537:14)\n at checkExecSyncError (node:child_process:883:11)\n at execSync (node:child_process:955:15)\n at F7 (file:///C:/Users/robin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:844:5958)\n at Br (file:///C:/Users/robin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:1325:1937)\n at file:///C:/Users/robin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2778:9388\n at async file:///C:/Users/robin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2529:7034\n at async Promise.all (index 12)\n at async U38 (file:///C:/Users/robin/AppData/Roaming/npm/node_modules/@anthropic-ai/claude-code/cli.js:2529:6993)","timestamp":"2025-07-23T16:36:52.957Z"},{"error":"RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded\n at Socket.onChildStdout (node:child_process:482:14)\n at Socket.emit (node:events:518:28)\n at Socket.emit (node:domain:489:12)\n at addChunk (node:internal/streams/readable:561:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n at Readable.push (node:internal/streams/readable:392:5)\n at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)","timestamp":"2025-07-23T16:36:53.176Z"}]This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗