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

@felan-ai/ext-claude-code

v0.6.0

Published

Claude Code plan-backed model provider for Felan

Readme

@felan-ai/ext-claude-code

Use Claude models in Felan through Claude Code and your Claude plan login. Felan keeps the agent loop, conversation, tools, approvals, and user interface. Claude Code runs as the model transport through Anthropic's Agent SDK; an in-process MCP server exposes Felan's tools to Claude. The bridge mirrors Felan history into Claude Code sessions so resumed requests see the same conversation. No Claude Code companion modification is required.

Requirements and setup

  • A macOS or Linux process running Felan. Windows is not supported.
  • npm on the host's PATH for the managed installation.
  • Claude Code installed and signed in on that machine with a compatible Claude plan. Run claude, then /login, before using this provider.

The SDK is loaded with an in-process import and spawns Claude Code as a child of the process running Felan, so both must be on that process's own filesystem. See Non-host runtimes for what that means away from a host.

In Felan:

  1. Run /claude-code install and approve the host's installation request. This downloads Claude Agent SDK 0.3.322 and its approximately 330 MB per-platform binary. Linux downloads both glibc and musl variants, roughly 640 MB in total. Anthropic's Agent SDK license and terms apply; the SDK and Claude Code are not bundled with this MIT-licensed package.
  2. Start a new session or reload to load the provider.
  3. Use /model claude-code/<model-id>, for example /model claude-code/claude-opus-5-5, or select a claude-code model in /model.
  4. Run /claude-code status to inspect the SDK version, whether the provider is registered in this session, and the resolved plan and long-context settings.

/claude-code without arguments also shows status. Unknown arguments show usage. Installation delegates { id: 'claude-code' } to the optional RUNTIME_DEPENDENCIES_SERVICE; authorization belongs to the trusted local Felan host. Without that service, status remains available but installation is disabled. Activation only inspects and loads an existing installation: it never installs anything, executes npm, or downloads files. A missing or unloadable SDK is logged through the runtime logger and leaves the provider unregistered. Inspection also reports a previously installed SDK version when the required version is missing. On local interactive startup, Felan offers an update for an enabled provider that needs a newer SDK, even if dependency onboarding was completed before. Installation requires confirmation. Leaving it unchanged records that choice for the required version; cancelling records no choice. Disabled providers are not offered updates. Activation then starts Claude Code without a prompt to read its model list (see Models).

The managed SDK and its pinned dependencies live under <agent-storage>/claude-code/agent-sdk-0.3.322. The generated ESM entry loads both the Agent SDK and the MCP implementation from that installation. Host providers can import inspectClaudeCodeRuntime, installManagedClaudeAgentSdk, managedClaudeAgentSdkDirectory, and MANAGED_CLAUDE_AGENT_SDK_VERSION from this package. The installer helper does not perform authorization itself.

Installation uses a committed, reviewed lockfile with integrity hashes and npm ci --ignore-scripts. Completed installs are verified in staging, including the host's platform and libc-matched binary, before being moved into place. A valid installation is never removed or replaced; reinstalling it is a no-op. npm registry and proxy configuration still applies, but integrity is enforced. See Runtime dependencies.

Non-host runtimes

On a docker or daytona runtime the provider loads an SDK that the runtime image already carries; /claude-code install is refused there, because the managed installation writes to agent storage but runs npm through the runtime, and those are not always the same filesystem. Preinstall version 0.3.322 under <agent-storage>/claude-code/agent-sdk-0.3.322 in the image instead.

The session workspace on those runtimes is usually not on the filesystem of the process running Felan, so Claude Code cannot start in the pi session's cwd. It runs in <agent-storage>/claude-code/workspace instead. Nothing is lost: the provider path gives Claude Code no tools of its own and exposes Felan's tools through the in-process MCP server, so Claude never reads the workspace itself. Felan's own tools keep operating on the real workspace through the runtime.

Authentication still comes from the environment of the process that spawns Claude Code, so a deployment that cannot run an interactive claude /login supplies CLAUDE_CODE_OAUTH_TOKEN from claude setup-token, or an API key with inheritAnthropicEnvironment. Keep that environment scoped to one tenant: these variables and the Claude Code configuration directory are per process, not per session. Activation reads Claude Code's model list before registering the provider, so an unauthenticated runtime logs the failure and registers nothing.

Models

The provider registers the Agent Core Anthropic catalog models that Claude Code lists in its own /model picker for your login. That list depends on the Claude Code version, your plan, and managed availableModels and deniedModels settings. A catalog model Claude Code does not list, such as a model newer than the pinned Claude Code, is not registered. A model Claude Code lists but the catalog lacks is not registered either; it appears after an Agent Core update. Dated snapshot aliases are omitted.

The first activation in a Felan process asks Claude Code for the list, which takes about 0.25 seconds warm and 2 seconds on a cold start; later sessions reuse the answer until the process restarts or inheritAnthropicEnvironment or pathToClaudeCodeExecutable changes. If Claude Code returns an error or does not answer within 20 seconds, the warning is logged, the provider stays unregistered in that session, and the next session asks again. Callers of activateClaudeCodeBridge pass the list from claudeCodeSupportedModels.

Claude Code receives most of its /model lineup, including older and newly rolled-out models, through its telemetry service. The model-list probe therefore runs with Claude Code telemetry enabled; error reporting, the autoupdater and the bug command stay disabled, and conversation turns keep CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1. Set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 or DISABLE_TELEMETRY=1 in Felan's environment to keep the probe's telemetry off as well; Claude Code then lists only its base models.

Models keep the catalog's Anthropic API prices, so session cost in the footer and usage reports is an API-equivalent estimate at list prices, including Claude Code's 1-hour cache writes. It is not your bill: usage is charged against your Claude plan limits and Extra Usage, not these rates. Plan usage events are forwarded as anthropic-ratelimit-unified-* response headers for compatible footer extensions.

