Vercel's durable-harness: crash-resume for Claude Code, Codex, Pi and OpenCode

An experimental open-source library that logs every model and tool call so cloud coding agents resume after a crash. For teams running harnesses 24/7.

Picture a two-person agency that runs Claude Code on a cloud VM so it can work through client tickets overnight. One job asks the agent to add a pricing page, open a pull request and wait for CI. Partway through the CI wait, the process dies: a timeout, an out-of-memory kill, a redeploy. In the morning someone notices and prompts the agent again. It re-reads files, re-calls the model and redoes work it had already finished. If the last step it was on was posting a PR comment, there may now be two. Nobody can say exactly which calls completed.

That is the failure Vercel describes in its announcement of durable-harness. A VM with persistent storage can host a harness, Vercel writes, but it "doesn't automatically record which model and tool calls completed or resume interrupted turns after a crash." durable-harness is a set of open-source adapters that write every step of a turn to a durable log, so a new process can pick the turn up where the old one died. It covers Pi, OpenCode, Codex and Claude Code, and runs on Vercel, on your own Postgres, or on your laptop. It is also explicitly experimental.

What it is

According to Vercel's post, durable-harness keeps a harness's session in a "World", the Workflow SDK's durable backend. Mapped to the pain above:

The repo README describes each session as a workflow run whose conversation, in-flight turn and every model and tool call sit in the run's event log. Piagent's resource entry (updated Oct 19, 2026) repeats that description and lists the project at 151 GitHub stars, 8 forks and an Apache-2.0 license.

Alternatives the sources describe:

The sources don't compare durable-harness with other durable-execution engines, so we won't.

Who it's for

Pick it up if you run a TypeScript and Next.js stack, keep Pi, OpenCode, Claude Code or Codex running unattended in the cloud, and have already lost turns to timeouts or crashes. It also fits builders of harness products. Vercel's post names OpenWork and HanaAgent as apps built on open-source harnesses. Teams already on Vercel get the most out of it, since managed storage, queuing and Agent Runs come with deployment, per the README.

Skip it if you need a stable API, if you want Claude Code or Codex entirely off Vercel infrastructure, or if your agents run interactively on a laptop. Vercel's own post notes that locally, resuming interrupted work "only requires a simple prompt." Non-Node stacks should wait too. A community proposal for a Python-based adapter is still asking maintainers whether they accept a non-Node-native runtime.

Before and after

Before (harness on a VM):

  1. Start the harness in a long-lived process with the session in memory.
  2. The agent reads the page, writes a new one, opens a PR and waits for CI.
  3. The process dies mid-turn.
  4. Someone notices and restarts it manually.
  5. The agent repeats completed work. Side-effecting steps may run twice, and finished model calls get paid for again.

After (same harness through durable-harness):

  1. Run the harness through its adapter, with your tools tagged 'safe' or 'never'.
  2. Each model and tool call logs an intent, then an outcome.
  3. The function dies. The queue hands the turn to a new function.
  4. The new function reads the log. Completed calls aren't rerun, safe tools run again, and never-tools go back to the model as "possibly run."
  5. If you're on Vercel, Agent Runs shows where the turn stopped and resumed.

Try it

The README's quickstart pairs Pi with pi-durable in a Next.js app:

npm install durable-harness @earendil-works/pi-durable @earendil-works/chord @earendil-works/pi-ai just-bash

You then open Pi's durable Harness in lib/agent.ts, serve it from a chat route, and wrap your Next.js config:

// next.config.ts
import type { NextConfig } from 'next';
import { withDurableHarness } from 'durable-harness/next';

const nextConfig: NextConfig = {
  // your existing config
};

export default withDurableHarness(nextConfig);

Local development uses the Workflow SDK's local World with no configuration, per the README. To self-host on Postgres, Vercel's post says two variables move every agent:

WORKFLOW_TARGET_WORLD="@workflow/world-postgres"
WORKFLOW_POSTGRES_URL="postgres://user:password@host:5432/database"

The other harnesses have their own entry points: durable-harness/opencode, durable-harness/fx, durable-harness/claude-code and durable-harness/codex. Per Vercel, Claude Code's and Codex's built-in tools work on the session's Drive once you set builtins: true. Agents are tool-less by default, according to the README.

One setup tip from the issue tracker: list your agent modules explicitly instead of relying on default discovery (see below). None of the sources cover pricing for running on Vercel.

Where it breaks

Who picks this: a Node shop already running Pi, OpenCode, Claude Code or Codex unattended, ideally on Vercel, that will tolerate beta churn in exchange for turn-level resume. Who skips it: anyone needing a stable API, a non-Vercel home for Claude Code or Codex, or a cost estimate before committing.

Sources