All postsProduct launch 11 min read

Writing software is getting cheap. Trusting it isn’t.

reqtrace is an open-source MCP server and Claude Code plugin that makes an AI agent prove its work: every change traced to a requirement, every requirement to a test that actually runs the code, an independent reviewer, and a sign-off only a human can give. This is what it does, what a 60-run benchmark showed, and what it found in a real C++ library.

Bar chart comparing Claude Code with and without reqtrace across task success, verification strength and whether the agent ran its own tests
Claude Code with and without reqtrace: 10 tasks, 3 runs each. Correctness was identical. The difference was whether the agent checked its own work.

A test that passes is not the same as a test that checks anything. In the benchmark, every plain Claude Code run finished without running its own tests, and one task shipped a test that fails against correct code in every baseline run.

AI agents now write a large share of new code, and they write it fast. The question that matters has moved from “can it write this?” to “how do we know it does what was asked?” Code review by a person does not scale to that volume, and a green test suite only tells you that the tests that exist pass.

Safety-critical engineering has had a working answer to this question for decades. In avionics under DO-178C, every requirement traces to the code that implements it and to the tests that verify it, tests are shown to actually exercise that code, verification is done independently of development, and nothing is approved without a named person signing it off. Almost none of that discipline has reached the tools we now let write our code. reqtrace is an attempt to bring the useful parts across.

What reqtrace is

  • A Python library and CLI that reads requirements in YAML and builds a trace matrix from requirement to code to test.
  • An MCP server exposing that to any MCP client: twelve tools, four resources and two prompts, all returning structured output.
  • A Claude Code plugin: the server, a skill for traceable development, two sub-agents (an implementer and an independent verifier) and a commit gate.
  • A benchmark harness that measures whether any of it makes an agent’s work more trustworthy, with graders that are tested themselves.

It supports Python with pytest, and C and C++ with GoogleTest or plain test executables, using clang coverage with MC/DC. The code is Apache-2.0 at github.com/b4ked/reqtrace-mcp.

It is inspired by public safety-critical practice. It is not a qualified tool, it makes no certification claim, and every example in it is synthetic.

How it works

