routines per bot up to 50
fastest schedule every 5 minutes
runs per month at 5 min 8,640
50 routines x 5 min 432,000 runs a month
background approval window ~10 minutes, then it expires
run history kept per routine 20 runs (= 1h 40m at 5 min)
bots on one account share one cloud computer
Grok 4.6 API, per 1M tokens $2 in · $0.50 cached · $6 out
one full run, my example 20K in + 1K out ≈ $0.046
one 5-min routine, API rates ≈ $397 a month
same routine with a change check ≈ $45 a month
same job on an event trigger $0 for the runs where nothing happened
Create a routine triggered by a webhook.
When it fires, read only the request body. Expect JSON with
"service", "status" and "url".
If status is not "failed", do nothing and stop.
If it is "failed", open the url, find the first error line, and post
to #incidents: service, the error line, one guess at the cause,
and the link. 4 lines max. Never retry the deploy yourself.
Every 5 minutes:
CHECK
Open [the page / repo / board]. Read only [the status field / last
commit hash / count of open items / "updated" date].
Compare it to the value in routines/state/[name].txt.
If it is the same, append "no_change" to the log and stop.
Do not open anything else. Do not "take a quick look around".
WORK (only if it changed)
Save the new value to routines/state/[name].txt.
Do [the actual job].
Post the result to [destination] in 5 lines max.
引原文里方括号处是你自己要填的内容。作者强调 “Do not take a quick look around” 这行很关键:没有它,Bot 往往会顺便探索,你又回到了付完整运行的钱。
作者对成本的演算(逐字,假设一天约变化 6 次,这是他的假设):
WITHOUT A CHECK 8,640 full runs x $0.046 = $397
WITH A CHECK 8,640 checks x $0.0043 = $37
180 full runs x $0.046 = $8
total = $45 (-89%)
After every run, append one line to routines/log/[name].csv:
time,result,changed,minutes,needed_approval,note
result is one of: ok, no_change, draft_left, failed
note is under 12 words. Create the file with that header if missing.
import csv, sys
from pathlib import Path
RUN_COST = 0.046 # your full-run estimate in $, see section 1
CHECK_COST = 0.0043 # a no_change run, if the routine has a change check
def verdict(no_change, failed, runs):
if runs == 0:
return "dead: never ran, check the schedule"
if failed > 0.10:
return "PAUSE: fails too often"
if no_change > 0.99:
return "DELETE or make it daily"
if no_change > 0.95:
return "slow down or add a change check"
return "keep"
folder = Path(sys.argv[1] if len(sys.argv) > 1 else "routines/log")
rows = []
for f in sorted(folder.glob("*.csv")):
runs = list(csv.DictReader(f.open()))
n = len(runs)
nc = sum(r["result"] == "no_change" for r in runs)
fl = sum(r["result"] == "failed" for r in runs)
dr = sum(r["result"] == "draft_left" for r in runs)
cost = nc * CHECK_COST + (n - nc) * RUN_COST
share = nc / n if n else 0
rows.append((share, f.stem, n, fl / n if n else 0, dr, cost))
print(f"{'routine':24} {'runs':>6} {'no_change':>10} {'failed':>7} {'drafts':>7} {'est $':>8} verdict")
for share, name, n, failed, drafts, cost in sorted(rows, reverse=True):
print(f"{name:24} {n:6} {share:10.0%} {failed:7.0%} {drafts:7} {cost:8.2f} "
f"{verdict(share, failed, n)}")
Every Monday at 9:00, run: python audit.py routines/log
Post the output to me as-is. Then list any routine marked DELETE or
PAUSE and ask me which ones to remove. Do not delete anything yourself.
the system can send an event -> narrow trigger, not a schedule
schedule faster than hourly -> needs a change check
routine runs while you sleep -> Custom Rule to allow, or stops at a draft
trigger on "every new message" -> rewrite it to match one thing
email trigger in a team -> admin has to enable the inbox first
history matters -> routine writes its own log line
no_change over 99% -> delete it or make it daily
testing a new routine -> safe copy, it does real work
logins on the shared computer -> every bot can use them
引@fleyta88(10 月 15 日 01:21 北京时间):给了一句可粘贴的提示,让 Grok Bot 每 5 分钟监控 X 提及,过滤噪音、保存已核实的发现、记录执行成本、只在重要变化时通知、未经批准不发布。他的提示词原文:“monitor my X mentions every 5 minutes. filter irrelevant activity, save verified findings, track execution costs, and only notify me when something important changes. never publish without approval.”(他说“7 个 AI agent 在 5 分钟循环里”,帖子没有给出这 7 个 agent 的具体内容,我无法核实,视频我没有看。)