Skip to content

[FEATURE]: Local Claude Code CLI Provider #9677

Closed

Description

@dkraemerwork

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

If this feature is desired I can create a pull request. Its already implemented

Describe the enhancement you want to request

Summary:

Add support for using Claude Code CLI as a backend provider in OpenCode, allowing users to leverage their local Claude CLI installation directly within OpenCode's interface.

Motivation

  • Users with Claude Code CLI installed can use it through OpenCode without needing separate API keys
  • Enables access to Claude's full agentic capabilities (tool use, file editing, bash execution) via OpenCode's UI
  • Provides a bridge for users who prefer OpenCode's interface but want to use their existing Claude CLI setup

Configuration

Provider should be configurable via OpenCode config with options for:

  • CLI path (cliPath)
  • Working directory (cwd)
  • Permission mode
  • Tool routing preferences (handleToolsInOpenCode)
    Dependencies
  • Requires Claude Code CLI installed locally (claude command available)

Requirements

  • Implement LanguageModelV2 provider that spawns and communicates with Claude CLI
  • Support JSON streaming protocol for real-time responses
  • Handle tool call routing between Claude CLI and OpenCode
  • Map tool names between Claude CLI (PascalCase) and OpenCode (lowercase)
  • Support permission handling modes (default, acceptEdits, bypassPermissions, plan)
  • Enable session persistence across messages
  • Support multimodal input (images, PDFs)
  • Handle AskUserQuestion tool for interactive prompts
  • Properly communicate tool errors back to Claude for recovery
  • Manage child processes efficiently (reuse, cleanup)

This is how it looks:

Image Image Image Image

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 20, 2026
  2. github-actions commented on Jan 20, 2026

    @github-actions
    Contributor

    This issue might be related to existing feature requests and discussions:

    Please review these issues to see if they address your specific use case or if this represents a distinct feature request for local Claude CLI integration.

  3. dkraemerwork commented on Jan 20, 2026

    @dkraemerwork
    Author

    This issue might be related to existing feature requests and discussions:

    Please review these issues to see if they address your specific use case or if this represents a distinct feature request for local Claude CLI integration.

    None of these implement this feature

  4. dkraemerwork commented on Jan 23, 2026

    @dkraemerwork
    Author

    As mentioned by @rekram1-node in the PR #10097 I will close this issue and create a plugin for that.

  5. strudel333 commented on Jan 24, 2026

    @strudel333

    Looks like a good solution, did you create a plugin?

  6. dkraemerwork commented on Jan 24, 2026

    @dkraemerwork
    Author

    Looks like a good solution, did you create a plugin?

    Yes and no
    I did locally, but opencode doesnt provide way to introduce custom language model implementations via plugins. I think it will take a while, if at all this will be there in the future. So for now if you wanna use it you need to pull my branch from my fork and just run it locally.

  7. strudel333 commented on Jan 24, 2026

    @strudel333

    Cool, will do. Thanks for doing this. Sorry they didnt take the PR

  8. dkraemerwork commented on Jan 24, 2026

    @dkraemerwork
    Author

    Cool, will do. Thanks for doing this. Sorry they didnt take the PR

    Yeah no problem.
    Btw i just found out that anthropic walked back and the native 'opencode auth login' with max subscription works again. Probably still against TOS but atleast it works again natively

  9. broskees commented on Jan 24, 2026

    @broskees

    @dkraemerwork where did you hear that?

  10. dkraemerwork commented on Jan 24, 2026

    @dkraemerwork
    Author

    @dkraemerwork where did you hear that?

    Well, I'm using it.

  11. dkraemerwork commented on Jan 24, 2026

    @dkraemerwork
    Author

    @dkraemerwork where did you hear that?

    Image
  12. sittingmongoose commented on Feb 20, 2026

    @sittingmongoose

    Any chance you can publicly release this? I am working on a huge GUI based opensource platform somewhat like opencode and this is my last big issue, bridging the Claude Code CLI. I am curious how you are doing it and if it is going well.

  13. unixfox commented on Mar 16, 2026

    @unixfox

    hi, based on the idea and the PR from @dkraemerwork, I created the plugin https://github.com/unixfox/opencode-claude-code-plugin

  14. dkraemerwork commented on Mar 16, 2026

    @dkraemerwork
    Author

    Amazing

  15. khalilgharbaoui commented on Apr 25, 2026

    @khalilgharbaoui

    Drive-by note for anyone landing here looking for a Claude Code CLI provider in opencode: there is a maintained plugin on npm that wires this up today, no fork of opencode required.

    It is a fork of @unixfox opencode-claude-code-plugin with a few regressions fixed and published under my scope since the original looked dormant. Drop it into the plugin array in your opencode.json and you are set — the README covers the quirks (selective tool proxying, MCP bridge discovery, plan mode, MultiEdit pass-through) so worth a quick skim before configuring.

    cc @dkraemerwork @strudel333 in case it scratches the same itch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions