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

@shan8851/blackbox

v0.1.0

Published

OpenClaw-native inspection reports for failed, stalled, expensive, or weird agent runs.

Readme

OpenClaw Blackbox

npm version License: MIT Node.js

Debug OpenClaw runs from your terminal. Built for agent operators, still readable by humans.

blackbox doctor                         # Can Blackbox see OpenClaw state?
blackbox list failures --limit 10       # Recent failed or suspicious cron runs
blackbox list sessions --agent all      # Local session artifacts across agents
blackbox find request --query "..."     # Find the session behind a user request
blackbox inspect --session-id <id>      # Generate a report for one run

Blackbox answers the useful question first:

What happened in this agent run, and why did it fail or get weird?

It reads local OpenClaw evidence — transcripts, trajectory files, cron history, checkpoints, locks, delivery metadata, and tool traces — then renders deterministic reports as terminal output, Markdown, JSON, or static HTML.

Small warning: this is a local debugging tool. Reports can include prompts, tool arguments/results, URLs, and local paths. Review before sharing.

Install

npm install -g @shan8851/blackbox

Or from source:

git clone https://github.com/shan8851/openclaw-blackbox.git
cd openclaw-blackbox
pnpm install
pnpm run build
pnpm link --global

Blackbox reads ~/.openclaw by default. To inspect another OpenClaw home:

OPENCLAW_HOME=/path/to/.openclaw blackbox doctor

Commands

| Command | What it does | | --- | --- | | blackbox doctor | Check resolved paths and visible OpenClaw evidence | | blackbox list failures | Show failed or suspicious cron runs | | blackbox list sessions | Show local session transcript/trajectory artifacts | | blackbox find request | Find the session behind a user message/query | | blackbox inspect | Build a focused report for one run/session/request |

Examples

Inspect the latest failed run for a cron job:

blackbox inspect --cron-job "Example nightly research job" --latest-error

Generate a full Markdown report:

blackbox inspect \
  --cron-job example-nightly-research \
  --cron-run example-session-001 \
  --view full \
  --out reports/example-context-overflow.md

Open a local HTML report:

blackbox inspect --query "summarise the failed run" --agent all --open

Write JSON for downstream tooling:

blackbox inspect --session-id example-session-001 --json-out reports/example.json

Find the run behind a Discord/Telegram/etc request:

blackbox find request --query "summarise the failed run" --agent all
blackbox find request --message-id example-message-001 --agent main
blackbox find request --query "summarise the failed run" --agent all --commands

inspect --query is conservative: it only proceeds when matches resolve to one unique session. If the text spans multiple sessions, run find request first and inspect by the chosen --session-id.

Output modes

inspect always prints a terminal snapshot and writes a Markdown report unless you choose another path.

blackbox inspect --session-id example-session-001
blackbox inspect --session-id example-session-001 --view full
blackbox inspect --session-id example-session-001 --out report.md
blackbox inspect --session-id example-session-001 --json-out report.json
blackbox inspect --session-id example-session-001 --html-out report.html --open

Markdown has two views:

  • --view simple — default triage report: outcome, likely cause, next checks, evidence summary.
  • --view full — fuller postmortem: identity, evidence files, timeline, context pressure, tool footprint, raw snippets, compactions, recommendations.

JSON output uses the full deterministic BlackboxReport object. Simple/full are render modes over the same report model.

Agent-friendly bits

Human list/find output includes copy-pasteable Inspect: commands.

blackbox list failures --commands
blackbox list sessions --agent all --commands
blackbox find request --query "failed to send" --commands

Discovery commands support --json:

blackbox doctor --json
blackbox list failures --json
blackbox list sessions --agent all --json
blackbox find request --message-id 123 --json

Exit codes are explicit enough for scripts:

  • 0 success
  • 1 unexpected failure
  • 2 usage / invalid argument
  • 3 not found / missing OpenClaw state
  • 4 ambiguous request match

Configuration

| Environment variable | Purpose | | --- | --- | | OPENCLAW_HOME | OpenClaw state directory. Defaults to ~/.openclaw. | | BLACKBOX_REPORT_DIR | Default report output directory. Defaults to reports/. |

Explicit output flags always win over BLACKBOX_REPORT_DIR.

Failure labels

The classifier is deterministic and based on local OpenClaw failure shapes. Current cause labels include:

  • context_overflow
  • message_delivery_failed
  • timeout
  • session_lock_timeout
  • gateway_restart_interrupted
  • model/auth labels
  • tool read/write/edit/apply-patch labels
  • unknown_error

Evidence conditions are separate from causes: missing_transcript, transcript_deleted, transcript_reset, missing_trajectory, checkpoint_present, and session_write_in_progress.

Reports also include confidence: high|medium|low. That describes evidence quality, not agent quality.

Development

pnpm install
pnpm run validate
npm pack --dry-run

During development you can run the CLI directly:

pnpm dev doctor
pnpm dev inspect --session-id example-session-001

Screenshots

HTML report

Blackbox HTML report

Inspect snapshot

Blackbox inspect command

Failure list

Blackbox failure list

Doctor

Blackbox doctor command

License

MIT