How I Have Claude Code Control Grok Bot (There Is No API)
Описание и применение
Автоматизированный мост позволяет Claude Code отправлять задачи в Grok Bot через вебхук, получать результаты через локальный файл‑outbox и конфигурировать ботов через debug‑порт, обходя отсутствие публичного API.
Задача
Claude Code needed to delegate tasks to Grok Bot, but Grok Bot offers no public API for driving bots.
Результат
The bridge enables Claude Code to delegate tasks to Grok Bot via a webhook, receive results through a local file outbox, and configure bots through a debug port, overcoming the lack of a public API.
Рабочий процесс
- Create a dedicated Grok Bot that only accepts tasks from an agent.
- Configure a routine with a Webhook trigger and set a safety rule in its instruction.
- Store the webhook URL and key in a secret manager (e.g., Doppler).
- Install two dependency‑free Python scripts (grokbot‑send and grokbot‑read) on the agent’s PATH.
- Create an outbox directory accessible to both the agent and the Grok Bot desktop app.
- Use grokbot‑send to POST tasks to the webhook, optionally with --wait or --collect to poll for results.
- The Grok Bot writes the result to the outbox file via local execution and renames it; grokbot‑read polls the file until stable.
- Read bot chat from the local cache if needed.
- Configure new bots or routines by driving the desktop app’s UI over a localhost debug port (rare, requires human approval).
Доказательства
Grok Bot is xAI's desktop app for AI "bots": named teammates that share one persistent Linux computer in the cloud, with a browser, a terminal, and your logins, and that keep working after you close the lid.
The only documented way for your own code to start a bot run is a routine's Webhook trigger: an HTTP POST with a bearer key and an optional JSON body.
The bot writes its result to a file on my PC through the app's local execution, and Claude polls for the file.
I named the bot Relay and its routine Claude inbox. The routine's instruction is the bot's standing rule for every webhook run, so it is where your safety posture lives.
- Дата записи: 2026-10-08T05:55:48.455Z