spool icon indicating copy to clipboard operation
spool copied to clipboard

Support xAI Grok CLI (Grok Build) as a session provider

Open rennzhang opened this issue 3 months ago • 0 comments

What problem does this solve?

Grok Build (grok, xai-org/grok-build) is xAI's open-source terminal coding agent. Spool currently prepares and reads sessions from Claude Code, Codex CLI, Gemini CLI, OpenCode, and Pi — but not Grok Build.

Heavy Grok Build users accumulate a large local session history (in my case ~3 GB under ~/.grok/sessions/) that Spool cannot index, organize, or read. Since Spool's local preparation already covers five agents, Grok Build is the most notable gap: several community tools (agent-hop, claudescope, seshport) have already added parsers for this format, which suggests real demand.

What would the solution look like?

A new parser in packages/core/src/parsers/grok.ts, following the existing per-provider parser pattern. The on-disk format is simple and stable:

  • Sessions live at ~/.grok/sessions/<url-encoded-cwd>/<session-uuid>/
  • chat_history.jsonl — one JSON record per message: {type, content}
  • summary.json — session metadata: agent_name, chat_format_version, created_at / updated_at / last_active_at, current_model_id, num_messages, session_summary, reasoning_effort, etc.
  • updates.jsonl — {method, params, timestamp} records carrying per-turn timestamps and token usage

Scope-wise, Link-only visibility (like Gemini CLI / OpenCode / Pi today) seems like the right starting point; native resume could follow later since Grok Build supports grok --resume <session-uuid>.

Prior art that may help: seshport PR #1 is a worked example of adding Grok Build support to a session tool; agent-hop and claudescope also ship parsers for this format.

I'm happy to contribute a PR for this if the direction sounds right.

rennzhang avatar Aug 21 '26 03:08 rennzhang