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

bro-agent

v0.2.4

Published

bro local agent — loopback service for the hosted bro UI: filesystem, Remote Control relay + usage (user's own ~/.claude), the Operator control plane, and a headless `claude /remote-control` launcher (node-pty, the one native dep, used only to give claude

Downloads

1,171

Readme

bro-agent

The bro local agent — the "bring your own compute" piece for the hosted bro UI.

bro's UI is hosted: you use it in your browser at the bro site. Anything that touches your machine — your files, your Claude sessions and usage (read from your own ~/.claude), launching a new claude session — runs in this small loopback agent on your machine. The browser bridges the two. This agent serves no web UI; it's a headless service on 127.0.0.1 only, never exposed to the internet.

Run it

npx bro-agent

It prints a one-time pairing code. Open the bro site, click Connect agent, and enter the code. That's it — the agent is now paired to your browser (the token persists, so you don't re-pair on reload). Press Enter in the agent's console any time for a fresh code.

Requirements: Node ≥ 20. The agent's one native dependency is node-pty (used solely to give a launched claude a windowless TTY); npm installs a prebuilt binary for common platforms.

Keep it running (autostart)

The agent only drives your sessions while it's running. To keep it up across reboots:

  • Windows — the bro repo ships scripts/install-services.ps1, which registers the agent (and server + tunnel) as auto-restarting Scheduled Tasks. See scripts/README.md.
  • Linux (systemd user service) — create ~/.config/systemd/user/bro-agent.service:
    [Unit]
    Description=bro local agent
    [Service]
    ExecStart=%h/.npm-global/bin/bro-agent
    Restart=always
    RestartSec=3
    [Install]
    WantedBy=default.target
    then systemctl --user enable --now bro-agent (and loginctl enable-linger $USER so it runs without an active login). Adjust ExecStart to your bro-agent path (which bro-agent).
  • macOS (launchd) — a ~/Library/LaunchAgents/dev.bro.agent.plist with a ProgramArguments of your bro-agent path and RunAtLoad/KeepAlive set to true, loaded via launchctl load.

Safe default: relay-only

If you only use bro to drive/watch existing Claude sessions (not the file editor or launching new sessions), run it relay-only — the least-privilege posture: no filesystem access, no session launching, just the relay.

BRO_AGENT_RELAY_ONLY=1 npx bro-agent

The agent prints its posture on startup. Widen it (BRO_AGENT_READONLY, BRO_AGENT_ROOTS, full) only as far as the features you actually use require — this bounds the blast radius if the hosted coordinator is ever compromised.

Configuration (env vars, all optional)

| Var | Default | Purpose | |---|---|---| | BRO_HOSTED_ORIGIN | https://bro.usurp.dev | The hosted site this agent trusts (CORS + WS origin). Set this if you self-host the bro UI elsewhere. | | BRO_AGENT_ORIGINS | — | Extra trusted origins (comma-separated), in addition to the hosted one. | | BRO_AGENT_PORT | 8765 | Preferred port; probes 87658770 if taken. | | BRO_AGENT_DIR | ~/.bro-agent | Where the persisted token + bound port live (config.json). | | CLAUDE_BIN | resolved from PATH | Path to the claude executable. | | BRO_NO_REMOTE_CONTROL | — | If set, launched sessions don't auto-run /remote-control. | | BRO_AGENT_ROOTS | whole machine | Restrict filesystem + new-session cwd to these roots (comma-separated). | | BRO_AGENT_NO_LAUNCH | — | 1 = refuse to launch new claude sessions. | | BRO_AGENT_READONLY | — | 1 = no file writes, no launch (reads + relay only). | | BRO_AGENT_RELAY_ONLY | — | 1 = drive/watch relay sessions only — no filesystem, no launch. |

These cap what the agent will do regardless of what the hosted coordinator asks — i.e. they bound the blast radius if the coordinator is ever compromised. The agent prints its current posture on startup. Lock it down to the least you need.

What it exposes (all token-gated, loopback only)

  • Filesystem: /dirs, /mkdir, /file (the folder picker + Project editor).
  • Remote Control relay + usage: /relay/*, /relay-stream (WS), /usage — reads your own ~/.claude OAuth token; bro never holds your keys.
  • New session: /new-session — launches claude /remote-control headless.
  • Operator control plane: /op, /operator-info, /control (WS).

Security: every privileged route requires the pairing token, the agent binds 127.0.0.1 only, and it accepts requests only from the trusted hosted origin. Sessions it launches run claude --dangerously-skip-permissions — that is bro's purpose, on your own machine.

Revoking access

Each agent is linked to your account with its own account key (TTL-bounded, rotated on every reconnect). To cut an agent off: open the bro site → Connect agent panel → Revoke the agent (calls /agent/revoke, which forgets the key and force-closes the live connection). Re-linking issues a fresh key, so an old/leaked key stops working. The local config.json token can also be reset by deleting ~/.bro-agent/config.json and re-pairing.

Audit log

Privileged, state-changing actions — file writes (POST /file), folder creation (/mkdir), and session launches (/new-session) — are appended to ~/.bro-agent/audit.log (one redacted JSON line each: timestamp, action, target path/cwd, result status). File contents, tokens, and account keys are never written — only what was done and where — so the log makes a compromise visible without itself becoming a secret. It rotates at ~2 MB (audit.log.1). Config + audit files are locked to the current user (POSIX chmod 600; Windows icacls, current user only).