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

@petersr/claude-pty-web-harness-react

v0.5.0

Published

Headless React hook + client for a claude-pty-web-harness server. No UI, no styling.

Readme

@petersr/claude-pty-web-harness-react

A headless React hook and REST client for a claude-pty-web-harness server. No UI and no styling: useHarnessSession owns the WebSocket, tracks the live transcript and status, and exposes sendPrompt / interrupt. Render the returned events however you like.

Install

npm i @petersr/claude-pty-web-harness-react

Requires Node >= 20 to build and React >= 18 at runtime (a peer dependency). It talks to a running harness server (the reference server or the Python backend).

Usage

import { useHarnessSession, createHarnessClient } from "@petersr/claude-pty-web-harness-react";

// REST client (create/list/kill sessions). baseUrl "" = same-origin.
const client = createHarnessClient(""); // or "http://localhost:4318"
const { id } = await client.createSession("/repo", "sonnet");

function Chat({ sessionId }: { sessionId: string }) {
  const { events, status, error, lastError, connected, sendPrompt, interrupt, blobUrl } =
    useHarnessSession(sessionId, { baseUrl: "" });
  // status "failed" -> `error` holds the reason (e.g. "auth_blocked")
  // lastError holds the most recent server-rejected sendPrompt (e.g. a
  // picker-open 409), or null; it clears on the next sendPrompt that succeeds
  // render `events` (ChatEvent[]) however you like; an event's optional
  // `parts` may include an `image` part - render it as <img src={blobUrl(part.blobId)} />
}

When a sendPrompt fails - most commonly a picker-open rejection - the hook surfaces the server's message as lastError and drops the oldest matching optimistic local- echo from events, since that prompt was never actually delivered.

Types come from @petersr/claude-pty-web-harness-protocol. A non-React UI can skip this package and speak the protocol JSON over the same WebSocket.

See the project README and USAGE.md.

License

MIT