Skip to main content

gbq dispatches work to several Grok Bots in parallel at about 400MB of local memory

GitHubGitHubShuhangGe2026-08-29

Code and reposResearchSource read in fullRead first
GitHubGitHubShuhangGe2026-08-29

Open original

Overview

A developer wants parallel Grok Bots without filling local memory. gbq and Tailscale queue tasks for bots on one shared cloud machine with one local desktop UI.

Workflow

  1. What it is: A command-line queue for dispatching tasks to several Grok Bots in parallel. The bash and Node CLI (bin/gbq and lib/ scripts) includes .claude/skills/grokbot/SKILL.md for local Claude Code agents to use the primitives in AGENTS.md. Its main claim is cloud execution with one local Electron UI at a constant roughly 400MB regardless of bot or task count.
  2. Grok Bot parts used: Desktop app, bots and their shared cloud machine. Automation drives the Electron UI. Each bot has its own exec-daemon process on a shared 8-core/15Gi Debian cloud machine with a desktop and browser, shell, read/write /workspace, passwordless sudo and internet. It uses persistent memory and complete conversation history. gbq read reads the cloud transcript outside the UI. Not part of Grok Bot: Tailscale networking and SSH, local tools (ssh node python3 curl lsof), Claude Code skill wrapper and CDP/UI automation code. No x.ai/bot template or xAI API.
  3. You need: Desktop, Tailscale and local CLI tools. The desktop must stay running and can be minimized. Closing it drops SSH and UI together and the cloud node goes offline. Install Tailscale under one account on both ends. Locally install ssh node python3 curl lsof. The cloud machine has no sshd initially. Give the setup wizard's printed install command to any bot. Use a dedicated SSH key as recommended and bind sshd to Tailscale only. Extra paid plan requirements are not stated in the source.
  4. Install: Clone and run guided setup.
    • Step 1: git clone https://github.com/ShuhangGe/grokbot-queue ~/gbq
    • Step 2: cd ~/gbq && chmod +x bin/gbq, then add ~/gbq/bin to PATH.
    • Step 3: gbq setup finds Linux nodes on the tailnet. It normally stops at SSH on first run because the cloud has no sshd. Give any bot the printed command, then rerun setup. SETUP.md has full troubleshooting.
    • Step 4: Run gbq doctor for health checks and as the first step for later issues. List bots with gbq bots and try gbq ask -b <bot> '...'.
    • Step 5 (optional for Claude Code): Symlink .claude/skills/grokbot to ~/.claude/skills/grokbot. README uses one ln -s command.
  5. After install: Queue, wake, run in parallel and collect.
    • gbq ask sends a question and waits. The bot opens a real browser, reads live pages and replies with URLs and dates. gbq send/read sends without waiting or reads recent chat.
    • gbq submit writes a batch via SSH into cloud /workspace/gbq/<bot>/inbox/ without waking the bot. gbq dispatch uses Electron CDP to wake bots, which work inboxes in parallel. gbq collect reads JSON from outbox.
    • gbq ctx add/sync incrementally syncs local source in about 3 seconds. gbq run --ctx <name> combines sync, dispatch, wait and collection.
    • Dispatch cost scales by bots instead of tasks. README says 100 tasks across 4 bots dispatch in about 16 seconds.
    • UI falls back in three levels: L1 CDP and precise selectors → L2 CDP and heuristics → L3 screenshot and click. Signal Grok Bot with SIGUSR1 to attach the Node inspector to the renderer. gbq doctor reports active level.
  6. Did the author run it: The README reports measurements (author's claim, not reproduced). Two bots running 30-second jobs overlapped 28 seconds, yielding 1.88× wall-clock speedup checked by timestamps. A four-task batch took 26 seconds. Local memory stayed around 400MB versus 150–335MB×N for local agents, with break-even at the third concurrent task. README says INTERNALS.md documents 16 pitfalls including Tailscale SSH taking port 22, off-Space clicks reporting success without effect and ProseMirror ignoring direct DOM writes. There are no per-run logs in the repo.

Key points and results

  • Maturity: At fetch on 2026-11-25, created 2026-08-29 (about three months), last pushed 2026-11-24, 8 commits, 29 stars, 7 forks, MIT license and no open issues or PRs. README says it relies on UI automation without an official API and Cursor updates may break L1.
  • Permissions and boundaries: During send, 127.0.0.1:9229 is open to any local process, allowing full Grok Bot control. gbq closes it after each operation. ctx sync uploads source to a Cursor-hosted machine, so be careful with sensitive projects. Keep long-lived credentials off the cloud. All bots see /workspace. sshd binds Tailscale only and a dedicated key is recommended.
  • Known limits: Dispatch is serial with one activeAgent and about 4 seconds per switch. Practical range is 4–8 bots. They share cloud CPU, memory and disk. Closing desktop takes the node offline. Cloud sshd uses nohup and does not survive container restart, the most common issue in SKILL.md. Cloud blocks theblock.co, cointelegraph.com and Google News with ERR_BLOCKED_BY_RESPONSE; CoinDesk works. L3 requires the window on the current Space or clicks silently fail.
  • Worth borrowing: Scale by bot count by batching bodies to inbox over SSH and using UI only to wake bots (README architecture).
  • Worth borrowing: Use three automation levels. L2 finds repeated sibling structures without sand-* classes, and L3 detects an off-Space window and reports L3_WINDOW_OFF_SPACE instead of false success (README and SKILL.md).
  • Worth borrowing: Use persistent memory to specialize. Run gbq read -b <bot> before dispatch to see context and avoid mixing domains often in one bot (SKILL.md).

Source

Platform
GitHub
Author
ShuhangGe
Published
Categories
Code and repos, Research

What this evidence label means

Source read in full

We read the source (post, article or transcript). That only means the original was read. It does not mean this site reproduced the author's results.

Read the editorial and evidence policy

Other cases in this scenario

This unofficial community project is independent of xAI. xAI has neither approved nor endorsed it. No sign-up. The methods and figures come from the original authors.