-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: enable Claude Code provider to run natively on Windows #5615
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
feat: enable Claude Code provider to run natively on Windows #5615
Conversation
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.
Thank you @SannidhyaSah !
It seems like stdin only accepts user messages:
https://docs.anthropic.com/en/docs/claude-code/sdk#streaming-json-input
I don't think I have seen issues with the way we send the system prompt currently.
@daniel-lxs the problem was windows only has a limit of 8192 characters that can be sent in the terminal. And that meant the claude code provider wasn't really working as the system prompt wasn't being sent . Our system prompt is 131k charactes. I tinkered with it to make it work and was able to get it running with this approach. Basically it's either this . Or not working at all . For now .. |
It seems that Claude Code doesn't support overwriting the system prompt with stdin
…ndows - Add OS detection to use stdin for both system prompt and messages on Windows - Keep existing behavior on non-Windows platforms (system prompt as arg, messages via stdin) - Consolidate verbose comments to be more concise - Add comprehensive test coverage for both platform scenarios - Resolves Windows command-line length limitations (8191 chars)
e2e2dd0
to
dc7a9c6
Compare
Related: anthropics/claude-code#3411 |
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.
This PR successfully enables Claude Code on Windows by working around the command-line length limitation.
Note: This is a temporary workaround using undocumented stdin behavior for system prompts. Be aware that on Windows, the system prompt may be counted twice in token usage - once from the stdin data and once if Claude Code still processes the default system prompt internally.
Approving as it unblocks Windows users while a more permanent solution can be explored with the Claude Code team.
* main: fix: Resolve confusing auto-approve checkbox states (RooCodeInc#5602) fix: prevent empty mode names from being saved (RooCodeInc#5766) (RooCodeInc#5794) Format time in ISO 8601 (RooCodeInc#5793) fix: resolve DirectoryScanner memory leak and improve file limit handling (RooCodeInc#5785) Fix settings dirty check (RooCodeInc#5779) feat: increase Ollama API timeout values and extract as constants (RooCodeInc#5778) fix: Exclude Terraform and Terragrunt cache directories from checkpoints (RooCodeInc#4601) (RooCodeInc#5750) Move less commonly used provider settings into an advanced dropdown (RooCodeInc#5762) feat: Add configurable error & repetition limit with unified control (RooCodeInc#5654) (RooCodeInc#5752) list-files must include at least the first-level directory contents (RooCodeInc#5303) Update evals repo link (RooCodeInc#5758) Feature/vertex ai model name conversion (RooCodeInc#5728) fix(litellm): handle baseurl with paths correctly (RooCodeInc#5697) Add telemetry for todos (RooCodeInc#5746) feat: add undo functionality for enhance prompt feature (fixes RooCodeInc#5741) (RooCodeInc#5742) Fix max_tokens limit for moonshotai/kimi-k2-instruct on Groq (RooCodeInc#5740) Changeset version bump (RooCodeInc#5735) Add changeset for v3.23.12 patch release (RooCodeInc#5734) Update the max-token calculation in model-params to use the shared logic (RooCodeInc#5720) Changeset version bump (RooCodeInc#5719) chore: add changeset for v3.23.11 patch release (RooCodeInc#5718) Add Kimi K2 model and better support (RooCodeInc#5717) Fix: Remove invalid skip-checkout parameter from GitHub Actions workflows (RooCodeInc#5676) feat: add Cmd+Shift+. keyboard shortcut for previous mode switching (RooCodeInc#5695) Changeset version bump (RooCodeInc#5708) chore: add changeset for v3.23.10 patch release (RooCodeInc#5707) Add padding to the index model options (RooCodeInc#5706) fix: prioritize built-in model dimensions over custom dimensions (RooCodeInc#5705) Update CHANGELOG.md Changeset version bump (RooCodeInc#5702) chore: add changeset for v3.23.9 patch release (RooCodeInc#5701) Tweaks to command timeout error (RooCodeInc#5700) Update contributors list (RooCodeInc#5639) feat: enable Claude Code provider to run natively on Windows (RooCodeInc#5615) feat: Add configurable timeout for command execution (RooCodeInc#5668) feat: add gemini-embedding-001 model to code-index service (RooCodeInc#5698) fix: resolve vector dimension mismatch error when switching embedding models (RooCodeInc#5616) (RooCodeInc#5617) fix: [5424] return the cwd in the exec tool's response so that the model is not lost after subsequent calls (RooCodeInc#5667) Changeset version bump (RooCodeInc#5670) chore: add changeset for v3.23.8 patch release (RooCodeInc#5669)
Description
Fixes #5042
This PR enables the Claude Code provider to run natively on Windows by implementing a stdin-based approach for passing both system prompt and messages. This eliminates the Windows command-line length limitation (8191 characters) that was preventing Claude Code from working on Windows systems.
Background
Claude Code was recently added with native Windows support, but the integration in Roo Code was hitting Windows' command-line argument length limitations when passing large system prompts. The previous implementation passed the system prompt as a command-line argument, which would fail on Windows when the prompt exceeded ~8KB.
Changes Made
Technical Details
The key insight was that the Claude Code CLI accepts input via stdin (though this is undocumented). By passing both the system prompt and messages together through stdin, we:
Testing
Verification of Acceptance Criteria
Checklist
Additional Notes
This fix not only resolves the immediate Windows issue but also provides a more elegant solution that works consistently across all platforms. The stdin approach is cleaner and more scalable than trying to work around platform-specific command-line limitations."
Important
Refactor Claude Code provider to use stdin for input, bypassing Windows command-line length limits and simplifying platform-specific logic.
runProcess()
inrun.ts
to passsystemPrompt
andmessages
via stdin as JSON, bypassing Windows command-line length limits.--system-prompt
from command-line arguments inrun.ts
.run.spec.ts
to verify stdin-based input handling and ensure no--system-prompt
in args.This description was created by
for b9ba5ca. You can customize this summary. It will automatically update as commits are pushed.