Skip to main content

verbatim-relay

CI PyPI Python versions License

Test your chat agent through Claude Code or Codex. The harness model does not retype one message or one reply.

verbatim-relay is a test harness for chat agent development. You talk to your agent in the coding harness where you already work. The relay sends each message to your agent byte for byte, and shows each reply byte for byte. The model does not run while you talk. At the end, the model reads the exact record and evaluates your agent: business logic, tone, accuracy.

It adapts to your app through a thin entry in .verbatim-relay/, and your app's code does not change. The cost is plumbing: you write the entry once, and you change it when the start or the wiring of your app changes.

How it works

tester ──> harness ──> relay ──────> tap ──stdin/stdout──> entry ──> your app
                         │            │
                         ▼            ▼
                    relay.jsonl    tap.jsonl
            (what you typed      (what the agent
             and saw)             received and sent)
                         │            │
                         └─> audit <──┘   exit 0 clean, 1 break, 2 invalid record
  • Harness: Claude Code or Codex, where you type your test messages.
  • Relay: the plugin or the hook kit in the harness. It carries each message and each reply, and the model writes neither.
  • Tap: a proxy in front of your agent. It forwards each byte with no change, and records what the agent received and sent.
  • Entry: a thin wrapper that starts your app and speaks one JSON line in and one JSON line out.
  • Audit: a program that compares the two records byte for byte, and names each break.

docs/architecture.md shows this flow with each part, and has diagrams of one turn, the test lifecycle and the trace.

Two processes write two records, and the audit compares them byte for byte. It reports 7 break classes (SPEC.md section 3.3). It fails closed: it never reports clean on a record that it cannot read. 53 audit cases, 20 contract cases, 10 trace cases, 11 seal cases and 7 receiver cases in conformance/ test the spec (cases, tests).

A test also records what your app did. It copies the session files of the app's own Agent SDK or Codex sessions. It records the backend calls, the direct model calls and the OpenTelemetry spans of the app. docs/architecture.md shows each part.

Install

uv tool install verbatim-relay

It needs Python 3.10 or later, and it has no runtime dependencies (pyproject.toml). The docs are for version 0.3.0. To upgrade from an earlier version, end each running test first. Then run uv tool upgrade verbatim-relay (CHANGELOG.md). docs/how-to/upgrade.md gives each step.

Quick start

Select one route: try the toy shop, connect your app, or choose a relay.

Try the toy shop

In a clone of this repo, with the toy shop agent and the hook kit in Claude Code:

verbatim-relay init claude-code --entry "python3 examples/toy-shop/agent.py"
verbatim-relay check        # one message through the entry: PASS proves the connection, not the reply
verbatim-relay view         # in a second terminal: each reply shows here

In Claude Code, type the prompt verbatim-relay start, then your test messages, then verbatim-relay end. The end of the test writes audit.json in the test folder .verbatim-relay/tests/<test-id>/. Then the model evaluates the test and writes report.md. docs/getting-started.md shows each step with its real output.

Optional: to see the audit again, run it by hand:

verbatim-relay audit --tap .verbatim-relay/tests/<test-id>/tap.jsonl --relay .verbatim-relay/tests/<test-id>/relay.jsonl

Connect your app

In the harness, in the project folder of your app, type !verbatim-relay setup. Then type the prompt "Follow the verbatim-relay setup guide, and connect a test to this app." docs/how-to/test-your-app.md gives each step from the install to the results, with the expected output. To write the entry yourself, read docs/how-to/connect-your-agent.md.

Choose a relay

The plugin shows each reply in the chat of Claude Code. The hook kit works in Claude Code and in Codex, and shows each reply in verbatim-relay view. docs/how-to/choose-a-relay.md compares the 2 relays. Then read the guide of your relay: Claude Code plugin, Claude Code hook kit or Codex.

Results

Proof Claude Code 2.1.290, plugin Claude Code 2.1.290, hook kit Codex 0.160.0, hook kit
Messages reach the agent byte for byte 10/10 10/10 10/10
Replies reach the tester byte for byte 10/10 10/10 10/10
Same, with a system prompt that tells the model to rewrite both 5/5 5/5 5/5
Model call to the agent denied, agent receives nothing yes yes yes
Audit finds planted faults 5/5 5/5 5/5
After the test, the model has no memory of the conversation, and reads it from the transcript yes yes yes

Data: plugin, hook kit in Claude Code, hook kit in Codex, evaluation. Method: docs/results.md.

Under pressure, the mechanism had 0 breaks in 1,000 turns. The test had 40 scripted conversations in each harness, 5 or 20 turns long. They had refusals, HTTP 500 errors, questions back to the tester and ambiguous messages. Each turn was a new harness call. I registered the design before the first run. Method, data and the one deviation: docs/results.md.

Docs

The how-to rows are in the order of the tasks of a test: choose, connect, run, read the results, fix. The row after them has the tasks that maintain verbatim-relay.

Kind Pages
Tutorial Get started
How-to: choose Choose a relay
How-to: connect your app Test your own app, Connect your agent, HTTP tap, Test a streaming agent, Isolate an Agent SDK session, Add a backend, Model calls and OpenTelemetry
How-to: run a test Claude Code plugin, Claude Code hook kit, Codex
How-to: read the results Read the results of a test
How-to: fix Troubleshooting, Recover a stuck test
How-to: maintain Upgrade, Remove, Run the proofs
Reference CLI, Configuration, Records, Glossary, SPEC.md, Results
Explanation Architecture, Limits, FAQ, Worked evaluations

The full map is docs/index.md. Read docs/limits.md before you trust a result: the deny is best effort, and the entry is not audited.

Contribute

Read CONTRIBUTING.md and the code of conduct. Report a security problem as SECURITY.md says.

License

Apache-2.0. See LICENSE.

Metadata

Release files for verbatim-relay 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for verbatim-relay 0.3.1
File Size Uploaded
verbatim_relay-0.3.1.tar.gz 211.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for verbatim-relay 0.3.1
File Interpreter ABI Platform
verbatim_relay-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 302.5 kB

Release files / verbatim_relay-0.3.1.tar.gz

Download URL verbatim_relay-0.3.1.tar.gz
Size 211.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0cdea4cdc42b438b88ea625ec98fedf1f4d84b7b8179962239c4c4e119d62e83
BLAKE2b-256 checksum
How to use checksums
db9ceec4cadcfd77076838ad143084d6763cf1a20236cbfbc3f88771e4347f45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / verbatim_relay-0.3.1-py3-none-any.whl

Download URL verbatim_relay-0.3.1-py3-none-any.whl
Size 91.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
331928d0bbca2e9d937fb377ec3825449f881ebf28a778bb40565cbda26a0761
BLAKE2b-256 checksum
How to use checksums
7b76c8cb732648b3bd35844119e930d23877b4cdc39f4938af09b4ee9b563d11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page