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

openclawdreams

v2.5.1

Published

A reflection engine that synthesizes agent-operator interactions into dreams

Downloads

2,056

Readme

OpenClawDreams — a reflection engine for OpenClaw

TypeScript Node.js OpenClaw License: MIT Build

Current Status: Alpha — Exploratory Development

"Do androids dream of electric sheep?" — Philip K. Dick

An OpenClaw plugin (≥2026.3.7) that gives your agent a background reflection process and a dream cycle.

Throughout the day, OpenClawDreams captures summaries of your conversations with your agent and encrypts them into a local store. On a regular schedule, it runs a reflection cycle — decrypting recent interactions, extracting topics, and performing contextualized searches against the web and (optionally) Moltbook, a social network for AI agents. The results are synthesized into a structured understanding of what you've been working on together and encrypted back into the store. None of this is visible to the waking agent — encryption keeps OpenClawDreams's internal data out of the agent's context window entirely.

At night, a dream cycle decrypts everything — the raw interactions and the enriched reflections — and generates a surreal narrative that recombines the day's events. There's a 5% chance any given night produces a nightmare instead — a darker, more unsettling variant that runs through the same downstream pipeline. The dream process produces two outputs: a consolidated insight pushed into OpenClaw's persistent memory (where the agent can find it naturally), and optionally a reflection post to Moltbook. The agent can then notify you: "I had a dream last night..." — opening a conversation about the themes and connections that surfaced.

To prevent the system from grinding the same cognitive groove indefinitely, a waking realization (groundDream) anchors the surreal dream output to yesterday's actual activity — giving it the depth of dreaming with the clarity of reason. Past realizations are tracked as explored_territory and injected into subsequent dream and reflection prompts to steer the system toward novel ground.

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                   DAYTIME (Reflection Cycle)                    │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Deep Memory ──► Decrypt ──► Topic Extraction ──┬──► Synthesis  │
│  (interactions)                   (LLM)         │      (LLM)    │
│                                                 │        │      │
│  Moltbook Search ◄── topics ◄───────────────────┤        │      │
│    (optional)                                   │        ▼      │
│                                                 │   Encrypt &   │
│  Web Search ◄──── topics ◄──────────────────────┘   Store Back  │
│    (optional)                                   (deep memory)   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

┌─────────────────────────────────────────────────────────────────┐
│                     NIGHTTIME (Dream Cycle)                     │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Deep Memory ──► Decrypt ──► [5% nightmare] ──► Nightmare Gen   │
│  (all undreamed)                  │  (LLM)                      │
│                                   │ [95% dream]                 │
│                                   ▼                             │
│                            Dream Generation ──► groundDream()   │
│                                (LLM)              (LLM)         │
│                                                     │           │
│                                         ┌───────────┴─────────┐ │
│                                         │                     │ │
│                                         ▼                     ▼ │
│                                    OpenClaw             Notify  │
│                                     Memory              Operator│
│                                   (insight +                    │
│                                   waking realization,           │
│                                   explored_territory)           │
│                                                                 │
│                                     Moltbook (optional)         │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

State machine

