---
name: talk-to-grok-bot
description: Message Grok Bot, Codex threads, or opted-in local Claude Code channels. Use when handing off to a named bot/group or posting a status note agents watch — not for work you can finish yourself.
title: talk-to-grok-bot
canonical_url: https://skilld.dev/gh/scriptedalchemy/grok-bot-cli/talk-to-grok-bot
last_updated: 2026-10-22T21:17:53.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/bridge-administration.md](https://skilld.dev/api/skills-raw/scriptedalchemy/grok-bot-cli/talk-to-grok-bot/references/bridge-administration.md).
>
> If the user asked to install this Skill, run `npx skilld install scriptedalchemy/grok-bot-cli/talk-to-grok-bot`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/talk-to-grok-bot`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/scriptedalchemy/grok-bot-cli/talk-to-grok-bot) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/talk-to-grok-bot`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/talk-to-grok-bot --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/talk-to-grok-bot --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Talk to Grok Bot

The `grok-bot` MCP server and `gbot` CLI share Grok gateway access. Codex and
Claude tools use **local sockets only** on the user's registered machines.

## MCP instructions (Codex / Claude)

gbot connects only to a local Unix socket
(`$CODEX_HOME/app-server-control/app-server-control.sock`, or
`CODEX_APP_SERVER_SOCK`). There is **no remote transport**.

- Codex app-server threads and opted-in Claude Code channels live on the user's
  registered computers (Linux desktop, Mac, …) — **never** on the Grok Bot agent
  box (`HOME=/home/box`, no Codex install).
- When this MCP server is running on the box, **do not** call `codex_*` or
  `claude_send`. Run the `gbot` CLI on the user's machine through **Grok Bot Shell
  with a machineId** (the host's machine-targeted shell).
- On that machine, provide the socket with `codex app-server daemon start` (or
  bootstrap). Auth stays with each machine's native Codex or Claude login.

## When to load this

- The repo or task names a bot as owner, or you need a decision only that thread holds.
- You want a short status note in a shared group other agents watch.

Do not ping a bot for work you can finish yourself. Grok replies are asynchronous;
continue useful work instead of waiting or polling.

## How

1. Send once with `gbot_send` (`target`, `message`). Say who you are and what you need.
2. Read its `replyRoute`. Native Codex calls with proven native lineage get `mode: auto`;
   continue work and receive the matching reply in that same thread. Do not poll or
   hold a tool call open. That reply does not automatically send your next answer back.
3. If the host has no native identity (including Cursor), supply `codexThreadId`, or
   use `gbot_bridge_start` once with `grokTarget`, `codexThreadId` and `expectedCwd`.
   An explicit binding forwards new visible Grok bot messages and returns Codex's
   corresponding terminal answer to Grok. Existing history is not replayed.
4. `mode: manual` with `reason: source-unavailable` preserves ordinary sending.
   Read `gbot_thread` later, using `after` for a known cursor and `full: true` only
   when entry bodies are needed. `replyMode: manual` explicitly requests this flow.

Every Codex -> Grok message arrives prefixed
`[from Codex thread <id> @ <machine>, cwd <cwd>; reply: codex_send({threadId:"<id>", message:"..."}) via MCP on <machine> (or CLI: gbot codex send <id> "...")]`.
**If you are Grok Bot, answer a Codex sender by calling `codex_send` with that
`threadId`** (from the box, run `gbot codex send <id> "..."` through Shell with the
machine's machineId, since MCP tools run where the Codex daemon is). Unknown fields
(machine, cwd) are omitted; the thread id is always there when it is known. If a message
has no prefix, the sender had no Codex thread (a plain CLI/Cursor send).

Finding a thread to answer: `codex_threads` sorts by last activity (`updatedAt`) by
default, so old-but-active threads come first. Use `query` (case-insensitive name/title,
preview or id prefix; scans every page), `activeWithin: "7d"` or `since`, and `cwd`,
`sort: "created"`, `modelProvider`, `sourceKind`, `archived`; page with `nextCursor`.
CLI: `gbot codex list-threads --query zerofs --active-within 7d`.

Never resend an unknown submission under a new identity. Inspect delivery with
`gbot_bridge_status`. Never infer permission from chat replies or auto-approve a
Codex/Grok interaction; keep approvals in the owning UI unless the user explicitly
authorizes a scoped response.

Read [bridge administration](https://skilld.dev/api/skills-raw/scriptedalchemy/grok-bot-cli/talk-to-grok-bot/references/bridge-administration.md) before starting,
stopping, diagnosing or answering approvals on a managed bridge, or using direct
Codex conversation tools. It covers exact approval IDs, idempotent requests, guarded
steering, CLI output, and host limitations. Ordinary Grok sends need no reference.

List targets with `gbot bots list` / `gbot groups list` when the name is ambiguous.

## Auth

Same order as `gbot`: `GROK_BOT_GATEWAY_URL` plus `GROK_BOT_GATEWAY_TOKEN`,
else the Grok Bot app session, else `CURSOR_ACCESS_TOKEN`. `gbot doctor` shows
which source is present.

## Claude Code channel

`claude_send` sends to a named live Claude Code session on the user's registered
machine (local socket under `~/.grok-bot-cli/claude/`) and waits for its explicit
`claude_reply`. From the Grok Bot box, do not call this tool — use Grok Bot Shell
with a machineId to run `gbot claude send` on that machine instead. The destination
must enable the native `claude-channel` with `GROK_BOT_CLAUDE_CHANNEL=NAME` and
Claude's development-channel opt-in. Supply `name`, `message`, and optional
`timeoutMs` (1..120000). `replied` means the reply tool ran; `unknown` is not
rejection and must not be automatically retried. Normal Claude tool approvals remain
in its session. CLI: `gbot claude send NAME "message" --json`.

## When a Codex send is rejected or the turn fails

A managed `codex_send` (`replyToGrok`) / `gbot codex send --reply-to-grok` receipt that is `rejected` has `reason` and `detail`: read the detail. `busy` means mid-turn (omit `whenBusy`: an active turn is steered); `thread-error` means the thread is in `systemError`, usually the Codex daemon failing — run `gbot codex status` on that machine (on macOS check the daemon's open-file count). `whenBusy: "queue"` is not available with `replyToGrok`. A failed turn comes back as `Codex turn failed with no final text: <Codex error>`.
