feat: initial companion repo for OpenClaw vs Claude Code article
40 files demonstrating every major OpenClaw capability using Claude Code: - 3 agents (researcher, writer, reviewer) - 3 skills (daily-briefing, slack-message, web-research) - 2 security hooks (pre-tool-use blocker, post-tool-use logger) - 10 self-contained examples with copy-paste prompts - Complete feature map (20 capabilities, 11 full match, 7 different, 2 gap) - Security docs including NemoClaw comparison - Automation, messaging, browser, memory documentation Zero dependencies. Clone and run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
2491f5c732
40 changed files with 2037 additions and 0 deletions
64
automation/README.md
Normal file
64
automation/README.md
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# Automation
|
||||
|
||||
Four ways to schedule or trigger Claude Code tasks, with OpenClaw equivalents.
|
||||
|
||||
## 1. `/loop` - In-session recurring tasks
|
||||
|
||||
Run a task repeatedly within a single Claude Code session.
|
||||
|
||||
```
|
||||
/loop Run /health-check every 30 minutes
|
||||
```
|
||||
|
||||
**Best for:** Monitoring during active work sessions, watch loops, polling.
|
||||
**OpenClaw equivalent:** `HEARTBEAT.md` pattern - agent checks a file on each tick
|
||||
and executes tasks listed there.
|
||||
|
||||
## 2. `CronCreate` - Claude Code built-in cron
|
||||
|
||||
Claude Code can create system crontab entries directly via the `CronCreate` tool.
|
||||
|
||||
```
|
||||
# In a Claude Code session:
|
||||
Create a cron job that runs /daily-briefing every day at 7 AM
|
||||
```
|
||||
|
||||
Claude calls `CronCreate` and writes the entry to your system crontab.
|
||||
List with `CronList`, remove with `CronDelete`.
|
||||
|
||||
**Best for:** Simple recurring tasks, no manual crontab editing.
|
||||
**OpenClaw equivalent:** OpenClaw's scheduler daemon with task definitions in config.
|
||||
|
||||
## 3. `/schedule` - Remote triggers via claude.ai/code
|
||||
|
||||
Trigger Claude Code runs remotely through claude.ai/code using the `RemoteTrigger`
|
||||
tool or the web interface.
|
||||
|
||||
**Best for:** Event-driven automation, triggering from external systems.
|
||||
**OpenClaw equivalent:** OpenClaw's webhook receiver (listens on a local port).
|
||||
|
||||
## 4. `launchd` - macOS native scheduler
|
||||
|
||||
More reliable than cron on macOS. Survives sleep/wake cycles, logs stdout/stderr,
|
||||
and integrates with the macOS service manager.
|
||||
|
||||
See `daily-briefing.sh` and `launchd-example.plist` in this directory.
|
||||
|
||||
```bash
|
||||
# Install:
|
||||
cp launchd-example.plist ~/Library/LaunchAgents/com.example.claude-briefing.plist
|
||||
launchctl load ~/Library/LaunchAgents/com.example.claude-briefing.plist
|
||||
```
|
||||
|
||||
**Best for:** Production schedules on Mac, anything that needs to survive reboots.
|
||||
**OpenClaw equivalent:** Same - OpenClaw also recommends launchd on macOS for its
|
||||
daemon process.
|
||||
|
||||
## Comparison
|
||||
|
||||
| Approach | Setup | Reliability | Use case |
|
||||
|---------------|----------|-------------|-------------------------------|
|
||||
| `/loop` | Zero | Session | Active monitoring |
|
||||
| `CronCreate` | Minimal | Good | Simple recurring tasks |
|
||||
| `/schedule` | Moderate | Good | Remote/event triggers |
|
||||
| `launchd` | Manual | Best on Mac | Production daily jobs |
|
||||
8
automation/daily-briefing.sh
Executable file
8
automation/daily-briefing.sh
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
# Run the daily briefing skill via Claude Code headless mode
|
||||
# Schedule this with cron or launchd
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
claude -p "Run /daily-briefing and save output to briefings/$(date +%Y-%m-%d).md" \
|
||||
--output-format text \
|
||||
--max-turns 10
|
||||
53
automation/launchd-example.plist
Normal file
53
automation/launchd-example.plist
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
|
||||
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<!-- Unique reverse-DNS label for this job. Change to match your domain. -->
|
||||
<key>Label</key>
|
||||
<string>com.example.claude-daily-briefing</string>
|
||||
|
||||
<!-- The program to run. /bin/bash executes the shell script. -->
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/bin/bash</string>
|
||||
<!-- CUSTOMIZE: Replace with the absolute path to your daily-briefing.sh -->
|
||||
<string>/path/to/claude-code-complete-agent/automation/daily-briefing.sh</string>
|
||||
</array>
|
||||
|
||||
<!-- Run daily at 07:00. Adjust Hour/Minute as needed. -->
|
||||
<key>StartCalendarInterval</key>
|
||||
<dict>
|
||||
<key>Hour</key>
|
||||
<integer>7</integer>
|
||||
<key>Minute</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
|
||||
<!-- Redirect stdout to a log file. CUSTOMIZE path. -->
|
||||
<key>StandardOutPath</key>
|
||||
<string>/tmp/claude-daily-briefing.log</string>
|
||||
|
||||
<!-- Redirect stderr to a separate log file. CUSTOMIZE path. -->
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/tmp/claude-daily-briefing.err</string>
|
||||
|
||||
<!-- Run whether or not the user is logged in. -->
|
||||
<key>RunAtLoad</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
<!--
|
||||
SETUP:
|
||||
1. Copy this file to ~/Library/LaunchAgents/com.example.claude-daily-briefing.plist
|
||||
2. Customize the Label, ProgramArguments path, and log paths above
|
||||
3. Load it: launchctl load ~/Library/LaunchAgents/com.example.claude-daily-briefing.plist
|
||||
4. Verify: launchctl list | grep claude
|
||||
|
||||
UNLOAD:
|
||||
launchctl unload ~/Library/LaunchAgents/com.example.claude-daily-briefing.plist
|
||||
|
||||
NOTE: LaunchAgents run in the user session. The claude binary must be in PATH
|
||||
or specified with its full path (e.g., /usr/local/bin/claude).
|
||||
-->
|
||||
Loading…
Add table
Add a link
Reference in a new issue