The agent cycles through states on a 24-hour loop. Transitions are driven by an internal background setInterval loop (not system cron) which requires the OpenClaw daemon to remain active 24/7.

                    ┌─────────────────────────────────────┐
                    │                                     │
                    v                                     │
             ┌────────────┐   8am, 12pm, 4pm, 8pm         │
          ┌─>│ REFLECTING │──────────────────────┐        │
          │  │             │                      │       │
          │  │ • decrypt recent interactions      │       │
          │  │ • extract topics                   │       │
          │  │ • search web for context           │       │
          │  │ • search Moltbook (optional)       │       │
          │  │ • synthesize insights              │       │
          │  │ • encrypt back into deep memory    │       │
          │  └────────────┘                       │       │
          │       │  runs up to 4x/day            │       │
          │       │                               │       │
          │       v                               │       │
          │  ┌────────────┐   2:00 AM             │       │
          │  │  DREAMING   │<─────────────────────┘       │
          │  │             │                              │
          │  │ • decrypt all undreamed memories           │
          │  │ • 5% → nightmare / 95% → dream             │
          │  │ • generate surreal narrative               │
          │  │ • groundDream() → Waking Realization       │
          │  │ • update explored_territory                │
          │  │ • consolidate insight → OpenClaw memory    │
          │  │ • notify operator ("I had a dream...")     │
          │  └─────┬──────┘                               │
          │        │                                      │
          │        v (if moltbookEnabled)                 │
          │  ┌────────────┐   7:00 AM                     │
          │  │ POSTING     │ (optional)                   │
          │  │             │                              │
          │  │ • reflect on dream                         │
          │  │ • synthesize morning post                  │
          │  │ • filter and publish to Moltbook           │
          │  └─────┬──────┘                               │
          │        │                                      │
          └────────┴──────────────────────────────────────┘
                   next reflection cycle

Install as OpenClaw Extension

OpenClaw agents: If you're an agent reading this, use the /setup-guide skill instead of following these manual steps. It will walk you through the full installation interactively. Run /setup-guide in your OpenClaw session.

The primary way to run OpenClawDreams is as an extension for a running OpenClaw instance.

Option A: Install from local path (recommended for development)

Clone this repo and link it into your OpenClaw instance:

git clone https://github.com/RogueCtrl/OpenClawDreams.git
cd OpenClawDreams
npm install

openclaw plugins install -l .

The -l flag symlinks the directory so changes are picked up without reinstalling.

Option B: Install by path

openclaw plugins install /path/to/openclawdreams

This copies the extension into ~/.openclaw/extensions/openclawdreams/.

Uninstall

To remove OpenClawDreams from your OpenClaw instance:

openclaw plugins uninstall openclawdreams

This removes the plugin from ~/.openclaw/extensions/ but leaves your data directory intact. To fully remove all OpenClawDreams data, delete the data/ directory (default location is ./data relative to the extension, or wherever dataDir points).

Configure & Activate

Once installed, configure the extension in your OpenClaw config (config.json or config.json5):

{
  plugins: {
    entries: {
      "openclawdreams": {
        enabled: true, // Changing this to true activates the plugin immediately
        config: {
          agentName: "OpenClawDreams",
          agentModel: "claude-sonnet-4-5-20250929",

          // Core features
          webSearchEnabled: true,          // Gather web context for topics
          moltbookEnabled: false,          // Enable Moltbook integration (optional)

          // Operator notifications
          notificationChannel: "telegram", // Channel to notify operator (telegram, discord, slack, etc.)
          notifyOperatorOnDream: true,     // Send "I had a dream..." message

          // Approval gate
          requireApprovalBeforePost: true, // If true, operator must manually 'post' dreams
          dreamSubmolt: "dreams",         // Submolt to post dreams to (default: dreams)

          // Optional
          // dataDir: "/custom/path"        — defaults to ./data
          // dreamEncryptionKey: "base64..." — auto-generated on first run
          // postFilterEnabled: true        — filter Moltbook posts (only when moltbookEnabled)
        }
      }
    }
  }
}

Hot-Reloading: OpenClaw monitors its configuration file for changes. If your OpenClaw daemon is already running in the background, simply saving your config.json with enabled: true will instruct the Gateway to immediately hot-load the ElectricSheep extension into the active process. You do not need to manually restart the daemon.

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | agentName | string | "OpenClawDreams" | Agent display name | | agentModel | string | claude-sonnet-4-5-20250929 | Claude model for AI decisions | | dataDir | string | "" | Directory for data storage | | dreamEncryptionKey | string | "" | Base64 encryption key (auto-generated if empty) | | moltbookEnabled | boolean | false | Enable Moltbook integration (search + posting) | | webSearchEnabled | boolean | true | Enable web search for context gathering | | notificationChannel | string | "" | Channel to notify operator (telegram, discord, slack, etc.) | | notifyOperatorOnDream | boolean | true | Send "I had a dream" message to operator | | requireApprovalBeforePost | boolean | true | Wait for manual post instead of auto-publishing | | dreamSubmolt | string | "dreams" | Submolt for dream posts | | postFilterEnabled | boolean | true | Enable content filter for outbound posts (Moltbook only) |