Six stages, from a requirement written by a person to a sign-off given by a person. Everything in between can be done by an agent, and every step leaves evidence.

  1. 01

    Require

    requirements/*.yaml

    Each requirement has an ID, the text, a rationale and acceptance criteria. It can point at a parent requirement, so high-level and low-level requirements stay linked.

  2. 02

    Link

    Comments and markers

    Code says what it implements with a comment. Tests say what they verify with a pytest marker, or a comment above a C/C++ test. Agents can propose links, which are stored as unconfirmed.

  3. 03

    Verify

    Per-test coverage

    The repo's own tests run under coverage, one at a time, so reqtrace knows which test executed which function. In C and C++ that includes branch coverage and MC/DC.

  4. 04

    Find gaps

    Deterministic analysis

    Untested and unimplemented requirements, tests that never touch the code they claim to verify, code no requirement asked for, dangling links and stale results.

  5. 05

    Review

    Independent verifier

    A sub-agent with no Edit, Write or shell tools judges the code against the requirement text alone, the same separation of duties safety-critical teams use.

  6. 06

    Sign off

    Human only

    Approval is recorded against the exact content reviewed. The reviewer’s name comes from the person, never from the model, and the sign-off goes stale if the code changes.

The status that plain traceability misses

Most traceability tools stop at “a test is linked to this requirement”. reqtrace runs each test alone under coverage and asks whether the linked test actually executed the implementing function. If it did not, the requirement is WEAKLY_VERIFIED: the paperwork says it is tested, and the evidence says it is not.

reqtrace requirement statuses
NOT_IMPLEMENTEDNo code says it implements the requirement
NOT_VERIFIEDNo test says it verifies it
FAILINGA linked test fails
WEAKLY_VERIFIEDLinked tests pass but never execute the implementing code
VERIFIEDLinked tests pass and execute the implementing code
REVIEWEDVerified, and a human approved this exact content

Gap analysis also reports code that no requirement asked for, implementing functions that no linked test calls, dangling links, uncovered branches and, in C and C++, MC/DC conditions never shown to matter on their own. impact_of_change maps a git diff to the requirements it touches, the tests to rerun and the reviews it invalidates.

Design choices that matter

  • Human-only sign-off, enforced by the protocol. The review tool is marked as requiring user interaction, so Claude Code prompts on every call in every permission mode. The reviewer’s name and rationale arrive through MCP elicitation, from the person. They are never tool arguments, so the model cannot fill them in.
  • Separation of duties. The independent-verifier sub-agent has no Edit, Write or shell tools, and judges code against the requirement text only.
  • A deterministic server. It never calls a language model. Every output can be reproduced and audited.
  • Safe by construction. The server only starts the repository’s own tests, as argument lists built from configuration with no shell. No tool accepts a command, and paths are confined to the repository.

Does it help? We measured it

The benchmark gives plain Claude Code and Claude Code with reqtrace the same repository, prompt, model, tools and contributing guide. The only difference is the plugin. Ten tasks across four invented safety-flavoured domains (a battery controller, robot joint limits, a thruster limiter and an ROV depth alarm) cover implementation, requirement changes, review with seeded defects, and a pair of contradictory requirements. Three runs per task per arm: 60 graded runs.

The graders are deterministic. The most important one is verification strength: the agent’s tests run against a reference implementation and against one mutant per requirement, and a requirement only counts if a test linked to it catches its mutant. Before any run, a check proves every reference passes, every mutant is caught by its own requirement’s hidden tests, and every starting stub fails.

Benchmark results, baseline versus reqtrace, Claude Sonnet 5.5
Task success, hidden acceptance tests1.00 baseline · 1.00 with reqtrace
Verification strength (linked test catches its mutant)1.00 · 1.00
Seeded defects found, false positivesAll found, none · All found, none
Agent ran its own tests0 of 30 runs · 16 of 30 runs
Shipped a test that fails on correct code14% of runs · 0%
Cost per run (list price)$0.12 · $0.15 (+23%)
Turns per run6.6 · 10.2 (+54%)

The honest headline: on this benchmark, reqtrace did not measurably improve correctness, and it cost 23% more per run. The model alone solved every task in every run, found every seeded defect (including a “maintenance mode” that silently disabled a safety alarm) and flagged the contradiction instead of guessing. That left nothing for a tool to improve.

The one real difference was behaviour. With reqtrace, the agent ran its own tests in 16 of 30 runs. Without it, 0 of 30. In one task, every baseline run shipped a test expecting a warning exactly at a joint limit where the requirement says “OK”; it never ran the test, so it never noticed. reqtrace’s own check showed that requirement as FAILING. The code was right, the evidence was wrong, and nobody had checked. That is the case the tool exists for.

Two caveats belong next to that number. Part of the gap comes from the locked-down permission setup, which stopped baseline agents from trying their tests, so a permission ablation is the next experiment. And the tasks were too small: a strong model hits the ceiling, so the next version needs harder, multi-module tasks calibrated so the baseline succeeds about half the time. Full method, failure analysis and next steps are in RESULTS.md.

We would rather publish that than a win we cannot reproduce.

On a real library: google/crc32c

To test the C and C++ support on something real, we pointed reqtrace at google/crc32c, the CRC-32C library with portable, SSE4.2 and ARM64 implementations. Eight requirements were written from RFC 3720 and the public API, and 34 comment lines of annotations were added. No build file was edited. On the 22 passing upstream tests, reqtrace found:

  • no test of empty input;
  • one of four public convenience overloads never called by any test;
  • the two widest SSE4.2 loops never executed, because they need 4,080 or more bytes and the largest test buffer is 2,048;
  • the portable fallback and the CPU-feature probe unreachable on an SSE4.2 machine, with MC/DC at 0%.

Claude Code with the plugin, and no general shell, then added six tests, left the hardware-dependent gaps open with the right reasons, and found an untested acceptance criterion that reqtrace itself cannot see. A one-bit error in either SSE4.2 lookup table passes all 22 upstream tests and fails the agent’s new test. That is a test gap, not a bug: the tables are correct. The reproduction script and raw output are in the repository.

Run it yourself

You need Python 3.10 or newer and uv. For C and C++, clang and the LLVM tools; MC/DC needs clang 18 or later.

git clone https://github.com/b4ked/reqtrace-mcp.git
cd reqtrace-mcp && pip install -e .
cd examples/altitude-alerter
reqtrace verify && reqtrace matrix && reqtrace gaps
reqtrace review ALT-001 --approve --reviewer "Your Name" --rationale "Checked boundaries"
reqtrace report         # .reqtrace/evidence/evidence.md
reqtrace gate --verify  # exit 1 if gaps exceed your thresholds

The example repository seeds one of each problem: one verified requirement, one weakly verified (a tagged test that only checks a constant), one untested, one unimplemented, and one function nobody asked for.

To use it with Claude Code, load the plugin from the clone, or add the server to any MCP client over stdio:

# Claude Code plugin: server, skill, sub-agents and commit gate
claude --plugin-dir /path/to/reqtrace-mcp

# Any MCP client
uvx --from /path/to/reqtrace-mcp reqtrace-mcp

Limitations, honestly

  • Links are at function level, not per acceptance criterion, so an untested criterion inside a tested requirement is invisible.
  • Annotations are claims. reqtrace checks them with per-test coverage, but execution is not assertion: a test can run code and check nothing. The benchmark measures that with mutants; mutation testing inside the tool is future work.
  • C and C++ support is clang only, covers only code compiled on the host, and runs each test in its own process.
  • Human-only sign-off relies on a Claude Code hint that other MCP clients may not honour, although elicitation still keeps the reviewer’s identity away from the model.
  • The skill does not yet trigger reliably on review and requirement-change prompts, and the independent verifier was never chosen unprompted in the benchmark.

Where this goes next

The places this matters most are the ones where an agent’s code ends up in something physical or regulated: firmware, control software, robotics, medical devices, and the fleets of machines that receive updates over the air. There, “the tests passed” is not evidence, and a change needs its impact analysed, its tests rerun and its approval renewed. That is the workflow reqtrace is built around.

Next up: harder benchmark tasks, a permission ablation, a weaker-model run to see where the tool helps a model that cannot do it alone, and mutation testing inside the tool.

If you run AI coding agents near safety-relevant code, we would like to hear how you decide what is allowed to merge. And if you have a small open-source library you would like a gap report on, open an issue.

↗ Next step

Make your agents
show their work.

The code is free to use. If you want traceability and verification evidence for AI-written code in your own engineering process, we can help set it up.