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

@tduyng/pi-claude

v0.0.5

Published

Claude Pro and Max models in Pi through the official Claude Code CLI: one warm streaming process, Pi's own prompt and tools, no credential copy.

Readme

@tduyng/pi-claude

Claude Pro, Max, Team and Enterprise models inside pi, through the official Claude Code CLI. Pi keeps the system prompt, the tools, the approvals, compaction and the session tree. The CLI keeps authentication and billing.

No token is copied and no API is called directly.

No tools, no prompt block, no schema, since this is only a provider. What it saves is the replay: one warm process means a normal turn writes only the new user message, so the prefix stays cached between turns.

One warm process per session

--input-format stream-json keeps a process alive, and a normal turn writes only the new user message to stdin. A tool round parks the MCP calls, returns one pi assistant message with the tool calls, then the next provider call delivers the results into the same process. Nothing respawns, nothing is replayed, and the cached prefix survives.

The extension deliberately does not use --resume. Claude Code 2.1.69 changed how a resumed conversation rebuilds messages[0], which invalidates the conversation cache on every turn. A live streaming process avoids that path entirely.

An abort sends an interrupt control request instead of killing the process, so the process and its cache survive. An abort during tool execution keeps the parked calls, and pi's Operation aborted results resolve them on the next turn. An idle process lives 60 minutes, the length of the prompt cache.

A process that sends no event for 10 minutes in the middle of a turn is dropped, and the turn fails with a timeout that pi retries on a fresh process. Two recorded subagent runs sat silent for over 30 minutes until the subagent's own 45 minute limit ended them.

When pi's history diverges from the live process, after editing an earlier message, changing the model, changing the tool set, or resuming a pi session after a restart, the extension replaces the process and replays the existing conversation once as a single user message. That turn is a cold cache, and later turns are warm again.

Pi's tools are the only tools

The extension disables Claude Code's own system prompt, CLAUDE.md, rules, skills, slash commands, hooks, plugins, project MCP servers, auto memory, git snapshot, title generation and auto compaction with flags and environment variables. What is left is a model that reaches pi's tools.

| Pi | Claude Code | | --- | --- | | Pi system prompt | --system-prompt-file, replacing the default | | Pi tools | MCP server pi, exposed as mcp__pi__<tool> | | Pi tool execution | The MCP call parks until pi runs the tool, then the result resolves it | | Pi compaction | DISABLE_AUTO_COMPACT=1, so pi decides when | | Pi approvals | Every tool call returns to pi and runs there |

Use

pi --provider claude --model claude-opus-5

Inside pi:

/model claude/claude-opus-5

The provider id is claude, and model ids are the ones pi already uses for Anthropic: claude/claude-opus-5 and anthropic/claude-opus-5 name the same model. The catalog comes from @earendil-works/pi-ai, so new Claude models appear when pi updates, with no edit here.

| Command | Effect | | --- | --- | | /claude status | Binary, login, MCP port, live processes | | /claude models | Every model id | | /claude clear | Close the warm processes |

Install

Requirements:

  • Pi 1.4 or newer.
  • Claude Code 2.1.281 or newer on PATH.
  • A Claude Pro, Max, Team or Enterprise login: run claude auth login.
  • PI_CLAUDE_BIN only when the binary is not named claude.
pi install npm:@tduyng/pi-claude

Local checkout: pi install /path/to/dotfiles/pi/agent/extensions/pi-claude

The extension never reads ~/.claude/.credentials.json, never copies OAuth tokens, and never talks to the Anthropic API directly.

PI_CLAUDE_BIN=/home/you/.nix-profile/bin/claude pi

Limits

  • Every request counts against the subscription limits, exactly like the CLI itself.

  • Anthropic may treat a third-party harness prompt differently from the CLI's own prompt. A turn failing with a third-party or extra-usage message is about the prompt shape, not the transport.

  • One process per pi session. Subagents with a different prompt get their own, up to eight alive at once.

  • A model change, a thinking level change or a tool set change rebuilds the session on the next turn.

  • Images in replayed history are attached to the replay message, and new user images are sent normally.

  • Claude Code needs a model id it recognizes, so a brand new model may need a newer CLI than the one installed.

  • The CLI caps MCP tool output and may move very large text to a file. Pi tools normally truncate before that cap.

  • Usage comes from the CLI's stream events. The monetary cost is pi's API-equivalent estimate, not the subscription bill.