openclaw-daily-ops
Daily cost reporting + zombie session killer for OpenClaw deployments.
Two problems, one nightly cron:
- Know what you spent โ parses your OpenClaw session files, computes per-session API costs, posts a clean report to Discord with 7-day trend
- Kill what's dead โ wipes sessions older than 24h with >1MB context before they snowball into thousands of dollars
Zero AI credits spent running this. Pure Python + one Discord webhook.
What the Report Looks Like
๐ Daily Cost Report โ Mar 9, 2026
๐ฐ Total: $4.21 ยท 8.3M tokens
By Session:
๐ด #general โ $2.45 ยท 4.1M tok
๐ก #posting โ $1.32 ยท 2.8M tok
๐ข heartbeat โ $0.44 ยท 1.4M tok
7-day trend: $12 โ $8 โ $6 โ $5 โ $4 โ $4 โ $4
โ
UNDER BUDGET
๐ Reset 2 stale sessions ยท 3.2MB freed
Quick Start
git clone https://github.com/oh-ashen-one/openclaw-daily-ops
cd openclaw-daily-ops
# 1. Configure
cp config.example.json config.json
# Edit config.json with your webhook, user ID, and session paths
# 2. Test
python3 scripts/cost_report.py --config config.json --dry-run
# 3. Set up nightly cron (see SKILL.md for full options)
Requirements
- Python 3.8+
- OpenClaw installed and running
- A Discord webhook URL (free, takes 30 seconds to create)
Files
openclaw-daily-ops/
โโโ SKILL.md โ Full setup guide + OpenClaw cron integration
โโโ README.md โ This file
โโโ config.example.json โ Configuration template
โโโ scripts/
โโโ cost_report.py โ Cost parser + Discord poster
โโโ zombie_killer.py โ Stale session wiper
Configuration
See config.example.json for all options. The important ones:
| Key | Description |
|-----|-------------|
| discord_webhook | Where the daily report gets posted |
| discord_user_id | Who gets pinged when cost > threshold |
| | Session age threshold (default: 24h) |
| | Minimum file size to bother resetting (default: 1MB) |
| | ๐จ URGENT flag threshold in USD (default: $50) |