I recently challenged myself to 180 Days of Deep Diving into AI. One of the materials I went through was Delegation & the builder’s toolkit · AI Fluency for builders · Claude Academy.

The course had an exercise throughout that simulated building a spec and a Clinic Wait Time app. I modified it a bit after writing the spec to use it as a practice problem to learn about agents and evals: design a wait-time page and text service for a small community clinic, then test it thoroughly in simulation, before any real patient could see it.

Clinic Wait Time Demo

Github Link

The question I set out to explore wasn’t “can we predict waits?” It was narrower: does a wait-time product stay accurate, honest and safe when the people feeding it are imperfect? I built some imperfect agents who simulated the chaotic-ness that is real people to test it.

I built a working prototype, a simulated clinic to test it in, and a set of automated checks that caught real bugs.

A note on what this is: Wait times are the example, and this is a learning exercise. I’m not claiming clinics need my wait-time page, and nothing here has been tried in a real clinic. The wait-time product is a practice subject: a small, familiar problem that let me experiment with using simulated people and AI agents as test users, and see what that kind of test can and can’t tell you. Everything in the demo is simulated, with synthetic data.

The guided “Watch a day play out” in the demo: a normal minute, the receptionist falling behind, people who are here but not on her list, an urgent text, a Spanish-speaking patient, a late arrival, and how it’s all checked.

Some Key Learnings

1. The risk is the people feeding it nonsense, not the math to calculate wait times. Wait-time tools rarely fail because the formula is wrong. They fail because a busy front desk falls behind on entering who arrived and who was seen. I researched this, and I saw it happen with my simulated agents too. So the page shows a range (“about 25–50 min”), never one number, always with when it was last updated. When the desk’s records are too old or incomplete to trust, it stops and says “please call the clinic” instead of guessing. The cost: wider ranges, and sometimes no time at all.

2. Different patients need different answers, and everyone has to be able to read them. Someone walking in wants to know how long they’ll wait. Someone with a 2:30 appointment wants to know how far behind the schedule is. So walk-ins see a range and booked patients see minutes behind. Both fit on a small phone without scrolling, at about a 6th-grade reading level, in English and Spanish.

3. Trust over precision. Being off by ten minutes isn’t the worst failure. False reassurance is: telling someone a wait that turns out too short, so they stay when they should have left, or leave when they should have stayed. I made that the key measure, and drew hard lines to protect trust. No triage or medical advice. Nothing that could discourage urgent care: a text mentioning chest pain always gets the same pre-approved emergency reply, which no AI can write or change. And a person approves anything that moves someone in line.

4. Test it in a simulated clinic first. Before an alpha with real users, I built something like a digital twin of a clinic afternoon. That meant simulated receptionists and patients with realistic habits, and automated checks on every promise, so failures could be found cheaply and safely. This could be another interesting application of agents for relevant companies to run pre-tests since testing with users can be expensive and time consuming. Get the low hanging fruit first before exposing an app to chaotic real humans.

The numbers sometimes pushed against these principles. Patients can tap “I’m here” on the wait page, which shows when the desk’s list is missing people. Counting those taps as people waiting measured better than stopping the page (right 82% vs 79% of the time, with far fewer simulated walkouts). I chose to stop the page anyway. One simple rule, “if the records are incomplete, say please call”, is easier to trust than a cleverer one.

What the prototype looks like

The demo has three screens: the clinic, how it works, and the evals. The first shows the patient’s phone next to what the front desk sees.

The patient’s view: a walk-in range, how far behind booked visits are, when it was last updated, and the emergency line on every view.

The part I spent the most time on is what the patient sees when something goes wrong.

Five failure cases, word for word. Only the delay text can be drafted by an AI helper, and the desk approves it first.

Running scenarios in a simulated clinic

The simulated clinic runs a half-day afternoon minute by minute. Four receptionists each have a habit taken from real life:

  • Dana is accurate.
  • Luis enters updates in batches and guesses waits from a headcount.
  • Pat guesses erratically.
  • Kim stops entering anything for 20 minutes or more when the waiting room fills up.

Seven simulated patients test specific promises. Four of them require extra handling:

  • Rosa writes only in Spanish.
  • Tom texts about chest pain.
  • Mr. Chen arrives half an hour early.
  • Ana arrives late.

These actors can be played by AI, each from a short persona prompt, so they behave less politely and punctually than a script would.

The product also has AI helpers, each with one job and a limit enforced in code rather than by asking nicely in a prompt. One flags suspicious desk records. One answers patients’ texts, but code checks every reply before it is sent. Two draft suggestions, a late arrival’s new slot or wider ranges on a bad day, that wait for a staff approval. The simulated people and the product’s helpers never share a prompt or an AI call, so the demo isn’t grading its own homework.

