Sesh moves a coding-agent conversation from Codex to Claude Code, or back. It reads the source harness’s session file, converts it through the canonical messages format, and writes a new native session that the other harness can resume. Use it when you want to stop in one agent and carry on in the other without retelling the conversation. Conversion runs locally: no model call and no dough account.
Where it lives
Sesh isn’t in the dough repo yet. It’s in dough-quiver (
techsavvyash/dough-quiver): the SDK inpackages/sesh, the CLI inpackages/sesh-cliand the Herdr plugin inplugins/herdr-sesh. Its releases are published from the privatetechsavvyash/clankerrepo. This page describes the code as it is in dough-quiver.
There are three pieces:
| Package | What it is |
|---|---|
@techsavvyash/sesh | The SDK. Every function takes options and returns data or throws SeshError |
@techsavvyash/sesh-cli | The sesh command, a thin client of the SDK |
herdr-sesh | A Herdr plugin that does the handoff from a pane |
The SDK doesn’t read argv, print, prompt, launch an agent or call a model. It’s ESM with TypeScript types, needs Node 24 or later, and has no runtime dependencies: the messages adapters are bundled into it.
Install
Neither package is on npm yet. Inside dough-quiver, depend on the SDK as a workspace package:
"dependencies": { "@techsavvyash/sesh": "workspace:*" }To install the CLI, see the CLI page.
Example
Hand the latest Codex session in a project over to Claude Code:
import { findSession, prepareHandoff, writeHandoff } from "@techsavvyash/sesh";
const sourcePath = await findSession({ harness: "codex", cwd: "/path/to/project" });
const handoff = await prepareHandoff({ from: "codex", to: "claude", sourcePath });
console.log(handoff.report); // what was dropped or truncated, before anything is written
await writeHandoff(handoff); // a new Claude Code session file; the Codex rollout is untouched
// Launching is yours: spawn(handoff.resume.bin, handoff.resume.args, { cwd: handoff.cwd })handoff.resume is { bin: "claude", args: ["--resume", <sessionId>], cwd }. For Codex it’s codex resume <sessionId>.
Hand off
findSession({ harness, cwd, all?, path?, id? }): resolves one session file. An explicitpathwins, and is only checked for readability. Anidmust match exactly one discovered session, with no “latest” fallback. With neither, it returns the most recent session forcwd(every directory withall).convertSession({ from, to, text, sourcePath?, cwd?, turns?, allowIncomplete? }): converts session JSONL in memory and returns aPreparedHandoff. It doesn’t write, launch or log.cwdreplaces the recorded working directory, for example when you restore on another machine.turnskeeps only the last N turns.allowIncompletelets a tool call with no result through, with an explicit placeholder result. Without it, an unanswered tool call is anincomplete-sessionerror. The tool is never run again.
prepareHandoff({ from, to, sourcePath, ... }): reads one file, then does whatconvertSessiondoes.writeHandoff(handoff, file?): writes the session tohandoff.sessionFile(orfile). It creates the file owner-only (0600) and refuses to overwrite one that exists.
A PreparedHandoff carries source, target, sessionId, sessionFile, cwd, the native lines, messageCount, recordCount, estimatedTokens, resume, and a report with dropped, notes, truncatedMessages, droppedOrphanResults and incomplete.
Claude Code sessions go under $CLAUDE_CONFIG_DIR (default ~/.claude) in projects/, and Codex rollouts under $CODEX_HOME/sessions (default ~/.codex/sessions).
Pull back
After a handoff, the other harness adds its own turns. A pull merges them into a copy of the session you started from:
import { preparePull, writePull } from "@techsavvyash/sesh";
const pull = await preparePull({ from: "codex", cwd: "/path/to/project" });
await writePull(pull); // a new copy of the original session; the original is untouchedpreparePull({ cwd, from?, path?, all?, merge? }): finds the session a handoff produced (or takespath), takes the turns added since, and merges them.fromis"codex"(the default) or"claude".- Finding the original: the emitted session carries a
seshlink to its source and the number of lines sesh wrote (emittedLines). A session without the link fails withnot-linked. One with nothing new fails withnothing-to-pull. merge:"raw"(the default) keeps the original session’s lines byte for byte, reasoning included, and appends the new turns."canonical"re-emits the whole merged session from canonical messages and drops the original’s reasoning.writePull(pull): writes the merged copy, owner-only, never over an existing file.
PreparedPull has source, target, merge, sessionPath, originalPath, newLines, messageCount, filtered (Codex context envelopes removed from the pulled turns), sessionId, sessionFile, lines, report and resume.
Errors
Everything the SDK raises on purpose is a SeshError. Its code is stable, and its message is for people:
unknown-harness, invalid-options, invalid-session, incomplete-session, unreadable, session-not-found, ambiguous-session, not-linked, nothing-to-pull, unsupported.
Harnesses
A Harness is one agent CLI. As a source, it discovers its session files (discover) and parses one into a canonical Thread and Message[] (parse). As a target, it emits canonical messages as a native session (emit) and says how to resume it (bin, resumeArgs). emitAppend is optional, and the raw pull mode needs it.
Two are built in and registered on import: claudeHarness (id claude-code, alias claude) and codexHarness (id codex). registerHarness(harness) adds another, resolveHarness(name) looks one up by id or alias, and listHarnesses() lists them. A new harness implements the interface and registers itself. The CLI’s sesh to <harness> works with it without changes.
Limits
- What carries over: visible conversation and supported tool history. Hidden reasoning, native compaction state, running processes and unfinished side effects can’t be recreated. The report lists what was dropped or changed.
- What doesn’t: workspace files, dependencies, credentials, tool installs and permissions.
cwdchanges the recorded directory, not its contents. - One writer at a time: stop the source agent before a handoff. Each handoff makes a new session and leaves the source as it was. Handing off again makes another branch. Sesh doesn’t keep two live sessions in sync.
- Size: a long history can exceed the destination model’s context.
estimatedTokensis an estimate.
Related packages
- Messages: sesh’s adapters are the messages package’s Claude Code and Codex adapters. Sesh builds against the copy in dough-quiver,
packages/messages, which is the package dough has since ported as@techsavvyash/messages. Thelinkemit option exists for sesh’s pull. - Threads: both move conversations between harnesses. Threads cuts a new thread with a seed you choose. Sesh carries the whole native transcript across as a resumable session.
- Bus and Pad: not used.