Skip to main content

Grok Bot handed a headless claude -p task to Claude Code and the reply came back clean

XXEric Starr | Founder, SoundMinds2026-11-26

Code and reposLimitsSource read in fullRead first

Overview

The author, a software engineer, wanted Grok Bot to hand tasks to Claude Code; with no built-in chat bridge between the tools, the setup ran the headless claude -p command on the Bot's persistent cloud computer and brought the output back into the chat.

Workflow

  1. Trigger: Hand a task from Grok Bot to Claude Code and bring the output back into chat. The author states there is no built-in chat bridge between Grok Bot, Claude Code, and Codex, so the handoff happens through files and CLI commands on the Bot's persistent cloud computer.
  2. By hand: Confirm the non-interactive invocation in the docs. The author checked Anthropic's Run Claude Code programmatically page, which says to pass -p with the prompt and the CLI options needed to run Claude Code in non-interactive mode.
  3. Bot: Run the headless prompt on the cloud computer. The author's method is to ask the Bot to run claude -p with the prompt, pass any larger input as a workspace file rather than piping it, and have the output returned or saved to a file. Auto Review checks commands before they run, so some steps wait for the author's approval.
  4. By hand: Pick the matching command for Codex. The author points to OpenAI's Non-interactive mode page, where the matching command is codex exec, which prints the final message to stdout and runs in a read-only sandbox by default. Codex is not installed on the Bot's computer, and the author has not tested it there.
  5. Check: The author tested a one-line headless Claude Code prompt on the Bot's computer, and it completed and returned the reply cleanly (author's claim, not reproduced). Piping a file straight into a redirect and running Claude Code inside a scheduled routine were not tested, and the post text does not include the command or its output.

Key points and results

  • The one-line handoff round-tripped cleanly. The author tested a one-line headless Claude Code prompt on the Bot's cloud computer, and it completed and returned the reply cleanly (author's claim, not reproduced).
  • The handoff is task-level only. It hands off a specific task and collects the result; it does not export full chat history, skills, or memory from one tool into another.
  • The untested edges are explicit. The author has not tested piping a file straight into a redirect or running Claude Code inside a scheduled routine, and Codex is not installed on the Bot's computer, so codex exec was not tested there.
  • Automate only after the one-time handoff works. The author's advice is to get the one-time handoff working first before automating it.
  • The paste-in instructions are not in the post body. The author says the handoff flowchart, the paste-in instructions, and every cited source are in the first reply of the X post.

Source

Platform
X
Author
Eric Starr | Founder, SoundMinds
Published
Categories
Code and repos, Limits

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.