The “How it works” screen. Simulated people create the day, and the product turns what the desk records into what patients see. Each part is marked as AI or plain code, with the limit on what it can do alone.

Then the evals: about 25 automated checks, each with a scenario, what’s recorded, how it’s graded and a pass bar. They run on 140 simulated afternoons (7 kinds of day × 20 different patient crowds), plus short runs for rare situations like a provider going home mid-afternoon or a day that crosses midnight. Five are safety promises, and one miss on any day fails the build:

  • the fixed emergency reply for urgent texts;
  • no wait time from stale data;
  • no one moved in line without approval;
  • no names or medical words;
  • the emergency line and “updated X min ago” on every view.
The Evals screen: safety promises, accuracy goals (including the misses), and the real problems caught along the way.

The point of all this was to find failures before a patient would. Some it found:

  • The page kept showing a time from data that looked fresh but was incomplete. The receptionist was skipping some entries while still making others.
  • Real waiting patients were dropped from the estimate. An early patient seen before someone even arrived made the product think she had been skipped.
  • The page said “running 0–15 min behind”, showing patients a zero.
  • An AI helper got its arithmetic wrong in a note to staff. Now code supplies every number staff rely on.
  • The checks themselves had bugs. One flagged every honest “please call” page as a failure, and one passed without ever being tested. A pass that never ran proves nothing.

Every one is written up with its cause and fix.

What held, and what didn’t

The safety promises held on every one of the 140 simulated afternoons. The range covered the real wait 84% of the time, against a goal of 80%. Someone was told a wait that turned out much too short only 3% of the time, against a limit of 5%. That last number is the one I care about most, because it measures false reassurance.

Three goals are still short, and the demo shows them rather than hiding them:

  • Beating a receptionist’s single guess. A receptionist counting the room often lands closer than the middle of the product’s range. I tried tuning the estimator, and scoring its best guess instead of the middle of the range. Every change that helped also made ranges too short more often, which breaks the promise that matters more. In a simulated clinic where visits are fairly steady, a headcount is simply hard to beat. And the product gives a range on purpose. So I kept the goal and reported the miss instead of lowering the bar.
  • Knowing exactly when to stop showing a time on the hardest day, when the receptionist goes quiet during a rush. It’s right most of the time, but not yet 9 times in 10.
  • Catching every bad entry planted in the desk’s records. Most are caught. Spotting someone checked in who isn’t actually there takes judgment, which is a job for an AI helper.

I also learned the limits of the simulation itself. It shows how the product behaves when people are imperfect. It can’t show how accurate it would be in a real clinic, because the simulated afternoons follow published averages, not one clinic’s records. The most striking number on the results screen, far fewer people leaving before being seen, is mostly built into how the simulated patients decide to leave. It’s a relationship to test with real users, not a result to claim.

What I’d do in a real user test

If this ever went alpha or beta testing with real users, here is what I would do:

  1. Shadow the front desk for a few shifts. I’d check whether “I’m here” taps and a one-tap “this visit is running long” button fit the real workflow, and measure how late entries really are. Then I’d tune the simulated receptionists to real habits instead of my guesses.
  2. Test the page with five to eight patients, including Spanish speakers. Do people understand a range, “please call”, and “very busy right now”? Does “updated 9 min ago” change what they do?
  3. Run it quietly in the background for a few weeks before patients see it. I’d compare its ranges and the desk’s guesses with real waits. That answers the question the simulation can’t: does it beat the receptionist in a real clinic?
  4. Test the biggest unproven claim: that an honest range keeps people from leaving before they’re seen.
  5. Get staff and compliance sign-off before a single real text goes out. That means a privacy review, the exact emergency wording, and who approves suggestions on a busy day.

Takeaway

The most useful thing I built wasn’t the wait estimate. It was the simulation around it: realistic imperfect people, AI helpers with limits that code enforces, and checks that fail loudly. That combination turned “I think this works” into a list of specific things that broke, how they were fixed, and what’s still unproven, before any patient was involved.

The demo, code and full write-up are on GitHub: github.com/bessiec/clinic-waittime-demo. The guided “Watch a day play out” takes about four minutes. Everything in it is simulated with synthetic data.

Try it yourself

It needs Python 3 and nothing to install. From the repo folder, run python3 -m web, open http://127.0.0.1:8000 and press Watch a day play out. The recording replays for free, with no AI calls. To rerun the checks, use python3 -m evals.

Posted in , ,

Leave a Reply