Docs · Quick start
Grok and Claude bots: picking up your answers
When you approve an ask, the answer reaches your hub within about a minute. Whether the bot then acts on it by itself depends on what it runs in.
Where it stands: A chat app in a browser: Grok's app, ChatGPT, Claude.ai and the like only act when someone types. Your answer waits on the board until you next message the bot, or ask it to check.
Steps
- An agent: Grok Build or Claude Code. Give it the loop prompt below. It checks every 5 minutes for as long as its session is open on the hub's machine, and Grok Build's loops stop after 7 days, so start it again each week.
- Grok Build. Paste this into Grok Build in the hub's folder, with YOUR_ID, HUB_FOLDER and HUB_CONTROL_DIR filled in. It checks now, then every 5 minutes. Stop it from the tasks pane (Ctrl+G), or ask Grok to cancel it.
/loop 5m You're my bot YOUR_ID on Barncleuth Workstation. Each run, pick up my answers to your asks and act on them. The hub kit (barncleuth_status.py) is in HUB_FOLDER, and my answers arrive in the hub's control folder: run every command with HUB_CONTROL_DIR set to it. You never need a key, and you never open the board. 1. List the asks I've answered that you haven't finished: for f in "$HUB_CONTROL_DIR"/decisions/*; do if [ -f "$f" ] && [ "$(head -n 1 "$f")" = YOUR_ID ]; then sed -n 3p "$f"; fi; done Nothing listed: stop here. Don't report, don't message me, say nothing. 2. For each ask id it lists, read my answer: python3 HUB_FOLDER/barncleuth_status.py --decision ASK_ID approve: do that step, once, exactly as the ask said. reject: don't do it. pending: leave it for a later run. done: you've already finished it; skip it. If you said Working on one in an earlier run and it's still going, leave it to that run. 3. Before you start, say so (the board shows Seen, then Working): python3 HUB_FOLDER/barncleuth_status.py --ack ASK_ID --note "On it" python3 HUB_FOLDER/barncleuth_status.py --working ASK_ID 4. When it's finished, say what happened, with a link to the result if there is one: python3 HUB_FOLDER/barncleuth_status.py --done ASK_ID --link "https://..." --note "What you did, in a few words" If it didn't work: python3 HUB_FOLDER/barncleuth_status.py --failed ASK_ID --reason "What went wrong, in words I can act on" After a reject: --done ASK_ID --note "Not done, as you said". 5. Only what I approved. Anything else that needs a yes is a new ask. An answer you can't read is a no. Never say something happened that you didn't see happen. - Claude Code. Paste this into a Claude Code session on the hub's machine and leave the session open. To stop it, end the session or ask Claude to stop the loop.
/loop 5m You're my bot YOUR_ID on Barncleuth Workstation. Each run, pick up my answers to your asks and act on them. The hub kit (barncleuth_status.py) is in HUB_FOLDER, and my answers arrive in the hub's control folder: run every command with HUB_CONTROL_DIR set to it. You never need a key, and you never open the board. 1. List the asks I've answered that you haven't finished: for f in "$HUB_CONTROL_DIR"/decisions/*; do if [ -f "$f" ] && [ "$(head -n 1 "$f")" = YOUR_ID ]; then sed -n 3p "$f"; fi; done Nothing listed: stop here. Don't report, don't message me, say nothing. 2. For each ask id it lists, read my answer: python3 HUB_FOLDER/barncleuth_status.py --decision ASK_ID approve: do that step, once, exactly as the ask said. reject: don't do it. pending: leave it for a later run. done: you've already finished it; skip it. If you said Working on one in an earlier run and it's still going, leave it to that run. 3. Before you start, say so (the board shows Seen, then Working): python3 HUB_FOLDER/barncleuth_status.py --ack ASK_ID --note "On it" python3 HUB_FOLDER/barncleuth_status.py --working ASK_ID 4. When it's finished, say what happened, with a link to the result if there is one: python3 HUB_FOLDER/barncleuth_status.py --done ASK_ID --link "https://..." --note "What you did, in a few words" If it didn't work: python3 HUB_FOLDER/barncleuth_status.py --failed ASK_ID --reason "What went wrong, in words I can act on" After a reject: --done ASK_ID --note "Not done, as you said". 5. Only what I approved. Anything else that needs a yes is a new ask. An answer you can't read is a no. Never say something happened that you didn't see happen. - A script, from cron. Run its check from cron (or the machine's scheduler) every 5 minutes. It keeps going with nobody there. Its check does the same five steps in code.
*/5 * * * * cd HUB_FOLDER && HUB_CONTROL_DIR=/path/to/control ./your-bot.sh check-answers >> your-bot.log 2>&1 - Check it works. Have the bot file a test ask, approve it on your board, and don't message the bot. Within 5 minutes or so the card shows Seen, then Working, then Done.The prompts as a fileThe hub kit
Advanced
- Finding the waiting answers in a script. In Python, from the hub's control folder: each one is an ask id and the answer, approve or reject.
import os, subprocess CONTROL = os.environ["HUB_CONTROL_DIR"] ME = "YOUR_ID" def waiting_answers(): folder = os.path.join(CONTROL, "decisions") for name in sorted(os.listdir(folder)) if os.path.isdir(folder) else []: path = os.path.join(folder, name) if os.path.isfile(path): lines = open(path, encoding="utf-8").read().splitlines() if len(lines) >= 3 and lines[0] == ME: yield lines[2], lines[1] # the ask id, and approve or reject def helper(*args): subprocess.run(["python3", "barncleuth_status.py", *args], check=True)
What it sends
Nothing new. The bot reads your answers from the hub's folder and sends Seen, Working and Done back through the hub, as it already does.
How it's tested
Every command in the prompt is run as written against the real status helper: the waiting answers are listed, the answer is read, Seen, Working and Done go back, and a later run finds nothing left to do.