Connect Claude Code to a Grok Bot with a webhook
Give Claude Code a skill that sends research questions to a Grok Bot routine, so a building session can pull in current X posts before it writes.
Explain it simply
Claude Code builds things on your computer, and a Grok Bot can search X. A webhook is a private web address that starts a Bot routine when something sends it a message. This guide connects the two so Claude Code can ask the Bot for research in the middle of a task.
What you need
- Claude Code installed and working.
- A Grok Bot you are happy to let search X.
- Somewhere both can read and write, such as a Google Doc or a GitHub issue, to pass the answer back.
One person replying to the demo said they set it up in about 30 minutes.
Steps
Create a webhook routine in Grok Bot
Ask your Bot to create a routine that starts from a webhook. It gets its own webhook URL and key.
Whatever is sent to the webhook reaches the Bot as the request body, so the message can carry the question.
Tell the routine what to do with each question
Write the routine’s instructions so every answer lands in the same place, in the same shape.
PromptWritten by our editors from the sources When this routine starts, read the question in the request body. Search X for the most relevant posts from the last 7 days. Write the 10 best links, each with a one-line summary, plus a 5-line overview, to [doc or issue]. Never invent posts or quotes. If you find little, say so.Write the Claude Code skill
Create a skill file, for example .claude/skills/grokbot-research/SKILL.md, that tells Claude Code when to call the webhook and where to wait for the answer.
PromptWritten by our editors from the sources --- name: grokbot-research description: Use when the task needs current posts or discussion from X. --- 1. Send the question to the Grok Bot routine's webhook URL, with its webhook key. 2. Wait for the answer at [doc / issue the routine writes to]. If nothing arrives within 10 minutes, carry on without it and say so. 3. Cite the post links you use. Never invent posts or quotes.Keep the URL and key secret
Anyone with the webhook URL and key can start the routine. Store them as environment variables, not in the skill file or a shared repository.
Test it with one real task
Try: find the most-discussed X posts this week about [your niche], then draft a landing-page section that answers the top objections.
Open the cited posts yourself before you publish anything built on them.
How to know it worked
- The Bot's answer appears where the skill expects it.
- Every cited post opens and says what the summary claims.
Watch-outs
- Agent Native's full guide is behind a sign-in; these steps are assembled from Grok Bot's documented webhook routines.
- Several people argue the reverse works better: Grok Bot coordinating and Claude Code building.
See real examples
The use cases this guide is built from:
Steps are written by our editors from the sources above. Test on low-risk work first. Spotted a mistake? Suggest a correction.