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

@better_openclaw/betterclaw

v2.0.0

Published

Intelligent event filtering, context tracking, and proactive triggers for BetterClaw

Readme


What is this?

This is the server-side plugin for BetterClaw, an iOS app that connects your iPhone's sensors to your OpenClaw AI agent. The app streams device events (location, battery, health, geofences) to your gateway — this plugin decides what to do with them.

Without this plugin, raw events go straight to your agent. With it, they're filtered, triaged, and enriched before anything reaches your agent's conversation.

  BetterClaw iOS App          This Plugin (on gateway)              Agent
 ──────────────────          ────────────────────────             ────────
                                       │
  battery ──────▶  ┌───────────────────┼───────────────────┐
  location ─────▶  │  Rules Engine     │  Context Store     │
  health ───────▶  │  LLM Triage       │  Pattern Engine    │ ──▶  filtered events
  geofence ─────▶  │  Budget Limiter   │  Proactive Triggers│      + full context
                   └───────────────────┼───────────────────┘
                                       │
                                 proactive insights
                              (low battery + away from
                               home, sleep deficit, etc.)

Features

  • Smart Filtering — Per-source dedup, cooldown windows, and a daily push budget prevent event spam
  • LLM Triage — Ambiguous events get a cheap LLM call to decide push vs. suppress, keeping the expensive agent focused
  • Device Context — Rolling state snapshot: battery, GPS, zone occupancy, health metrics, activity classification
  • Pattern Recognition — Computes location routines, health trends (7d/30d baselines), and event stats every 6 hours
  • Proactive Insights — Combined-signal triggers: low battery away from home, unusual inactivity, sleep deficit, routine deviations, weekly digest
  • Agent Toolget_context tool lets your agent read the full device snapshot on demand

Requirements

Install

openclaw plugins install @betterclaw-app/betterclaw

Configure

Add to your openclaw.json:

{
  "plugins": {
    "entries": {
      "betterclaw": {
        "enabled": true,
        "config": {
          "llmModel": "openai/gpt-4o-mini",
          "pushBudgetPerDay": 10,
          "patternWindowDays": 14,
          "proactiveEnabled": true
        }
      }
    }
  }
}

All config keys are optional — defaults are shown above.

Config Reference

| Key | Default | Description | |-----|---------|-------------| | llmModel | openai/gpt-4o-mini | Model used for ambiguous event triage | | pushBudgetPerDay | 10 | Max events forwarded to the agent per day | | patternWindowDays | 14 | Days of event history used for pattern computation | | proactiveEnabled | true | Enable proactive combined-signal insights |

How It Works

Event Pipeline

Every device event from the BetterClaw app goes through a multi-stage pipeline before reaching your agent:

  1. Rules Engine — Checks dedup, cooldown timers, and daily budget. Obvious spam is dropped immediately.
  2. LLM Triage — Events that aren't clearly push or suppress get a fast LLM call with device context for a judgment call.
  3. Context Update — The device context store is updated with the latest sensor data regardless of whether the event is forwarded.
  4. Event Logging — Every event and its decision (push/suppress/defer) is logged for pattern computation.
  5. Agent Injection — Events that pass are injected into the agent's main session with formatted context.

Background Services

Two engines run on a schedule in the background:

  • Pattern Engine (every 6h) — Analyzes event history to compute location routines, health trends, and event frequency stats
  • Proactive Engine (every 30min) — Evaluates combined-signal conditions and fires insights when thresholds are met

Commands

| Command | Description | |---------|-------------| | /bc | Show current device context snapshot in chat |

Compatibility

| Plugin | BetterClaw iOS | OpenClaw | |--------|----------------|----------| | 1.x | 1.x+ | 2025.12+ |

License

AGPL-3.0 — Free to use, modify, and self-host. Derivative works must remain open source.