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

@parcha/agentrun-harness-claude

v0.1.0-beta.355

Published

The Claude Agent SDK as an AgentRun harness: the host's tools as its only tools, its model behind a loopback proxy, durable in AgentRun's own store.

Readme

@parcha/agentrun-harness-claude

The Claude Agent SDK as an AgentRun harness (adapter id claude-agent): a DSL agent node runs on the Claude Agent CLI through @parcha/agentrun-kernel, durable in AgentRun's own store, with the host's tools as its only tools.

The host brings the SDK: @anthropic-ai/claude-agent-sdk is an exact optional peer dependency (0.3.286, whose CLI is 2.1.286), used under Anthropic's terms, and this package never ships it. Install it with its optional dependencies (they carry the CLI for your platform), or load it where your runtime installed it and pass it in.

import { createHarnessRunner } from "@parcha/agentrun-kernel";
import { claudeAgentAdapter } from "@parcha/agentrun-harness-claude";

const runNode = createHarnessRunner(
  claudeAgentAdapter({
    model: "claude-sonnet-5-5",
    provider: { origin: "https://api.anthropic.com", credential: () => process.env.ANTHROPIC_API_KEY! },
    sessionsDir: "/var/lib/my-host/claude-agent-sessions",
    // Optional: the SDK module and its CLI from where the host installed them (checked against the pins).
    // sdk, sdkVersion, cliPath,
  }),
  { store, tools },
);
  • Pinned, and checked. Making the adapter checks the SDK's version and the CLI's sha256 and version against the pins; a mismatch throws ClaudeAgentPinMismatch (which pin, expected, found), and a missing SDK or CLI throws ClaudeAgentNotInstalled ("Claude Agent SDK not installed"). An SDK that starts the CLI as another release is refused before the CLI starts.
  • The host's tools only. The CLI's built-in tools are off. The host's tools are its only tools, served in-process and named back to the host's own names; each call is a kernel effect whose intent is recorded before it runs, so a call a crash cut off is reported, never repeated. A PreToolUse hook denies every other call, and every error inside it is a deny. Sub-agents, scheduled jobs, worktrees, background shells, settings, plugins and MCP servers from settings are off by option, and test/tool-off.test.mjs runs the pinned CLI against a scripted model that tries each of them: nothing runs, writes or fetches.
  • Claude's own WebSearch, by option. webSearch: true turns on the CLI's WebSearch and nothing else of its own: the proxy then admits Anthropic's web search server tool exactly as the pinned CLI sends it, every other hosted tool stays refused, and each search the provider reports is booked at $10 per 1,000 (NATIVE_SEARCH_USD) beside the tokens, into the session's cost and spend cap. A search request has no input bound unless webSearchAllowance gives the input tokens it may read in beyond its body. WebFetch stays off. Default off.
  • The model behind a proxy. The CLI talks to a model proxy on the loopback interface with a key of its session's own; it never holds the provider key, a sign-in or the operator's settings. The proxy (@parcha/agentrun-kernel/host with this package's Anthropic policy) forwards only the routes the pinned CLI calls, fixes the model, refuses provider-hosted tools and anything the provider would run or fetch on its own, offers the model only the session's tools, and asks the runner before every paid request. Every paid request is booked once; the runner alone accounts spend.
  • A private machine. A session runs in its own directories. Its working directory is the host's workspace when the host names one (io.cwd, where the host's file tools write), so a path the model builds from it is one those tools take; otherwise it is an empty directory of the session's. The CLI keeps nothing there. The CLI's environment is an allowlist (PATH, LANG, TZ, its own homes and the proxy's address and key).
  • Durable. The CLI's transcript is mirrored into the session's records (the SDK's session store), so a session a process died inside resumes from them on any machine.
  • Steers mid-turn. A message steer() places while a turn runs goes to the CLI at once, at priority next; the CLI hands it to the model at its next step, after the tool calls in flight finish, in the same turn. The session's message_taken event says when the transcript holds it. One placed as the turn ends starts the next turn, and one placed again under the same id places nothing.

./testing has a scripted Agent SDK (no CLI, key or network) and a scripted Anthropic Messages API for the real CLI.

Code this package copies from another project is listed in vendor/durable-harness/UPSTREAM.json and credited in NOTICE.