Settings

Use /settings, or edit extensionConfig["claude-code"] in $FELAN_AGENT_DIR/settings.json:

{
  "extensionConfig": {
    "claude-code": {
      "plan": "pro",
      "longContextExtraUsage": false,
      "forceTwoHundredK": [],
      "strictMcpConfig": true,
      "autoMemoryEnabled": false,
      "inheritAnthropicEnvironment": false
    }
  }
}

| Setting | Default | Purpose | | --- | --- | --- | | plan | "pro" | "pro" or "max"; controls plan-gated long-context availability, not authentication. | | longContextExtraUsage | false | Enable long-context models that may consume paid Extra Usage. | | forceTwoHundredK | [] | Array of model IDs to pin to 200K context; omit claude-code/ and [1m]. | | strictMcpConfig | true | Exclude local Claude Code MCP configurations; use Felan's tools. Claude.ai-connected MCP servers are always disabled. | | autoMemoryEnabled | false | Enable Claude Code's own auto-memory in addition to Felan's memory. | | pathToClaudeCodeExecutable | unset | Optional absolute path to claude, instead of the SDK's bundled binary. | | inheritAnthropicEnvironment | false | Preserve exported ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_BASE_URL in the Claude Code child. By default only these three variables are removed. |

Other Claude Code variables still pass through, including CLAUDE_CODE_OAUTH_TOKEN, CLAUDE_CODE_USE_BEDROCK, CLAUDE_CODE_USE_VERTEX, ANTHROPIC_MODEL, and ANTHROPIC_CUSTOM_HEADERS. They can change authentication, model selection, or request destination even when inheritAnthropicEnvironment is false.

Invalid types, unknown fields, invalid plan values, non-string array entries, and relative executable paths are rejected. Changes take effect on activation in a new session or reload. Bridge settings are process-wide: in a shared daemon, the latest activation supplies settings for subsequent calls.

Long-context support is model-specific. Fable 5.2 uses the 1M context shown in Claude Code and requests claude-fable-5-2[1m]. Opus 4.6 uses 1M context on Max or with Extra Usage; Sonnet 4.6 requires Extra Usage. Other supported 1M models use the bridge's compatibility table. Unknown models default to 200K; use forceTwoHundredK if the requested larger window is unavailable on your account.

Compatibility and limitations

  • Felan tools, tool approvals, and ask_user remain in Felan. Claude Code's native tools are disabled; Felan tools are exposed through the in-process MCP server.
  • Project context, skills, custom and appended instructions, and structured systemPromptOptions.sections are forwarded. Extensions should use these structured sections rather than replace the complete system prompt.
  • Felan's harness prompt is not forwarded. The bridge rejects prompts containing known Pi harness text rather than silently sending them. Anthropic determines whether a request is eligible for plan quota or Extra Usage.
  • Compaction, branch summaries, and titles use isolated Claude Code queries. Prompt-only, tool-free calls with a single user message and no captured session prompt also use isolated queries, including Fusion through Felan's Models service. Subagents receive their own Claude Code conversations. The deprecated upstream AskClaude tool is not included; use Felan subagents.
  • Each Felan session keeps its Claude Code process between prompts and writes the next prompt to it. A new thinking level is applied to the running process first. A change of model, tools, working directory, projected instructions, or bridge settings, switching thinking off or back on, or a history rewrite, starts a new process that resumes the conversation. The process stops when the session shuts down (including daemon idle eviction) or switches to another model; an idle process uses roughly 200–260 MB of memory.
  • Compaction, tree navigation, aborts, and model switches can require rewriting the mirrored history. A rebuild resends history and can miss the prompt cache.
  • Mid-session prompt changes may not reach Claude Code until a rebuild. Start a new session when updated instructions must take effect immediately.
  • Claude Code settings and hooks can affect its subprocess. Review machine-local hooks if they duplicate Felan instructions. Enabling inherited Anthropic environment variables can redirect requests or change authentication/billing.
  • Every Felan session using claude-code creates a Claude Code session JSONL copy under ~/.claude/projects/<cwd>/ (or $CLAUDE_CONFIG_DIR/projects/<cwd>/). These copies remain after Felan sessions close or are deleted and appear in Claude Code's own /resume list. The SDK spawns a local process; this host-only bridge is not a sandbox and requires access to those files for history mirroring.

Debugging

Set CLAUDE_BRIDGE_DEBUG=1 before starting Felan to enable bridge debug output and per-query Claude Code CLI logs:

  • claude-bridge.log under the extension's activation agentDir records calls, history synchronization, tool results, and subprocess stderr.
  • CLAUDE_BRIDGE_DEBUG_PATH overrides the bridge log path. CLI logs go into cc-cli-logs/ beside that path.
  • claude-bridge-diag.log under agentDir records exceptional invariant failures.

For session-resume errors, inspect the syncResult: lines and matching CLI log. Logs can contain prompts, tool output, and other sensitive data; redact them before sharing. For authentication errors, run claude and /login on the host.

Development

pnpm --filter @felan-ai/ext-claude-code build
pnpm --filter @felan-ai/ext-claude-code type-check
pnpm --filter @felan-ai/ext-claude-code test

Tests use fake SDK entries and isolated storage; they do not require a Claude login, download the SDK, or spawn Claude Code.

Attribution

Adapted from MIT-licensed pi-claude-bridge 0.9.3 by Eli Dickinson, commit 874fa7c2678456336f23b64e784e2057e608d83e, originally based on claude-agent-sdk-pi by Prateek Sunal. See NOTICE and LICENSE. Anthropic's Agent SDK and Claude Code are separately licensed and installed only on explicit request.