Skip to main content

VCR / time-travel replay for Claude Code and Codex — deterministic offline agent testing

Project description

LLMReplay

VCR / time-travel for coding agents. Record Claude Code or Codex once, then replay offline — stop, tweak, fork, and assert — without burning tokens or waiting on nondeterministic model runs.

CI PyPI Python License

Status: Early alpha. See docs/alpha-limitations.md.

LLMReplay demo: record, why, replay

Install

pip install coding-agent-vcr
export LLMREPLAY_HMAC_KEY=dev-local-hmac   # recommended; required for ci/strict record
llmreplay doctor

PyPI package name is coding-agent-vcr (llmreplay / llm-replay were taken or blocked as too similar). The CLI and Python import remain llmreplay.

60-second hermetic win

# Clone for the smoke script, or use record/replay against your own stub:
git clone https://github.com/dmallya93/llmreplay.git && cd llmreplay
pip install -e ".[dev]"
export LLMREPLAY_HMAC_KEY=dev-local-hmac
./scripts/smoke.sh
# → smoke ok: record→replay (fake upstream)

Record → offline replay

# Terminal A — CCR (:3456) or any Anthropic/OpenAI-compatible stub
llmreplay record --cassette .llmreplay/demo --upstream http://127.0.0.1:3456

# Terminal B — point Claude Code at the proxy
export ANTHROPIC_BASE_URL=http://127.0.0.1:7432
export ANTHROPIC_API_KEY=unused-local
# run one agent turn, then stop record

llmreplay replay --check --cassette .llmreplay/demo
llmreplay replay --cassette .llmreplay/demo --profile ci

# On a miss:
llmreplay why --cassette .llmreplay/demo --request .llmreplay/demo/requests/<tx-id>.json

Prefer free CCR+Ollama: docs/free-test-stack.md. Longer path: docs/quickstart.md.

Why this exists

Coding agents fail in ways unit tests miss: flaky tool order, prompt regressions, CI that needs live API keys, and bugs you cannot replay. Observability shows what happened. LLMReplay decides what must match and re-executes the trajectory from fixtures.

You want… Use
Deterministic offline replay + CI goldens LLMReplay
Live traces, evals, cost dashboards AgentReplay (compare)

Core ideas

  • static — must match (drives agent behavior)
  • ignore — noise (timestamps, request ids); advisory only
  • scrub — secrets → HMAC placeholders before disk
  • live — always hit the real tool/LLM for that step (mark-live)

Normative rules: docs/SPEC.md. Architecture: DESIGN.md.

Documentation

Contributing / local gates

See CONTRIBUTING.md and docs/ci.md for the CI-required validation commands (pytest, coverage gate, repro stress, smoke).

License

Apache-2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coding_agent_vcr-0.1.0.tar.gz (67.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coding_agent_vcr-0.1.0-py3-none-any.whl (69.9 kB view details)

Uploaded Python 3

File details

Details for the file coding_agent_vcr-0.1.0.tar.gz.

File metadata

  • Download URL: coding_agent_vcr-0.1.0.tar.gz
  • Upload date:
  • Size: 67.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for coding_agent_vcr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d55610dc5535727629f809a478f140344b7c9c18d02f9462177c63164b7fa46b
MD5 c2309899a7a17b8eb52b376631ab00e7
BLAKE2b-256 3bf43a63780ee64280324b7efd179e0db34b5bc0bd1210c8a53c509bc36e76c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for coding_agent_vcr-0.1.0.tar.gz:

Publisher: publish.yml on dmallya93/llmreplay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file coding_agent_vcr-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for coding_agent_vcr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 97d3dc735ac9fee9e4d19052fac453fb78592c184ae2281b5d033db452d50c6f
MD5 87c59b2375e79cce3ea4c59d60eb5eea
BLAKE2b-256 25a876c3b2f2a46c4ace7f6c3ffd8ce416e9ea83b36cb8ed8c29c9c45bdaf52d

See more details on using hashes here.

Provenance

The following attestation bundles were made for coding_agent_vcr-0.1.0-py3-none-any.whl:

Publisher: publish.yml on dmallya93/llmreplay

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page