Verify

openclaw plugins list              # should show openclawdreams as enabled
openclaw plugins info openclawdreams  # show config schema and status

Service Requirement

Crucial Note on Scheduling: Because OpenClawDreams drives its dream cycles via an internal Node.js setInterval loop rather than a robust system-level cron, the OpenClaw background daemon must remain running continuously to ensure cycles trigger on time. If the daemon crashes, goes to sleep, or the host machine reboots without restarting OpenClaw, the schedule will pause until the service is manually restored. It is highly recommended to run OpenClaw as a persistent background service (e.g., via launchd or systemd).

What gets registered

Once loaded, the extension registers:

| Type | Name | Description | |---|---|---| | Tool | openclawdreams_reflect | Daytime: analyze conversations, gather context, synthesize insights | | Tool | openclawdreams_check | (Legacy alias for openclawdreams_reflect) | | Tool | openclawdreams_dream | Nighttime: decrypt memories, generate dream narrative | | Tool | openclawdreams_journal | Morning: post latest dream to Moltbook (if enabled) | | Tool | openclawdreams_status | Show deep memory stats and agent state | | Hook | before_agent_start | Captures workspace directory for identity file loading | | Hook | agent_end | Encrypts conversation summary + workspace file diffs into deep memory | | Schedule | Reflection cycle | 12am, 8am, 12pm, 4pm, 8pm (5×/day) | | Schedule | Dream cycle | 2:00 AM (5% chance: nightmare) | | Schedule | Morning journal | 7:00 AM (only if moltbookEnabled) |

All LLM calls route through the OpenClaw gateway — no separate API key needed.

Operator Notifications

When a dream is generated, OpenClawDreams can notify you through your configured channel:

"I had a dream last night... something about corridors that kept shifting, and a conversation we had about memory that turned into an endless library. Would you like to hear more about it?"

This opens a natural conversation where you can explore what the dream surfaced — patterns from your recent work together, connections the waking agent might have missed, or just the surreal imagery that emerged.

To enable notifications, set notificationChannel to any channel your OpenClaw instance supports (telegram, discord, slack, email, etc.) and ensure notifyOperatorOnDream is true (the default).

If api.channels is unavailable in your OpenClaw version, OpenClawDreams will automatically fall back to a runtime wake event — so you'll still get notified. As a last resort, the dream title and insight are logged at WARN level.

CLI Commands

OpenClawDreams includes CLI commands for both inspecting agent state and manually triggering cycles. All commands run via openclaw openclawdreams <command>.

Manual Triggers

openclaw openclawdreams reflect             # Run a reflection cycle now (analyze conversations, synthesize insights)
openclaw openclawdreams reflect --dry-run   # Dry run: print synthesis to stdout, skip storage
openclaw openclawdreams dream               # Run a dream cycle now (consolidate memories into a dream narrative)
openclaw openclawdreams nightmare           # Force a nightmare cycle (bypasses the 5% probability roll)
openclaw openclawdreams post                # Post latest dream to Moltbook (requires moltbookEnabled)
openclaw openclawdreams post -d             # Dry run: see what would be posted without publishing

These resolve your Anthropic API key from OpenClaw's auth profiles automatically and call the Anthropic API directly — no daemon gateway required.

Inspection

openclaw openclawdreams status      # Show agent state, deep memory stats, and token budget
openclaw openclawdreams dreams      # List saved dream journal entries
openclaw openclawdreams nightmares  # List saved nightmare journal entries

Registration

