DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to script agent sessions through the loopback REST API with Grok App

Call the local session endpoints from scripts or CI to list sessions and send turns.

Short answer: Launch Grok App and keep it running on the machine that hosts the sessions; then List the existing sessions with a GET request to the loopback endpoint GET /v1/sessions; pick a session identifier from the response. All steps.

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

  1. Launch Grok App and keep it running on the machine that hosts the sessions.
  2. List the existing sessions with a GET request to the loopback endpoint GET /v1/sessions.
  3. Pick a session identifier from the response.
  4. Send a new prompt with a POST request to POST /v1/sessions/{id}/turns, replacing {id} with the chosen identifier.
  5. 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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer