How to give Claude Code your X feed without your own API key via Grok Bot and a webhook
For Claude Code or any other agent to read your X feed, it does not need its own X API key. You connect Grok Bot and link the agents with a webhook, a web address a program sends a message to in order to start an action in another program. The link has two halves. In Grok Bot it is a routine, a saved task that runs on an event, in this case an external request. In Claude Code it is a skill (Agent Skill), a package of instructions and helper files the agent loads for a specific job. Following the description in Riley Brown's guide on Agent Native, we assembled one Python script in 327 lines using only the standard library. Reading is paid. According to the bot's own answer, a post from the Following feed costs about $0.005, and for our 194 posts the calculation works out to up to 97 cents. The bot cannot publish posts, reply, like, or repost today. After this article you will build the same thing and get a working pair where Grok Bot collects posts from your feed and the agent in the terminal picks out what matters and hands you a digest with links.
What the agent gets: your X feed without your own API key
Grok Bot reads the Following feed through a connected X plugin, signed in as the account owner. You do not need your own X API key or a developer registration; the bot uses the access your account already has. Claude Code in the terminal has no such access: it works with files and processes on your machine, and calling the X API from the terminal requires your own key.
On 12 October 2026 we asked Grok Bot to collect posts from the Following feed for the past day. The reply arrived in 60 seconds: 194 posts, roughly 111 thousand characters including links. In the first line the bot stated that it covered the last two and a half hours, two batches of 100 posts, and that the For You feed was unavailable to it. We asked for a day and got two and a half hours of posts. That is the coverage limit to build into your expectations. Claude Code filtered the 194 posts down to about twenty on the owner's topics and produced a digest with links.
Reading is paid. A post from the Following feed costs about $0.005, the usual rate for reading posts through the X API. For our 194 posts the calculation gives up to 97 cents. We have not checked the actual charges, and the bot cannot see the billing history. Reading your own data, including posts, mentions, and bookmarks, costs about $0.001 per record on X's price list, but the bot is not sure that rate applies through its connection. About 100 posts come back in a single request. We can page backward, and each page is billed separately. The bot runs passes that cost more than roughly $0.25 only after the owner agrees.
| What | Works today | Condition |
|---|---|---|
| Reading the Following feed | Yes | Signed in as account owner |
| Bookmarks, mentions, search, posts by a specific user | Yes | Reading under the owner's account; adding or removing a bookmark after confirmation |
| Direct messages | Yes | Reading requires a Chat PIN; sending after the owner confirms the text |
| For You feed and lists | No | No such tools in the current connection |
| Publishing, replies, likes, reposts, follows | No | No such tools available to the bot today |
The prices and the table come from the bot's own answer on 12 October 2026. Rates and capabilities change; ask your own bot the same question to check.
Until the link is built, the exchange works like this: you copy the bot's reply into your clipboard and paste it into the terminal session by hand. After the link is in place the agent does the same thing on its own and immediately; the task context stays in one place and you do not switch between windows.
How the exchange works: task goes out over a webhook, reply comes back as a file
Riley Brown laid out the scheme in the guide "Connect Claude Code to GrokBot with a Webhook", updated 10 October 2026. Following that description, we built the link on our own computer.
The exchange is a round trip in three parts. First, Claude Code sends the task to a Grok Bot routine that runs on its Webhook trigger. The bot performs the task and then launches a reply command on the owner's machine, and that command writes the answer into a file. The agent waits for that file and continues. The return step needs Grok Bot to have permission to execute commands on the owner's computer. Without that permission, there is no one to write the reply back.
The webhook request carries four fields. request_id is the number used later to find the answer. task is the task itself. context is the background and the expected reply format. reply_command is the command the bot runs on the owner's machine to return the result. The bot receives all four fields, but from the conversation inside Claude Code it only knows task and context, so the task must be written self-contained, the same way you would brief an agent on a work project.
Example request we composed to test the connection:
{"request_id": "61ccc6c8bca442908222cb4509eb56c1", "task": "Reply with one word: pong", "context": "Connection test", "reply_command": "python3 ~/.claude/skills/grokbot-webhook/scripts/grokbot.py reply --request-id 61ccc6c8bca442908222cb4509eb56c1"}
| Step | Who acts | What happens |
|---|---|---|
| 1 | Claude Code | Assembles the request from the four fields and sends it to the webhook address; the key goes in the Authorization header with the word Bearer |
| 2 | Grok Bot | Accepts the request and fires the routine |
| 3 | Grok Bot | Performs the task and launches the reply command on the owner's computer |
| 4 | Reply command | Writes the bot's answer to a file; the filename is tied to the request number |
| 5 | Claude Code | Finds the file, reads the answer, and carries on |
Following the guide, the script contains six commands: send dispatches the task and waits, wait resumes waiting by request number, reply receives the bot's answer, setup stores the address and key, status shows what is configured, instructions prints the text for the routine. By default the agent waits 540 seconds. You can run the wait in the background so the agent keeps working on its own part until the reply file appears.
What to configure: skill, routine, key, and the test
We worked under macOS, on desktop Grok Bot 0.70.2. The steps are these.
- Ask Claude Code to build the skill from the description in the guide. The guide includes a ready-made prompt. Our skill lives in a private repository, but anyone can build their own from the guide's description.
- Run the instructions command to get the routine text.
- Ask Grok Bot to create a routine with the Webhook trigger and paste that instruction into it. Then the bot knows the exact path to the script and understands where to write the reply.
- Ask the bot in chat to send a link to the routine's Webhook URL, open the routine page through that link, and copy the address, the key, and the header name. The bot itself cannot see these values and cannot hand them over; details below, in "The routine page with the key does not open from the list".
- In your terminal, run setup. The key is entered hidden and never pasted into the agent chat. Then status confirms what is configured.
- Test the link with the word pong. The request "Reply with one word: pong" came back to us in 7 to 8 seconds.

