Replay a Run
vix replay replays a previously recorded Vix execution.
Use this guide when you want to reproduce a run that failed, crashed, was interrupted, or behaved differently than expected.
Replay is useful because it keeps the execution context. You do not need to guess the command, the working directory, the runtime arguments, or the environment that was used.
vix rundoes not record replay data by default. To create a replay record, run with--replay.
The problem
When an app fails, the failure is not always only in the source code.
It can depend on:
the exact command
the current directory
the runtime arguments
the environment variables
the selected target
the executable path
the exit code
stdout and stderr output
whether the process crashed or was interruptedWithout replay data, reproducing the same run can become manual and fragile.
vix replay exists to make that workflow repeatable.
What vix replay does
vix replay loads a recorded execution from:
.vix/runs/Then it replays the stored command with the recorded context.
It can:
replay the latest recorded run
replay the latest failed run
replay a specific run by id
list previous recorded runs
show details about a run
append extra runtime arguments
add temporary environment variables
clean replay recordsRecording a run
Replay records are created only when vix run is executed with --replay.
vix run api --replay
vix run ./build-ninja/api --replay
vix run app.vix --replay
vix run main.cpp --replayWithout --replay, vix run runs normally and does not create replay data.
vix run api
vix run main.cppThese commands do not create records under .vix/runs/.
Basic usage
Replay the latest recorded run:
vix replayThis is equivalent to:
vix replay lastYou can also use:
vix replay latestReplay the latest failed run:
vix replay failedReplay a specific run:
vix replay 2026-05-05-18-42-11-a91fTypical workflow
Record a run:
vix run api --replayIf the run fails, replay the latest failed run:
vix replay failedFor single-file C++:
vix run main.cpp --replay
vix replay lastFor a built executable:
vix run ./build-ninja/api --replay
vix replay lastUsage
vix replay [id|last|latest|failed|fail] [options] [-- app-args...]
vix replay list [options]
vix replay show [id|last|latest|failed|fail] [options]
vix replay clean [options]Replay targets
| Target | Meaning |
|---|---|
last | Replay the latest recorded run |
latest | Alias for last |
failed | Replay the latest failed run |
fail | Alias for failed |
<id> | Replay a specific recorded run id |
When no target is provided, Vix uses last.
vix replayReplay the latest run
vix replay lastOr simply:
vix replayUse this when you want to rerun the most recent recorded execution.
Replay the latest failed run
vix replay failedThis replays only the latest failed run. It does not replay every failed run.
To see all failed runs:
vix replay list --failedReplay a specific run
Each recorded run has an id.
Example:
vix replay 2026-05-05-18-42-11-a91fRun ids are stored under:
.vix/runs/List recorded runs
List recent runs:
vix replay listShow only failed runs:
vix replay list --failedShow only successful runs:
vix replay list --successShow interrupted runs:
vix replay list --interruptedLimit the number of results:
vix replay list --limit 10Show a recorded run
Show the latest run:
vix replay show lastShow the latest failed run:
vix replay show failedShow a specific run:
vix replay show 2026-05-05-18-42-11-a91fThis is useful before replaying because it lets you inspect the stored metadata.
A recorded run can include:
run id
original command
working directory
status
exit code
duration
stdout log
stderr log
combined log
replay hintDry run
Use --dry-run to print what would be replayed without executing it.
vix replay last --dry-runThis is useful when you want to inspect the replay command first.
Print summary before replay
Use --summary to print the record summary before running it:
vix replay failed --summaryDisable summary output:
vix replay failed --no-summaryPass extra app arguments
Arguments after -- are appended to the replayed command.
vix replay last -- --port 8080Another example:
vix replay failed -- --debug --seed 42The separator matters.
Replay options go before --.
App arguments go after --.
Add environment variables
You can add temporary environment variables during replay.
vix replay last --env VIX_LOG_LEVEL=debugMultiple variables:
vix replay last \
--env VIX_LOG_LEVEL=debug \
--env APP_ENV=localThis does not permanently modify .env.
It only affects the replayed process.
Use another replay directory
By default, vix replay reads from .vix/runs/ in the current directory.
Use --dir or --cwd to read replay data from another project:
vix replay last --dir ./apiOr:
vix replay list --cwd ./apiThis is useful when you are not currently inside the project folder.
Clean replay data
Remove recorded replay runs:
vix replay cleanThis removes replay data from:
.vix/runs/Use this when old records are no longer needed.
Recorded files
A recorded run is stored like this:
.vix/runs/<id>/
run.json
stdout.log
stderr.log
combined.logThe latest marker stores the most recent run id:
.vix/runs/latestOptions
| Option | Description |
|---|---|
--dry-run | Print the replay command without executing it |
--summary | Print the record summary before replaying |
--no-summary | Do not print the record summary |
--dir <path> | Use another directory containing .vix/runs |
--cwd <path> | Alias-style working directory option for replay data |
--env KEY=VALUE | Add an environment variable during replay |
-- | Append remaining arguments to the replayed command |
-h, --help | Show command help |
Recording option on vix run
| Option | Description |
|---|---|
--replay | Record this vix run execution under .vix/runs/ |
Examples:
vix run api --replay
vix run ./build-ninja/api --replay
vix run app.vix --replay
vix run main.cpp --replayList options
| Option | Description |
|---|---|
--all | Show all replay runs |
--failed | Show failed replay runs |
--fail | Alias for --failed |
--success | Show successful replay runs |
--ok | Alias for --success |
--interrupted | Show interrupted replay runs |
--interrupt | Alias for --interrupted |
--limit <n> | Limit number of rows |
--dir <path> | Use another directory containing .vix/runs |
--cwd <path> | Use another directory containing .vix/runs |
Difference between vix run, vix dev, and vix replay
| Command | Best for | Replay behavior |
|---|---|---|
vix run | Manual execution | Records only when --replay is used |
vix dev | Active development | Focused on rebuild and rerun workflow |
vix replay | Reproducing a recorded execution | Replays stored execution context |
vix replay does not replace vix run.
It uses replay records created by replay-enabled runs.
Example: replay a failed backend run
Record the run:
vix run api --replayIf it fails:
vix replay failedInspect before replaying:
vix replay show failedReplay with debug logs:
vix replay failed --env VIX_LOG_LEVEL=debugExample: replay a single C++ file
Record:
vix run main.cpp --replayReplay:
vix replay lastReplay with extra runtime arguments:
vix replay last -- --name GaspardExample: inspect previous runs
List recent runs:
vix replay listList only failures:
vix replay list --failedShow a specific run:
vix replay show 2026-05-05-18-42-11-a91fReplay it:
vix replay 2026-05-05-18-42-11-a91fCommon workflows
# Record and replay a project run
vix run api --replay
vix replay last
# Record and replay a single-file C++ run
vix run main.cpp --replay
vix replay last
# Replay the latest failed run
vix replay failed
# Inspect the latest run before replaying
vix replay show last
vix replay last
# List failed runs
vix replay list --failed
# Replay with debug logs
vix replay failed --env VIX_LOG_LEVEL=debug
# Print the replay command only
vix replay last --dry-run
# Clean old replay data
vix replay cleanCommon mistakes
Expecting vix run to record automatically
Wrong:
vix run api
vix replay lastCorrect:
vix run api --replay
vix replay lastvix run does not create replay records by default.
Use --replay when you want the execution to be recorded.
Running replay from the wrong directory
Wrong:
cd ..
vix replay lastCorrect:
cd api
vix replay lastOr:
vix replay last --dir ./apivix replay reads .vix/runs/ from the current directory unless --dir or --cwd is provided.
Thinking failed replays every failure
vix replay failedThis replays the latest failed run only.
To list all failures:
vix replay list --failedPassing app arguments without --
Wrong:
vix replay last --port 8080Correct:
vix replay last -- --port 8080The -- separates replay options from arguments appended to the replayed command.
Forgetting to inspect the run first
When you are unsure what will be replayed, use:
vix replay show last
vix replay last --dry-runThen replay normally.
Recommended debugging flow
# 1. Record the execution
vix run api --replay
# 2. If it fails, inspect the record
vix replay show failed
# 3. Replay the failure
vix replay failed
# 4. Replay with more logs
vix replay failed --env VIX_LOG_LEVEL=debug
# 5. Clean old records when done
vix replay cleanRelated commands
| Command | Purpose |
|---|---|
vix run | Build and run manually |
vix dev | Run development mode with rebuild and rerun workflow |
vix build | Configure and compile |
vix check | Validate build, tests, runtime, and sanitizers |
vix tests | Run tests |
vix logs | Inspect production logs |
vix health | Check local, public, and WebSocket health |
What you should remember
vix replay reproduces a recorded run.
Replay records are created only when you run:
vix run <target> --replayThe common workflow is:
vix run api --replay
vix replay failedThe replay data lives in:
.vix/runs/Use:
vix replay show lastto inspect a record.
Use:
vix replay last --dry-runto preview the replay command.
Use:
vix replay cleanto remove old replay data.
Next step
Continue with development mode.