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

pi-agent-replicate

v1.4.2

Published

One Pi agent makes copies of itself to work on independent tasks in parallel

Readme

npm version MIT license

Give your Pi agent the ability to work in parallel in Herdr. It creates copies of itself for independent parts of a task, keeps working, and receives their results automatically.

Each copy starts with the current conversation, system prompt, model, thinking level and active tools. It has the context it needs to continue the work, rather than starting from scratch.

Install

pi install npm:pi-agent-replicate

Start Pi inside Herdr, then restart Pi or run /reload.

Herdr App

Copies also work in terminals of the Herdr App (the window plus herdr-core), including a WSL terminal shown by the Windows app. Replicate finds the app's command-line program on its own: PI_HERDR_APP_CLI, then HERDR_APP_BIN, then herdr-app on PATH, then the Windows installer's folder (from WSL it asks Windows for that folder and translates the path). If it cannot, set PI_HERDR_APP_CLI to the full path of herdr-app or herdr-app.exe.

The app names a WSL or remote core's terminals <machine>/<id>. Replicate learns the machine name from the app's own listing. If the listing is ambiguous or does not show the terminal, set PI_HERDR_APP_MACHINE to the machine name, or to an empty value for the app's own machine. Copies inherit these three variables.

How it works

The extension adds one tool, replicate. The agent calls it with a task-specific name and a bounded assignment:

replicate({
  name: "check-auth-risks",
  task: "Check authentication risks while I implement the settings change. Return concrete findings with file references.",
});

The name uses lowercase kebab-case. The copy works in its own Pi session and can create copies of its own. When its work and any child work finish, the result returns to the original agent automatically. The original can continue independent work or end its turn while it waits; it does not need to poll.

Use replication when there are genuinely independent tasks to do in parallel, not simply to hand off a task and wait. Copies inherit the conversation and tools, but their subsequent conversations are separate.

Where copies work

By default, each copy works in a separate Git worktree. It starts with a snapshot of the parent's tracked changes and non-ignored new files. Ignored files, dependencies and build outputs are not copied. On success, the host attempts to apply the copy's changes to the parent without changing its HEAD or staging. A conflict or failure leaves the copy's work available for review rather than applying partial changes. A clean join does not guarantee the combined code is correct.

Worktree mode requires a non-bare Git checkout with a commit. Snapshots do not support unresolved index conflicts, sparse or assume-unchanged index entries, submodules or nested Git repositories. Worktrees isolate files, not shared processes, ports or databases.

When copies need the same directory, switch to shared mode:

/replica-directory shared

Shared copies work in the parent's current directory, including ignored files and dependencies. They do not create a worktree or branch, and there is no snapshot or automatic join. Changes are visible immediately and can remain even if a copy fails. Coordinate assignments: parallel edits to the same files can overwrite each other, and there is no automatic rollback.

Use /replica-directory worktree to switch back, or /replica-directory to choose interactively. The setting is saved in .pi/replicate.json in the current project directory and applies to new copies only.

When a copy stops

A completed copy returns its summary automatically. If it fails, is interrupted or loses its process, the parent receives a failure and any available answer information. Copies do not restart automatically; the parent can create a fresh copy if needed. In worktree mode, failed or conflicted work remains available for recovery; in shared mode, changes may already be in the shared directory.

More information

See the documentation for technical contracts and development instructions.

License

MIT