# OrcaReplay

> Record a coding agent's run, replay it offline byte-for-byte, then fork it from any step onto another model

- Category: Evaluation & Production Ops / Observability & LLMOps
- Language: TypeScript
- Licence: Apache-2.0 (code); trace spec CC BY 4.0
- Repository: https://github.com/Continuum-AI-Corp/OrcaReplay
- Website: https://www.orcarouter.ai
- Canonical page: https://ai-tldr.dev/tools/orcareplay/

## In short

OrcaReplay is an Apache-2.0 command-line debugger for AI agents from the team behind the OrcaRouter model gateway. It sits in the Observability & LLMOps category of the Evaluation & Production Ops tools and is open-source, written in TypeScript and licensed Apache-2.0 (code); trace spec CC BY 4.0. To get started: install the CLI and check your setup.

## Overview

OrcaReplay is an Apache-2.0 command-line debugger for AI agents from the team behind the OrcaRouter model gateway. It records a run of an unmodified agent — Claude Code, Codex CLI, the OpenAI Agents SDK, LangGraph, CrewAI, Aider, goose and others — and turns it into a file you can replay exactly, with the network blocked and no model called, as many times as you like. The npm package is `orcareplay`; the command it installs is `orca`.

Capture happens below the agent rather than through an SDK wrapper. Because model APIs are stateless and every turn resends the whole conversation, a local proxy set through the agent's base-URL environment variable sees the entire loop. Alongside it, a PATH shim records shell commands with exit codes and timing, a JSON-RPC tee records MCP calls, a shadow git index snapshots the workspace each turn, and a fetch hook or an opt-in per-run TLS intercept covers agents whose model origin cannot be redirected. Everything lands in one timeline under `.orca/runs/` in the project, stored with mode 0600 and with secrets redacted on write.

Replay, fork and compare are the same proxy with a cursor: up to the cursor it answers from the recording, after it from the network. `orca replay last --from 4 --model X` keeps the first four turns and the files identical and lets a different model take over, and `orca compare` forks one run onto several models and grades each with a command such as `npm test`. On top of that come a causal graph of what produced what (marking which edges were recorded and which were inferred), a self-contained HTML timeline viewer, shareable cards and an MCP server so an agent can inspect its own runs. The README describes the project as early, at trace format v0.

## What it does

- Records unmodified agents through base-URL environment variables, with adapters for Claude Code, Codex CLI, opencode, goose, grok-cli and OpenClaw and a generic OpenAI-compatible mode for SDK-based agents
- Exact offline replay with divergence reporting — no network, no tokens — restoring the recorded filesystem over the working tree or into a scratch worktree
- Fork from any derived checkpoint onto a different model, and `orca compare` to run several models from the same state and grade them with your own verify command
- Captures what the model transcript cannot show: shell commands with exit codes, file changes per turn, MCP calls and, opt-in, non-model network traffic
- `orca show` and `orca graph` in the terminal, a single-file HTML timeline viewer, and SVG/PNG/GIF cards of a failing causal chain or a comparison table
- Local traces with deny-by-default environment capture, auth headers never written, key-shaped and high-entropy strings redacted, plus `orca scrub` after the fact

## Getting started

OrcaReplay needs Node.js 20 or newer and has no native dependencies. The commands are from the project README.

1. Install the CLI and check your setup

   The package is `orcareplay`; it puts one command, `orca`, on your PATH. `orca doctor` checks Node, git and which agents it can find.

```bash
npm i -g orcareplay
orca doctor
```

2. Try it without an agent or API key

   `orca quickstart` writes a small project with a real bug and a recording of an agent fixing it, then replays the recording against the project with no model called.

```bash
orca quickstart
```

3. Record a real run, then replay it offline

   Run your agent through `orca record`; nothing is installed into the agent. `orca replay last` serves the same run again from the recording with the network blocked.

```bash
orca record claude
orca replay last
orca show last
```

4. Fork from a checkpoint onto another model

   Keep the files and conversation up to checkpoint 4, let a different model take over, and open the timeline viewer. `orca setup` stores a gateway, key and model list for comparisons; any OpenAI-compatible endpoint works, OrcaRouter is only the suggested default.

```bash
orca replay last --from 4 --model claude-haiku-4-5 --ui
orca compare last --from 4 --models claude-sonnet-5,claude-haiku-4-5 --verify "npm test"
```

5. Share the evidence

   Export the run as one self-contained HTML file, or draw the causal chain behind a failure as a card for an issue (PNG and GIF need the optional render toolchain).

```bash
orca export last -o bug.html
orca export last --card bug.svg
```

## When to use it

- Finding out which tool call deleted a file or why an agent exited 0 while its own check failed, from a recording instead of a re-run that behaves differently
- Asking whether a cheaper model would have got the same task right, by forking the recorded run at the same checkpoint and grading both with the test suite
- Attaching a reproducible, offline HTML replay of an agent failure to a bug report
- Recording an agent built on LangGraph, CrewAI, Haystack or the OpenAI Agents SDK without changing its code
