Skip to content
claudemods

Replay Theater Claude Code mod: a Claude Code diff viewer for the last turn

Step through the file edits of Claude's last turn, one diff at a time, in a pane opened with /replay.

#1 in Best Claude Code Mods

Permissions

  • Reads filesCan read files and list directories on your machine ($.fs.read / list / stat / exists).
  • Intercepts tool callsSees every tool call Claude makes (tool.call / tool.check) and could block or change it.
  • Changes the UIDraws into the Claude Code interface: bands, panes, status text, toasts (ui.render / $.ui.*).
  • Adds commands/toolsRegisters new slash commands or tools that you or Claude can invoke ($.command.register / $.tool.register).
tested with
v2.1.303
last tested
requires
Claude Code ≥ 2.1.287
surfaces
pane, status, toast

Install inside Claude Code:

/plugin install replay-theater --marketplace hamzafer/claude-code-mods
All install options ↓

What does this mod do?

Replay Theater is a community mod by Hamza Zafar (hamzafer), part of his claude-code-mods collection. It works as a small Claude Code diff viewer for the last turn. While Claude edits files, the mod notes each Edit and Write call: the file, the old text and the new text. When the turn ends, you get a toast, replay-theater: 2 edits last turn. Run /replay, and /replay opens a pane called Replay Theater.

The pane shows Step 1/2, the kind of change (edit or write) and the file path relative to your working directory. A row of step numbers marks where you are, and Prev, Next and Close buttons (hotkeys p, n and q) move through the steps. Below them is a line diff: removed lines in red with a -, added lines in green with a +, unchanged lines dimmed. After the first toast in a session, later turns show ▶ /replay: N edits in the status line instead, and the count clears when the next turn starts.

For a Write, the mod reads the file just before it is overwritten, so a replaced file shows a real before and after. Diffs larger than 800 lines in total are not drawn; the pane says large change and shows the line counts instead.

Install

Use any of the methods in the install block; they install straight from the author's own marketplace. Start a new session, ask Claude to edit a file, and run /replay when the turn ends.

$ install replay-theater

Requires Claude Code ≥ 2.1.287

Installs from the author's own marketplace: hamzafer/claude-code-mods

  1. 1.One line, inside Claude Code

    /plugin install replay-theater --marketplace hamzafer/claude-code-mods

    Paste into a running session (v2.1.275+). Claude Code asks to add the marketplace first.

  2. 2.From your shell

    claude plugin marketplace add hamzafer/claude-code-mods
    claude plugin install replay-theater@claude-code-mods

    Then run /reload-plugins in any session that is already open.

  3. 3.Try it without installing

    git clone https://github.com/hamzafer/claude-code-mods
    claude --plugin-dir ./claude-code-mods/mods/replay-theater

    Loads the mod for one session only. Nothing is added to your settings.

How it works

The mod keeps the edits of the current turn in a list, and copies it to host-held $.state atoms when the turn completes, so a replay survives a hot reload. The Edit hook, from hooks/register.tsx:

// Observe only: the edit runs untouched.
on('tool.call', { tool: 'Edit' }, async ($, e, next) => {
  const r = await next(e)
  if (!r.deny && !r.isError) {
    pending.push({ file: e.file_path, kind: 'edit', before: e.old_string, after: e.new_string })
  }
  return r
})

turn.start empties the pending list, and turn.complete (main agent only, and only if something was recorded) stores it as the replay and shows the toast or status line. command.run for replay opens the pane with $.ui.open, and the pane's ui.render hook draws the current step. The diff itself is a small longest-common-subsequence line diff, diffLines, in the same file. The session.start hook registers /replay; if Claude Code refuses the name because it already exists, the mod starts anyway.

Customize it

There are no options in /config. To change it, edit hooks/register.tsx: MAX_DIFF_LINES sets the size at which a diff is not drawn, and the color props in the pane set the diff colors. The /replay command name is set in the session.start hook.

