Work/2026
Resume Claude · Cursor · Codex in Pi
pi-resume-harness
Creator · Open source·Case study
Problem
Switching coding agents mid-task usually means losing the thread. Grok Build can resume a Cursor session with /resume-cursor, but Pi had no equivalent—context died at the harness boundary.
Approach
Built pi-resume-harness as a native TypeScript Pi package. Readers scan Claude Code, Cursor, and Codex session stores; a searchable picker resolves latest / id / keyword; strict project-cwd matching keeps $HOME from swallowing every project; and an inert-history handoff prompt makes the model summarize and verify before continuing.
What was unique
Not a live restore and no Python. Foreign transcripts are treated as untrusted inert history—tool calls stay marked inert, and the handoff forces a verify-first continuation.
Outcome
Published to npm and the pi.dev gallery. Installed with pi install npm:pi-resume-harness; powers cross-harness handoff across Claude Code, Cursor, and Codex.
- Published on npm and pi.dev/packages
- Resume Claude Code, Cursor, and Codex sessions inside Pi
- Strict project-cwd matching—$HOME never swallows every project
- Inert handoff, not a live restore; zero Python dependencies
Process
01
Port Grok's resume flow
Mapped Grok Build's /resume-<harness> behavior—scan the store, resolve latest/id/keyword, inject a handoff prompt—and kept the same safety boundary.
02
Write native readers
Built TypeScript readers for Claude Code JSONL, Cursor agent-transcripts, and Codex rollouts—offline, no Python, with strict project-cwd matching.
03
Ship as a package
Published to npm with the pi-package keyword so it surfaces in the pi.dev gallery, and kept the whole thing reviewable as open source.
Stack
- TypeScript
- Node.js
- Pi
- npm