Py’otrMuhammad Toheed Sahar

handoff: Move an AI Coding Session Between Tools

I built a zero-dependency Node CLI that carries a coding conversation from Claude Code to Codex, OpenCode or Cursor, so the next tool already knows what you were doing.

Client
Own project
Year
2026
Type
Developer tools

The problem

Developers now switch between AI coding tools, and each switch throws away the context. The new tool has no idea what the last one spent an hour working out, so you paste, summarise and repeat yourself.

How I built it

handoff reads the session files each tool already writes to disk, converts them into one shared JSONL format (who said what, when, with tool calls flattened into readable markers) and can write that history back into another tool's native format. Each tool is a small adapter file, so adding one means adding one file. Everything stays on the machine: no account, no API key, no server and no dependencies.

What got hard

  1. Cursor keeps its chat history in a SQLite database, which is why most tools skip it.

    I read it through Node's built-in node:sqlite module so the project stays zero-dependency, and the adapter returns empty results on older Node versions instead of crashing. Write-back into Cursor is left on the roadmap because Cursor owns a live database.

  2. Four tools write four different session formats, and they have no shared idea of a tool call.

    Every message becomes one line in a canonical envelope. The limit is stated plainly: text history transfers fully, tool-call details flatten to markers such as [ran Read on foo.py], and the new tool does not re-run the old tool's actions.

  3. Proving the Cursor reader works without shipping anyone's real chat database.

    A test builds a throwaway SQLite database with sample rows and checks that only the real messages come through, with roles and text intact. A CI workflow runs it.

The result

Read and write adapters for Claude Code, Codex and OpenCode, a read-only adapter for Cursor, five commands (init, sync, list, status, handoff), a smoke test, a Cursor test and a CI workflow, built between a first spec file at 13:23 and the last commit at 14:40 on 22 August 2026.