Who it is forA developer building a script or CI step that needs to start or continue agent work on a local machine.
The problemStarting agent work by hand in the GUI does not fit repeatable scripts or pipelines.
The outcomeA script that lists existing sessions and posts a new turn to a chosen session.
What you need first
- Grok Build CLI (grok) version 0.2.112 or newer, installed and signed in, or an API key or custom relay configured in the app
- A project folder you are willing to let the agent work in
- Git installed if you plan to use Git worktrees or Git diff review
Steps
- Launch Grok App and keep it running on the machine that hosts the sessions.
- List the existing sessions with a GET request to the loopback endpoint
GET /v1/sessions. - Pick a session identifier from the response.
- Send a new prompt with a POST request to
POST /v1/sessions/{id}/turns, replacing {id} with the chosen identifier. - Check the session in the desktop timeline to confirm the turn arrived.
Prompt for your agent
Using the Grok App repo (https://github.com/RongleCat/grok-app), call the loopback session API to list sessions and post one turn to session <session-id> with the prompt <prompt-text>. Expected output: a successful response and a new turn in that session's timeline. Verify the session identifier against the GET /v1/sessions response before posting.
Caveat. The README names the two endpoints but does not document request or response bodies, port numbers, or authentication, so check the app for those details before relying on them.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for RongleCat/grok-app and "Script agent sessions through the loopback REST API"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer