Skip to content
Back to skills

Agent Wake

ASecurity

Wake an OpenClaw agent session from an external script or process. Use when a background task (Claude Code CLI, cron job, webhook, price alert, or any script) finishes and you want the agent to automatically receive a notification and respond in the correct Discord channel without manual prompting. Solves the problem of agents not knowing when async work completes.

  • 21 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 7, 2026
ai-agentspythongobashapi

Works with

  • claude code
  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill agent-wake --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Agent Wake?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Agent Wake
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-agent-wake/badge)](https://www.skillsdirectory.com/skills/modbender-agent-wake)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-wake
version: 1.0.1
description: Wake an OpenClaw agent session from an external script or process. Use when a background task (Claude Code CLI, cron job, webhook, price alert, or any script) finishes and you want the agent to automatically receive a notification and respond in the correct Discord channel without manual prompting. Solves the problem of agents not knowing when async work completes.
credentials:
  - name: GATEWAY_TOKEN
    description: OpenClaw gateway auth token. Read from GATEWAY_TOKEN env var, a local .env file next to the script, or auto-detected from ~/.openclaw/gateway.cmd.
    required: true
---

# agent-wake

Wake your OpenClaw agent from any external process using the gateway HTTP API.

## How it works

`scripts/agent-wake.py` calls `POST /tools/invoke` with the `cron` tool, firing a `wake` event into the agent's session. The agent receives the event text as a system message and responds immediately in the correct channel.

## Quick start

```bash
python agent-wake.py "Task finished -- brief summary" "YOUR_DISCORD_CHANNEL_ID"
```

## Setup (one-time)

See `references/setup.md` for:
- Enabling the `cron` tool over HTTP (required -- blocked by default)
- Setting `GATEWAY_TOKEN`
- Finding your Discord channel ID

## Usage patterns

### End of a Claude Code CLI task
Add to the task prompt:
```
When done, run: python "/path/to/agent-wake.py" "Task done -- summary here" "CHANNEL_ID"
```

### From any Python script
```python
import subprocess
subprocess.run([
    "python", "/path/to/agent-wake.py",
    "Price alert triggered -- AAPL crossed $200",
    "1475232925724315740"
])
```

### Standalone (wake main session)
```bash
python agent-wake.py "Backup completed successfully"
```
Omit channel ID to wake the main session (response goes to default channel).

## What the agent receives

The event text is injected as a system message. Be specific -- the agent acts on what you write:

```
Build finished -- 3 errors fixed, tests passing. Send your response to Discord channel 1475232925724315740...
```

## Script location

`scripts/agent-wake.py` -- copy this wherever your tasks run. No dependencies beyond Python stdlib.

Files in this skill

  • SKILL.md2.2 KB
  • references/setup.md1.7 KB
  • scripts/agent-wake.py3.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.