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

@dex-ai/claude-code

v0.3.0

Published

Claude Code provider for @dex-ai/sdk — drive Claude models through a Claude.ai (Pro/Max) subscription using local Claude Code CLI credentials.

Readme

@dex-ai/claude-code

Drive Claude models through your Claude.ai (Pro / Max) subscription instead of a metered ANTHROPIC_API_KEY. This provider reuses the OAuth credentials that the Claude Code CLI writes to ~/.claude/.credentials.json, refreshes them when they expire, and calls the Anthropic Messages API as the official Claude Code client.

Setup

  1. Install the Claude Code CLI and sign in with your Claude.ai account. Either launch Claude Code and complete the browser sign-in, or use the /login command from inside Claude Code:

    claude          # then complete the browser sign-in
    # or, from inside an existing Claude Code session:
    /login

    Either path creates ~/.claude/.credentials.json.

  2. Configure the provider in dex (type claude-code), or construct it directly:

    import { claudeCodeExtension } from "@dex-ai/claude-code";
    
    const ext = claudeCodeExtension();
    // models: claude-opus-4-8, claude-sonnet-4-6, claude-haiku-4-5 (defaults)

No API key is required or read — auth comes entirely from the local credentials file, and tokens are refreshed automatically.

Options

| Option | Default | Description | |-------------------|----------------------------------|-------------| | name | "claude-code" | Provider name used in Agent.create. | | credentialsPath | ~/.claude/.credentials.json | Claude Code OAuth credentials file. | | baseUrl | https://api.anthropic.com | Messages API base URL. | | models | built-in defaults | Static model IDs. When set, discovery is skipped. | | clientId | pinned Claude Code client id | OAuth client id for token refresh. | | tokenUrl | Anthropic OAuth token endpoint | Refresh endpoint. | | headers | — | Extra request headers (cannot override identity headers). | | systemPreamble | Claude Code identity line | Override the required first system block. | | rawChunks | false | Emit raw-chunk stream parts. |

How it works

  • Auth — reads claudeAiOauth from the credentials file; if the access token is within ~5 minutes of expiresAt, it refreshes via grant_type=refresh_token and writes the rotated tokens back with 0600 permissions.
  • Client identity — every request sends the OAuth bearer token (not x-api-key), the anthropic-beta: oauth-… flag that bills the subscription, a claude-cli user-agent (version resolved from claude --version), and x-app: cli. The required Claude Code system preamble is injected as the first system block.
  • Streaming — the Messages API wire translation is shared with @dex-ai/anthropic (text, tool calls, extended thinking, prompt caching), so behavior matches the standard Anthropic provider.

⚠️ Terms of service

This provider authenticates as the Claude Code client using your subscription credentials. Using a Claude.ai subscription for programmatic access outside the official Claude Code client may violate Anthropic's terms of service, and the client headers / beta flags it relies on can change without notice, which would break this provider until updated. Use at your own risk. For production or commercial use, prefer a standard ANTHROPIC_API_KEY with @dex-ai/anthropic.