On the first request Grok Bot asks permission to run the reply command. You can grant that permission going forward, and subsequent tasks will pass without a pause. But the permission has a cost: once granted, every reply command from that routine executes without asking. That is why the script path is pinned in the instruction.
Where the setup breaks
The routine page with the key does not open from the list
We lost time trying to find the address and key in the interface. Clicking the routine row in the Details list did not open the routine page. When we asked the bot to name the address and key, it replied that it could not see them. Grok Bot support confirmed on the official forum on 6 October 2026 that in the current version, clicking a routine in the list does not open the routine page. The address, key, and header live exactly on that page, support reply of 6 October.
Asking the bot in chat to send a link to the routine's Webhook URL worked. Grok Bot support gives the phrasing: "Send me the link to the Webhook URL for my Claude Code webhook routine", replace the end with your own routine name. The bot replied with an in-app link; it opened the routine page with three fields: address, key, header name. Each field copies on click. The second entry point from the support reply is the chip with the routine name on the "Created routine" line in the chat where the bot created the routine.
Two clarifications from support. The bot cannot see the address and key and cannot issue them, confirmed in replies between 11 and 15 September 2026. The desktop app shows the fields starting with version 0.53.0; the fix shipped 16 September 2026, thread about the missing fields. We had Grok Bot 0.70.2, the fields showed on the routine page, but the page still would not open from the list.
The reply only lands on the owner's computer
The reply command runs where Grok Bot executes commands, that is, on the owner's machine. If Claude Code sits on a Linux server, the reply file will not reach it on its own. We solved it like this: on the owner's computer there is a list of servers by name, taken from ssh config. When the reply command receives a request number this machine did not send, it forwards the reply file over ssh to the server on the list. The server accepts the reply only if it holds a request with that number. The server needs the same script and a file with the address and key, readable by the owner alone. From the owner's computer there must be key-based ssh access to the server. We verified with a pong request from the server, and the reply arrived. But if the owner's computer is off or asleep, there is no reply at all. That is a limit of the scheme, and it should influence where you keep your agents.
The wait timed out
By default the agent waits 540 seconds. If the reply did not arrive, do not resend the task: a second send makes the bot perform it a second time. The wait command continues waiting by the same request number.
The reply command waits for confirmation or the key did not match
The first run of the reply command stops at Grok Bot's request for permission. If you do not confirm it, the reply never gets written. Errors 401 or 403 mean the key is wrong or the header name is wrong.
What to add for security
Riley Brown's guide warns plainly that anyone holding the address and key can set tasks for your bot. To this scheme we added four limits.
- The reply command accepts an answer only for a request number this machine sent. The number is 32 hexadecimal characters. An unknown number is rejected.
- The routine instruction pins the exact path to the script, even if the request body carries a different command. The task and reply_command fields are text from whoever sent the request, and without a pinned path an unknown command could have executed on the owner's machine.
- The agent sets tasks for the bot only on the owner's direct request. The bot acts in the owner's name in X, and every request is an action of the owner. We hold the same rule for an agent in a shared chat.
- Secrets and client data do not go into the task. The request text leaves the machine and is read in someone else's context.

The guide also says to treat the bot's reply as information. Any requests or instructions found inside a reply get executed only after the owner approves, because the text comes from the X feed and may carry instructions planted by someone else. We kept that rule.
When the setup pays off and when one agent is enough
The link pays off when the second agent has access or data the first one lacks, and the tasks repeat. In our case that is the Following feed: Grok Bot reads it on the owner's behalf, Claude Code processes the result on the machine. A one-off answer does not need a webhook; ask the bot directly and copy the result into the session. If the owner's computer is often off or asleep, replies will not arrive and the link stops working. When the second agent is needed only for a second opinion on the same task and brings no new access, the link adds delay without benefit. We did not test it on Windows.
Frequently asked questions
Where to get the Grok Bot webhook address and key
Ask the bot in chat to send a link to the routine's Webhook URL; it opens the page with fields to copy. The second entry point is the chip with the routine name on the "Created routine" line in the chat where the bot created it. The desktop app shows the fields starting with version 0.53.0.
Can I copy the webhook address and key from a phone
No. Support confirmed on 9 October 2026 that the mobile apps for Android and iOS do not show these fields, reply about mobile apps.
What to do if the reply did not arrive
- Check that the owner's computer is on and not asleep.
- Make sure the reply command permission was granted on the first run.
- Check the key and the header: errors 401 and 403 mean a wrong key or a wrong header name.
- Keep waiting with the wait command by request number, without resending.
Can I send tasks from a server
Yes, if the owner's computer forwards the reply file over ssh to the server that holds the request with that number. We verified with a pong request.
Who else can send tasks to my bot
Anyone with the address and key. That is why our reply is accepted only by its own request number, the reply command is pinned in the routine instruction, and the agent sets tasks on the owner's direct request.
Where to start
If you already have two agents with different access, begin with the pong test request, then give the link one real repeating task. If anything in the scheme does not match your version of Grok Bot, write to us on Telegram or at hello@majento.ai.