Skip to content

Conversation

@roomote
Copy link
Collaborator

@roomote roomote commented Jun 18, 2025

Summary

This PR integrates Claude Code as a new provider into Roo Code, implementing the equivalent functionality from the referenced Cline PR.

Changes Made

  • Added Claude Code provider type definitions: New provider name and schema in
  • Created Claude Code model definitions: Added support for latest Claude models (Sonnet 4, Opus 4, Claude 3.7 Sonnet, etc.) in
  • Implemented ClaudeCodeHandler: Full provider implementation in with:
    • HTTP-based communication with Claude Code desktop application
    • Streaming response support compatible with Anthropic's format
    • Fallback token counting using tiktoken
    • Configurable base URL (defaults to )
    • Error handling for network and API issues
  • Added comprehensive test coverage: 14 test cases covering all functionality
  • Updated provider registration: Added to main API handler and exports

Technical Details

The provider connects to the Claude Code desktop application via HTTP API, supporting:

  • Streaming chat completions with real-time token usage tracking
  • Non-streaming completions for prompt enhancement
  • Token counting with graceful fallback
  • Multiple response format handling
  • Proper error propagation and logging

Testing

  • ✅ All existing tests pass
  • ✅ New provider tests pass (14/14)
  • ✅ Build and type checking successful
  • ✅ Linting passes

Acceptance Criteria

  • Claude Code provider is available in the provider list
  • Can make requests to Claude Code and receive responses
  • Streaming responses work correctly
  • Error handling works as expected
  • Tests verify all functionality
  • Execution traces remain in Claude Code logs (as per issue requirements)

Closes #4842

@roomote roomote requested review from cte, jr and mrubens as code owners June 18, 2025 15:51
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Jun 18, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Jun 18, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@cte
Copy link
Collaborator

cte commented Jun 18, 2025

@roomote - This implementation is all wrong. Your implementation should exactly mirror what you see here: https://github.com/cline/cline/pull/4111/files

When you're done make sure to credit Cline for the clever implementation.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 18, 2025
- Add claude-code to provider names and schema
- Create Claude Code model definitions using Anthropic models
- Implement ClaudeCodeHandler with HTTP-based communication
- Add Claude Code integration files (types.ts, run.ts)
- Register provider in main API handler
- Fix workspace access for testing compatibility

Credit to Cline for the clever implementation approach.

Addresses comment: #4843 (comment)
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jun 18, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Jun 18, 2025
@daniel-lxs daniel-lxs marked this pull request as draft June 18, 2025 17:13
@hannesrudolph hannesrudolph added PR - Draft / In Progress and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 18, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Jul 7, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request PR - Draft / In Progress size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Integrate Claude Code

4 participants