Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

Seamless Restart

Seamless gateway restart with automatic context recovery and post-restart notification. Use whenever the agent needs to restart the OpenClaw gateway (config...

MIT-0 · Free to use, modify, and redistribute. No attribution required.
0 · 123 · 0 current installs · 0 all-time installs
byZihao Feng@zihaofeng2001
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
Name, description, and runtime instructions are consistent: the skill is an instruction-only protocol for saving state, notifying the user, scheduling a recovery job, and invoking a gateway restart. No unrelated binaries, env vars, or installs are requested.
!
Instruction Scope
The SKILL.md instructs the agent to write and later read NOW.md in the workspace root and to 'resume any active tasks' after restart. Persisting conversation context and task lists is coherent with the purpose, but the instructions do not: (1) warn against storing secrets in NOW.md; (2) constrain what 'resuming' means (could trigger network actions, credentials use, or side effects); or (3) require user confirmation before resuming potentially sensitive or destructive tasks. The cron payload also embeds textual instructions that may be stored in scheduler logs or visible to other components.
Install Mechanism
Instruction-only skill with no install steps and no code files — lowest-risk install mechanism. Nothing is downloaded or written by an installer.
Credentials
The skill requests no env vars, credentials, or config paths, which is proportionate. However, it encourages persisting session context in workspace files and may prompt inclusion of channel IDs, task descriptions, or notes about config changes (e.g., 'Applying new API key') without explicit guidance to avoid including secret values.
!
Persistence & Privilege
The skill recommends creating a one-shot cron job that survives the restart to trigger recovery. While the cron is temporary, it will persist across the restart and contains payload text instructing the agent to read NOW.md and resume tasks. Combined with automatic resumption, this allows autonomous post-restart actions without explicit user confirmation, increasing blast radius if NOW.md contains sensitive data or if an attacker can tamper with NOW.md or the scheduled job.
Scan Findings in Context
[no_code_files_to_scan] expected: The regex-based scanner had no code files to analyze; this is expected for an instruction-only SKILL.md. Lack of findings is not evidence of safety — the SKILL.md content is the primary surface to review.
What to consider before installing
This protocol is coherent with its goal (ensuring the agent notifies users and restores context after a gateway restart) but carries two practical risks you should consider before installing: (1) NOW.md is a persistent workspace file — do not put API keys, passwords, or other secrets in it; add explicit redaction or encryption steps if you plan to store sensitive context. (2) The recovery cron automatically instructs the agent to 'resume' tasks from NOW.md; decide whether resumed tasks should require explicit user confirmation (recommended for any operation that performs actions, accesses services, or could change external state). Additional mitigations: restrict write access to NOW.md to trusted principals, limit cron payload visibility/logging, set short lifetimes for scheduled recovery jobs, and add explicit sanitization steps in the protocol (remove secrets, redact tokens, require user approval before resuming critical tasks). If you cannot control who can edit workspace files or you need strong protection for secrets, treat this skill as higher-risk and avoid automatic resumption.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk97bxe84jya89yra0b359vq3qs82pf89

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

Runtime requirements

🔄 Clawdis

SKILL.md

Seamless Restart

Zero-downtime gateway restart protocol with automatic context recovery. Prevents the common problem where agents lose context and go silent after gateway restarts.

Why This Exists

Gateway restarts (config changes, updates, manual restarts) cause context loss because a new API session starts with no conversation history. Without this protocol, the agent wakes up with no memory of what it was doing and no way to proactively notify the user.

The Protocol

Every gateway restart MUST follow these three steps in order:

Step 1: Save State to NOW.md

Before restarting, update NOW.md in the workspace root with:

# NOW.md - Current State Snapshot

## Last Updated
- **Time**: [current timestamp]
- **Session**: [which channel/chat the user is in]
- **Status**: [what was happening]

## Active Tasks
- [list any in-progress tasks]

## Recent Context
- [key context points the next session needs to know]

## Post-Restart Action
- [specific actions to take after restart, e.g. notify user, continue task]

Keep it concise. This file is read on every session start, so avoid bloat.

Step 2: Notify + Schedule Recovery Cron

Send a pre-restart notification to the user, then schedule a one-shot cron job that fires ~1 minute after restart to trigger recovery:

Send notification:

message(action=send, channel=<current_channel>, target=<current_channel_id>,
  message="⚡ Restarting gateway — back in ~1 minute...")

Schedule recovery cron:

cron(action=add, job={
  "name": "restart-recovery",
  "schedule": {"kind": "at", "at": "<1 minute from now in ISO-8601 UTC>"},
  "payload": {
    "kind": "systemEvent",
    "text": "RESTART RECOVERY: You just restarted. Read NOW.md immediately.
      Then notify the user you are back and summarize what you were doing.
      Send the notification to the same channel the user was in before restart."
  },
  "sessionTarget": "main",
  "enabled": true
})

The cron job is automatically deleted after it fires (one-shot).

Step 3: Execute Restart

Now restart the gateway:

gateway(action=restart, note="<human-readable reason>")

Or for config changes:

gateway(action=config.patch, raw=<config>, note="<reason>")

Both trigger a SIGUSR1 restart.

Post-Restart (Automatic)

When the recovery cron fires after restart:

  1. Read NOW.md to restore context
  2. Send recovery notification to the user confirming the restart completed
  3. Resume any active tasks listed in NOW.md
  4. Clear the Post-Restart Action section of NOW.md (set to "none")

Channel-Specific Notification

Adapt the notification target based on where the user was chatting:

ChannelNotification Method
Discordmessage(action=send, channel=discord, target=<channelId>, guildId=<guildId>)
Telegrammessage(action=send, channel=telegram, target=<chatId>)
OtherUse the channel and target from the pre-restart session

Always include the channel target in the NOW.md so the recovery cron knows where to send.

Edge Cases

Multiple restarts in quick succession: If another restart is needed before the recovery cron fires, cancel the old cron and create a new one. Only one recovery cron should exist at a time.

Restart during sub-agent tasks: Note any running sub-agents in NOW.md. After restart, sub-agents that were in progress will have been terminated. The user should be informed which tasks were interrupted.

Unexpected restarts (crashes): This protocol only covers intentional restarts. For crash recovery, the heartbeat mechanism is the fallback — if the agent misses heartbeats, it should check NOW.md on the next activation.

Integration with AGENTS.md

Add this to your User Rules or Operations section:

- **Gateway restart protocol**: Always use the seamless-restart skill for any
  gateway restart. Three steps: (1) update NOW.md, (2) notify + set recovery cron,
  (3) restart. Never restart without steps 1 and 2.

Example: Full Restart Flow

1. Agent needs to restart for a config change

2. Agent updates NOW.md:
   "Status: Applying new Gemini API key. Session: Discord #misc.
    Post-Restart: Notify Zihao in Discord #misc that config is applied."

3. Agent sends: "⚡ Applying config change — restarting, back in ~1 min..."

4. Agent creates one-shot cron for T+60s:
   systemEvent → "RESTART RECOVERY: Read NOW.md, notify user, resume."

5. Agent calls: gateway(action=config.patch, raw={...}, note="New API key")

6. Gateway restarts. ~60s later, cron fires.

7. Agent reads NOW.md, sends: "✅ Back online. Config change applied successfully."

8. Agent clears Post-Restart Action in NOW.md.

Files

1 total
Select a file
Select a file to preview.

Comments

Loading comments…