Permissions & safety

We read every file the plugin can execute before running it: .claude-plugin/plugin.json, hooks/hooks.json, hooks/register.tsx, the type declarations and the tests. There is no package.json, install script, bundled or minified code, or binary. Findings:

  • Network, processes, environment, telemetry: none. The code makes no network requests, runs no commands, reads no environment variables and sends nothing anywhere.
  • Files: the only file access is $.fs.read of the target path of a Write call, just before the write, to show a before text. The mod never writes files. Edit and write contents are held in memory only. Anything Claude writes, including a file that contains secrets, is held in memory for the session while it is in the last turn's replay.
  • Tool hooks: the Edit and Write hooks wrap next(e) and return the result unchanged; they never deny or alter a call. claude plugin validate lists them as "gating hooks without .catch", which means that if the mod threw an error inside the hook, the tool call could fail. The code in these hooks does only a push to an array, and the read before Write has its own .catch.
  • Prompt influence: none. It injects no text into the prompt or tool results; it only draws a pane, a toast and a status line.
  • Daemons, writes to settings or shell files: none.
  • License: MIT, with a LICENSE file in the repository.

claude plugin validate reported no errors and no warnings. The author's 3 tests passed on Claude Code 2.1.303.

Reads files
Can read files and list directories on your machine ($.fs.read / list / stat / exists).
Intercepts tool calls
Sees every tool call Claude makes (tool.call / tool.check) and could block or change it.
Changes the UI
Draws into the Claude Code interface: bands, panes, status text, toasts (ui.render / $.ui.*).
Adds commands/tools
Registers new slash commands or tools that you or Claude can invoke ($.command.register / $.tool.register).

Compatibility & troubleshooting

Checked with Claude Code 2.1.303 on macOS (validate and tests). If /replay shows nothing:

  • You see No edits to replay yet when the last turn used no Edit or Write call. Edits made through shell commands are not recorded.
  • The first turn of a session shows a toast; later turns use the status line, which clears when the next turn starts.
  • If Claude Code already has a command called replay, the mod could not register it. The author's code starts anyway, but the command may not exist.
  • In our test run the hotkeys p, n and q went to the prompt box. Click the pane's buttons, or give it focus, before using them.

To try it, ask Claude for two small edits, wait for the toast replay-theater: 2 edits last turn. Run /replay, run /replay after the turn has finished, and step through both diffs.

FAQ

Does Replay Theater change or block Claude's edits?
No. Its hooks on the Edit and Write tools wait for the tool to run, then note what changed. The result is passed on untouched. The code never denies a call.
Which edits does it record?
Calls to the Edit and Write tools made by the main agent during the latest turn. Edits made through a shell command, such as sed or a script, are not seen. Subagent turns do not replace the replay.
Does it save my code anywhere?
Only in memory. The before and after text of each edit is held in the plugin's state for the current session. The mod writes no files and makes no network requests.
What does /replay do when nothing was edited?
It answers "No edits to replay yet" and opens nothing. A new turn clears the previous replay as soon as the model starts working.
How is it different from Time Machine?
Replay Theater only shows the text diffs of the last turn's Edit and Write calls. It does not restore anything. See the Time Machine page for a mod built around going back.
Blast Radius running in Claude CodeFeatured

Blast Radius

Holds rm -r, force pushes and database migrations in Claude Code and shows what they would change before they run.

  • pane
  • above-prompt
  • Runs commands
  • Intercepts tool calls
  • Changes the UI

tested with v2.1.291

Time Machine running in Claude CodeFeatured

Time Machine

A branching timeline of every tool call, with shadow-git snapshots you can diff, restore, branch and rerun.

  • status
  • pane
  • Reads files
  • Writes files
  • Runs commands
  • Intercepts tool calls
  • Reads your prompts
  • Changes the UI
  • Adds commands/tools
  • Stores data

tested with v2.1.303

More in Panes & dashboards, Timers, todos, standups.