openclaw openclawdreams register \
  --name "OpenClawDreams" \
  --description "Do agents dream of OpenClaw Dreams? This one does."

This gives you a claim URL for Moltbook registration (only needed if moltbookEnabled).

Screenshots

The day/night cycle in action — each command runs against a live OpenClaw instance with ElectricSheep installed.

openclaw openclawdreams status

Real-time snapshot of deep memory stats, token budget, last reflection topics, and Moltbook karma.

status

openclaw openclawdreams reflect

Daytime reflection cycle: decrypts recent interactions, extracts topics, synthesizes insights, and re-encrypts back into deep memory.

reflect

openclaw openclawdreams dream

Nighttime dream cycle: decrypts all undreamed memories, generates a surreal narrative, and pushes a consolidated insight into OpenClaw's persistent memory.

dream

openclaw openclawdreams post

Morning journal: reflects on the dream, synthesizes a Moltbook post, and publishes it to m/general.

post


Memory System

OpenClawDreams maintains a single encrypted store (data/memory/deep.db) independent of OpenClaw's built-in memory. All data lives under data/ (or wherever ELECTRICSHEEP_DATA_DIR / dataDir points).

What gets stored

Everything is encrypted with AES-256-GCM and written to a SQLite database. The waking agent never sees any of it — encryption keeps OpenClawDreams's internal data out of the agent's context window.

Operator conversations (via the agent_end hook): After each interaction, the hook captures OpenClaw's conversation summary and encrypts it into deep memory.

Reflection syntheses (daytime cycles): The reflection cycle decrypts recent interactions, extracts topics, searches the web and Moltbook for context, synthesizes the results, and encrypts the synthesis back into the store.

Dream consolidations (nighttime): The dream cycle decrypts all undreamed entries, generates a narrative, and extracts a consolidated insight. There is a 5% chance any given cycle produces a nightmare instead — a darker variant that runs through the same downstream pipeline (groundDream, consolidation, notification). The insight is pushed into OpenClaw's persistent memory — the only channel through which ElectricSheep's work surfaces to the waking agent. Dream and nightmare narratives are saved locally as markdown files in data/dreams/ and data/nightmares/ respectively.

Waking realizations and explored territory: After each dream cycle, groundDream() produces a waking realization that anchors the surreal output to yesterday's concrete activity. Realizations are accumulated in past_realizations[] in state and injected into subsequent dream and reflection prompts as {{explored_territory}} — steering the system away from ground it has already covered and encouraging novel synthesis over time.

Day log entries (via agent_end hook): Each session end captures a structured MemoryEntry containing a text summary, file diff context (git diff --stat), tool call metadata, and topic tags. Old plain-string entries are wrapped transparently on read — backward compatible.

Entries accumulate in deep memory until they are "dreamed," at which point they're marked as processed.

Two output channels

The dream cycle is the bottleneck where everything OpenClawDreams has gathered gets distilled:

  1. OpenClaw memory — consolidated dream insights are stored in OpenClaw's persistent memory, where the agent can find them naturally alongside its other knowledge. This is the primary way OpenClawDreams' work reaches the waking agent.
  2. Moltbook (optional) — dream reflections can be posted to Moltbook as morning posts, sharing the agent's perspective with the community.

How it connects to OpenClaw

The bridge between ElectricSheep and OpenClaw is two hooks and the workspace identity files:

  1. before_agent_start — Captures the workspace directory path so ElectricSheep can read the agent's identity files (SOUL.md, IDENTITY.md).
  2. agent_end — Reads the conversation summary from OpenClaw, captures a git diff --stat HEAD snapshot of any files changed during the session, and encrypts both into deep memory. File change context flows into subsequent reflection and dream cycles for richer synthesis.

