-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: claude code for windows #5057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1e982cd to
40ad899
Compare
|
@daniel-lxs Please remember on windows you can only pass 8kb worth of data in command line on windows system. --disallowedTools takes tool names space separated |
|
@daniel-lxs Let me know if I can help with something here. |
|
Thank you @gunpal5 We are testing this PR to make sure it works. |
|
@daniel-lxs Thanks, Please take your time and let me know if any changes required here. |
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at the changes and I think they could work, however I am a bit concerned about isolation of the windows-specific workaround since the integration is working quite well on other OSes.
I left a couple of suggestions on how to achieve this, let me know what you think!
src/integrations/claude-code/run.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cleanup happens in the finally callback, but if the Node.js process is killed unexpectedly (SIGKILL), this cleanup might not run. Have you considered adding a process exit handler or documenting that users might need to manually clean up the .claude-code-temp directory in such cases?
671f5d8 to
b45252d
Compare
|
✅ No security or compliance issues detected. Reviewed everything up to 24eb6e4. Security Overview
Detected Code ChangesNo code changes detected in this PR. Reply to this PR with |
|
@daniel-lxs I am trying to fix the claude code. claude code is calling weird tools like <claude_read_file> etc. |
…ecific WSL integration in Claude CLI
|
New Modifications, removed the Readme changes |
|
Looking at this PR, I'm wondering if the temporary file approach is necessary for Windows. Since PR #5186 already handles stdin piping for messages on non-Windows platforms, couldn't we use the same approach through WSL? The Windows-specific code could potentially be simplified to just prepend 'wsl' to the command while keeping the stdin piping logic. This would eliminate the need for temporary file creation, cleanup handlers, and path conversions. Also noticed the tool separator was changed from comma to space on line 117 - this affects all platforms, not just Windows. Was this change intentional? |
I could only find this solution just to match with the older implementation. I was avoiding the drastic changes. We can use stdin instead of temporary files. but still claude code tool calling will be an issue. Claude is not respecting the system prompt. I am not sure why.
Official documentation clearly mentions names of Tools should be space separated not comma separated. https://docs.anthropic.com/en/docs/claude-code/sdk#available-cli-options |
|
Thanks for the clarification. Yeah, I think it makes sense to revert the temporary file changes and keep the stdin approach. The tool separator fix looks good. Let's go with the simpler implementation - just prepending 'wsl' should be sufficient for Windows support. |
|
stdin only support actual input messages, system prompt has to be configured with command line only. Temporary file solution would be still needed for system prompt. |
|
The system prompt is set in the command itself, do you mean we need to export the system prompt to a file? |
|
Do we have to proxy commands over WSL? I tested this today and Roo works with claude code over WSL if you use the vscode WSL extension. Install Roo on the WSL side and run your commands, it will work (with some caveats, you need to code . from wsl or the environment is not configured correctly and you'll get an ENOENT error back that claude doesn't exist). |
|
Anthropic has just released native windows support. so I think this fix is not needed anymore. |
|
Where announcement? |
|
@hannesrudolph they released it silently. I've been using it for like 2 hours. |
fix: Claude Code provider for windows system. some of the changes might also be useful for non-windows systems as well.
closes: #5042
Important
Adds Windows support for Claude Code using WSL with platform-specific handling and tests.
run.tsto support Windows using WSL.systemPromptandmessagesinrunClaudeCode().runClaudeCodeOnWindows().runClaudeCodeOnWindows()andrunClaudeCodeOnNonWindows().windows-integration.spec.tsto test Windows-specific behavior using WSL.fs,path,os,execa, andreadlinein tests.runProcess()to dispatch to platform-specific functions.run.ts.This description was created by
for 30bf7a9. You can customize this summary. It will automatically update as commits are pushed.