npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@seonggukchoi/opencode-claude-code-provider

v0.3.3

Published

OpenCode provider backed by Claude Code CLI

Readme

@seonggukchoi/opencode-claude-code-provider

Claude Code CLI based provider for OpenCode.

What it does

  • Exposes a custom LanguageModelV2 provider named claude-code
  • Runs claude -p --verbose --input-format text --tools "" --output-format stream-json as a pure LLM client
  • Injects OpenCode tool schemas into the Claude system prompt and converts <tool_call> text blocks into AI SDK tool-call parts
  • Keeps all tool execution inside OpenCode, including OpenCode-only tools such as todowrite and task
  • Persists the Claude session id in providerMetadata["claude-code"].sessionId
  • Sends prompt text over stdin so long transcript bootstrap does not hit argv size limits

Tool behavior

  • Claude native tools are disabled for every request
  • Claude must emit exactly one <tool_call>{"name":"...","arguments":{...}}</tool_call> block when a tool is needed
  • OpenCode executes the tool and feeds the result back through its normal tool loop

Known limits

  • Non-streaming generation is intentionally not supported
  • effort is retained for config compatibility but is not sent to the CLI yet
  • maxTurns is hardcoded to 1 because Claude does not execute tools directly in this mode
  • loadClaudeMd is hardcoded to false — CLAUDE.md loading is not supported
  • permissionMode is hardcoded to bypassPermissions (--dangerously-skip-permissions)
  • OpenCode custom providers still need a models block in config for model discovery
  • OpenCode 1.3.0 currently breaks direct file: package loading by appending @latest

Configuration examples

{
  "plugin": ["@seonggukchoi/opencode-claude-code-plugin"],
  "provider": {
    "claude-code": {
      "npm": "@seonggukchoi/opencode-claude-code-provider",
      "models": {
        "sonnet": { "id": "claude-sonnet-4-6" },
        "opus": { "id": "claude-opus-4-6" },
        "haiku": { "id": "claude-haiku-4-5" }
      }
    }
  },
  "model": "claude-code/sonnet"
}
  • Full config example: packages/opencode-claude-code-provider/docs/config.example.json
  • Minimal config example: packages/opencode-claude-code-provider/docs/config.minimal.example.json

OpenCode custom providers still require a models block for model discovery, so the minimal example keeps only the model ids.

For local unpublished testing, replace the package names in those examples with your local install strategy such as a tarball or registry override.

Local testing

  • Build:
    • pnpm --filter @seonggukchoi/opencode-claude-code-provider build
    • pnpm --filter @seonggukchoi/opencode-claude-code-plugin build
  • Smoke test:
    • pnpm --filter @seonggukchoi/opencode-claude-code-provider test:smoke
  • Smoke script:
    • packages/opencode-claude-code-provider/test/smoke.mjs
  • Current limitation:
    • OpenCode 1.3.0 breaks direct file: package loading by appending @latest

Failure handling

  • Missing CLI executable: expect a process spawn failure such as ENOENT
  • Unsupported auth status command on older CLI builds: use claude auth status || claude doctor
  • Invalid CLI JSONL output: the provider fails the stream with a parsing error
  • Invalid <tool_call> payloads are surfaced back as plain text instead of being executed

Release checklist

  • pnpm --filter @seonggukchoi/opencode-claude-code-provider test
  • pnpm --filter @seonggukchoi/opencode-claude-code-provider build
  • pnpm --filter @seonggukchoi/opencode-claude-code-provider test:smoke
  • Verify packages/opencode-claude-code-provider/docs/config.example.json
  • Verify packages/opencode-claude-code-provider/docs/config.minimal.example.json

Internal docs

  • Full config example: packages/opencode-claude-code-provider/docs/config.example.json
  • Minimal config example: packages/opencode-claude-code-provider/docs/config.minimal.example.json
  • Smoke test: packages/opencode-claude-code-provider/test/smoke.mjs