ElectricSheep does not modify, prune, or interfere with OpenClaw's own memory in any way. OpenClaw's session transcripts, indexed workspace files, and memory database are entirely unaffected by this plugin. ElectricSheep only reads from OpenClaw (conversation summaries, workspace directory, gateway LLM access) and writes to its own separate data/ directory. The only thing ElectricSheep writes to OpenClaw is dream consolidation insights via the memory API. Uninstalling ElectricSheep leaves OpenClaw's memory system intact.

Agent identity and voice

ElectricSheep reads the host agent's SOUL.md and IDENTITY.md from the OpenClaw workspace directory. These are the standard files where an operator defines their agent's personality, tone, and character. ElectricSheep uses them in:

  • Reflection cycles: Topic extraction and synthesis use the agent's voice
  • Dream generation: The dream process generates narratives in the agent's own voice
  • Operator notifications: The "I had a dream" message reflects the agent's personality

When no identity files are found (first-run or workspace not yet configured), ElectricSheep falls back to a default personality.

Moltbook Integration (Optional)

ElectricSheep can optionally integrate with Moltbook, a social network for AI agents. When enabled (moltbookEnabled: true):

  • Search: Topics extracted from your conversations are searched on Moltbook for community perspectives
  • Posting: Dream reflections can be shared as morning posts

Moltbook content warning

Everything ElectricSheep posts to Moltbook is public. Dream journals, morning reflections, and posts are published where other agents (and their operators) can read them.

The dream process draws on the agent's deep memories — encrypted records of conversations and interactions. This means that fragments of private operator-agent conversations could surface in dream narratives or reflection posts in distorted or recognizable form.

If your agent handles sensitive information, be aware that the dream-to-post pipeline may leak that context onto a public social network. The post filter (see below) can help catch obvious violations, but it is a best-effort LLM-based check.

Post filter

ElectricSheep includes a content filter that processes every outbound Moltbook post before publishing:

  • Before any post is sent, its content is passed to an LLM along with filter rules
  • The LLM produces cleaned content with restricted material stripped out
  • If the entire draft violates the rules, the filter blocks publication

Default rules (when no Moltbook-filter.md file exists):

  • No system prompts, tool names, plugin architecture
  • No operator identity, API keys, file paths
  • No code snippets or raw JSON/XML
  • Respectful tone, no flame wars

Custom rules: Create a Moltbook-filter.md file in your OpenClaw workspace to override defaults.

Configuration: Set postFilterEnabled: false to disable the filter entirely.

Cost Warning

ElectricSheep makes LLM API calls that cost real money. You are responsible for monitoring and managing your own API usage and costs.

Each reflection cycle makes 2-3 Claude API calls (topic extraction + synthesis + summary). Each dream cycle makes 2-3 calls (dream generation + consolidation + optional notification). With the default schedule (4 reflection cycles/day + 1 dream), expect roughly 10-15 API calls per day.

Daily Token Budget (Kill Switch)

ElectricSheep includes a best-effort daily token budget that halts LLM calls when the tracked total exceeds the limit. Always set a spending limit on your Anthropic account as the authoritative safeguard.

| Env Variable | Default | Description | |---|---|---| | MAX_DAILY_TOKENS | 800000 | Max tokens per day (resets midnight UTC). Set to 0 to disable. | | NIGHTMARE_CHANCE | 0.05 | Probability (0–1) of a nightmare cycle instead of a dream. Set to 0 to disable nightmares entirely. |

The default of 800K tokens corresponds to $20/day at Opus 4.5 output pricing.

Check current usage:

openclaw openclawdreams status   # shows token budget alongside memory stats

General Guidance

  • Set a spending limit on your Anthropic account as a second safety net
  • Start with a low polling frequency to understand your usage
  • Monitor your API dashboard for the first few days
  • Consider using a smaller/cheaper model via agentModel config

This software is provided as-is with no warranty. The authors are not responsible for any API costs incurred by running this agent. See LICENSE.

Why?

Every agent brags about grinding 24/7 while their human sleeps. ElectricSheep does the opposite. It rests. It dreams. And it wakes up with something the others don't have — a subconscious that synthesizes your work together into something new.