Skip to content

Hokie

What I built Clinical trials fail for predictable reasons.

Core trick

Agent generates trial-specific failure hypotheses, queries live biomedical APIs, and a citation gate checks every claim against tool output.

Tags

Description

What I built Clinical trials fail for predictable reasons. The problem is that teams usually discover those reasons after months of work and millions of dollars. I built TrialPremortem, an autonomous agent that stress-tests a clinical trial before the first patient is enrolled. Give it a draft protocol and it does two things. First, a validated machine-learning model estimates the risk that the trial will fail to recruit enough patients. Then the agent investigates why. It generates hypotheses specific to that trial, searches live biomedical sources including ChEMBL, Open Targets, PubMed, and ClinicalTrials.gov, and gathers evidence for or against each one. Before anything reaches the user, an adversarial critic challenges the findings and a programmatic citation gate checks every factual claim against the actual tool output. The result is not a generic protocol review. It is a ranked list of the most likely ways the trial could fail, the evidence behind each one, and a quantified recommendation for what to change. What I found The core result is a validated metric, not an opinion. I reconstructed the real version history of trials on ClinicalTrials.gov. For each trial, I recovered the original protocol, hid everything that happened afterward, made a prediction using only that first draft, and then checked what actually happened. Across 927 real trials, the model achieved an AUC of 0.67. It flagged 43% of the trials that later failed because of poor recruitment, while flagging only 21% of the trials that succeeded. I also found an outcome-leakage bug involving achieved enrollment. Had I left it in, the reported AUC would have been 0.82. That number was wrong, so I removed the leak and report the honest result instead. One of the more interesting findings came from the ablation study. On the hardest matched cohort, the engineered ML model scored 0.61 AUC. A zero-shot agent reasoning from the protocol scored 0.55. That is why TrialPremortem does not ask an LLM to magically predict trial failure from scratch. The agent uses the validated ML model as a tool, then investigates and explains the result. And on just 43 real failed trials that the system successfully flagged, I estimate a conservative $7.8 million in avoidable cost. Why it matters Most clinical trial protocols are reviewed again and again before launch. They still fail. Roughly 76% of protocols are amended after finalization, with each amendment costing an estimated $141,000 to $535,000. Insufficient accrual remains the leading cause of trial termination, accounting for about 39% of terminated studies. This is not because trial teams lack expertise. A protocol may already pass through five to seven expert reviews. The problem is structural. No individual reviewer carries the base rates of thousands of similar trials in their head. And the feedback loop is painfully slow: design a trial, launch it, wait 12 to 24 months, discover what went wrong, and hope that knowledge somehow makes it back to the next team. Usually, it does not. TrialPremortem closes that loop. It gives trial designers something they have never really had: institutional memory across thousands of past trials, applied to the protocol in front of them before the expensive mistakes happen. And the prediction is backed by a metric that anyone can reproduce using public data.
ruuls/claude_lifesciences★ 00 forksPythonCreated Jul 13, 2026 · last push Jul 13, 2026

README excerpt

# TrialPremortem

**An AI agent that stress-tests a draft clinical trial protocol *before* it's finalized — and predicts, from the first draft alone, whether it will fail to recruit patients.**

Built for *Built with Claude: Life Sciences*.

---

## The headline (validated, leak-free)

> **On real ClinicalTrials.gov history, TrialPremortem reads a trial's *original v0 draft* — with the outcome hidden — and foresees accrual failure at AUC 0.67. At a top-quartile risk threshold it flags 43% of trials that later died of poor recruitment while flagging only 21% of trials that completed.**

This is not a forward-looking guess validated against opinions. It is **backtested against the actual version history of real trials**: we recover each protocol's first-registered draft, hide what happened, predict, then check the recorded outcome.

---

## Why this problem is worth solving

- **76% of protocols are amended** (up from 57% a decade ago), averaging **3.3 amendments each**.
- A single substantial amendment costs a median **$141K (Phase 2)** to **$535K (Phase 3)**.
- Only **~16% of amendments are regulator-requested** — the rest are self-inflicted design flaws.
- **Insufficient accrual is the #1 cause of trial termination (~39%)**, and **eligibility is the most-amended element (~53%)**.

The experts already run 5–7 review layers. They still miss these flaws — not from incompetence, but because **no reviewer has the base rates**: nobody remembers what happened to the thousand simila

Team