Skip to content
Built for TestSprite Season 4

See what the AI builds.Know when it breaks it.

The black-box recorder and time-travel autopsy for AI coding agents.

  • 01Records every turn
  • 02Blames the exact prompt
  • 03Rolls the file back in one click

01The problem

AI moved the bottleneckfrom writing codeto understanding it.

Agentic coding made writing code cheap. Understanding what was written is the new bottleneck. A pull request can be green on types and still leak memory, spin the CPU, or slow p95 latency by 400 ms.

  1. CI / types

    01

    Does it compile?

    A green check on types says nothing about memory, CPU or latency.

  2. TestSprite

    02

    Does the PR break the app?

    Red or green at the merge, tested against the deployed app.

  3. Ghost

    03

    Which turn broke it, and how do I undo it?

    Names the exact turn behind a regression and rolls the file back.

Ghost is the layer behind the maker, not another checker at the merge.

02The loop

Record. Attribute.Reverse.

Three steps run behind every agent turn. Ghost watches the filesystem and the process, so facts come from the app itself, not from what the agent says it did.

01Record

Every change, on the record.

Ghost takes a shadow git commit for every burst of changes, without moving HEAD or touching your branch. It samples runtime metrics from your app and probes HTTP for latency and errors.

  • Shadow commit per change burst
  • cpu, rss, heap and uptime from /api/health
  • HTTP probe for latency and errors

02Attribute

The turn that did it, named.

A threshold check, a trend slope and a per-turn bisect name the exact turn that introduced the regression. In the demo session memory climbs about 38 MB per sample for two turns, and the autopsy blames turn 4.

  • Threshold check
  • Trend slope
  • Per-turn bisect

03Reverse

Undo exactly that turn.

Roll the blamed file back to the pre-regression commit, re-measure, and watch the curve flatten. In the demo, invoices.ts goes back to its t3 version.

  • Blamed file rolled back
  • Re-measured after the rollback
  • Curve flat again

03The autopsy

Everything the agent did,on one screen.

The playground replays a recorded session: the turns, the diff that did it, the metric that caught it, and a fix prompt you can hand straight back to the agent.

Timeline

7 turns · shadow commits
  1. t1Add pagination to the invoices list endpoint.app/api/invoices/route.tshealthy
  2. t2Format amounts in the customer's currency.lib/format.tshealthy
  3. t3Add a status filter to the invoice table.components/InvoiceTable.tsxhealthy
  4. t4Speed up invoice lookups.lib/invoices.tsblamed
  5. t5Add a PDF export for a single invoice.lib/pdf.ts, app/api/invoices/[id]/pdf/route.tsmemory climbing
  6. Autopsy blames t4. Ghost rolls lib/invoices.ts back to t3.re-measured: memory curve flat
  7. t6Show an empty state when there are no invoices.app/invoices/page.tsxhealthy
  8. t7Add tests for the invoices endpoints.tests/invoices.test.tshealthy

Autopsy

Regression found

The regression first appears at t4. lib/invoices.ts is the blamed file.

Blamed turn
t4 · Speed up invoice lookups.
File
lib/invoices.ts
Cause
Unbounded in-memory cache
  • Threshold checkMemory crossed the session threshold during t5.
  • Trend slopeAbout +38 MB per sample across t4 and t5.
  • Per-turn bisectThe regression first appears at t4.
Replay in playground

Diff that did it

t4 · Speed up invoice lookups.
lib/invoices.ts+5−0
11import { db } from './db'
22
3addedconst cache = new Map<string, Invoice[]>()
4added
35export async function listInvoices({ page, pageSize }: ListOptions) {
6added const key = `${page}:${pageSize}:${Date.now()}`new key on every request
7added if (cache.has(key)) return cache.get(key)!
48 const invoices = await db.invoice.findMany({
59 skip: (page - 1) * pageSize,
610 take: pageSize,
711 include: { lines: true, customer: true }
812 })
13added cache.set(key, invoices)
914 return invoices
1015}

Memory

from /api/health: cpu, rss, heap, uptime
Memory change per sample in the demo session
TurnSampleChange since previous sample
t11baseline
t120 MB
t210 MB
t220 MB
t310 MB
t320 MB
t4138 MB
t4238 MB
t5138 MB
t5238 MB
t610 MB
t620 MB
t710 MB
t720 MB

Facts come from the app, not from what the agent says it did. The heal flattens the curve.

Agent-agnostic

Ghost watches the filesystem and the process, not the agent.

Every one of these produces the same recording. Nothing to install inside the agent, nothing to trust about its own report.

  • Cursor
  • Claude Code
  • Codex
  • OpenCode
  • A human with a keyboard

04Proof

Three questions.Three different tools.

TestSprite tells you the PR is red. Ghost tells you which prompt turned it red. They answer different questions, so they work together.

  • CI / types

    Does it compile?

    Where
    At the merge
    Returns
    Pass or fail
  • TestSprite

    Does the PR break the app?

    Where
    At the merge, against the deployed URL
    Returns
    A red or green suite
  • Ghost

    Which turn broke it, and how do I undo it?

    Where
    Behind the maker, on every agent turn
    Returns
    The blamed turn and a one-click rollback

TestSprite guards this repo

Required check

13/13

backend tests green after PR #2

  • A TestSprite 3.0 project with 13 backend tests
  • Runs against the deployed URL on every pull request
  • Required check: a red suite blocks the merge

The suite in action

  1. PR #1Suite red

    Shipped a BOLABroken Object Level Authorization hole: one owner could read another owner's invoice.

  2. PR #213/13 green

    Fixed the cross-owner read. The suite went green, 13 of 13.

05Quickstart

Three commands.One recording.

Install, start your app, and point the recorder at its health endpoint. Then open the playground and replay what happened.

  1. 01npm installInstall dependencies.
  2. 02npm run devStart the app on port 3000.
  3. 03npm run recordRecord a session against the app’s health endpoint.
/
Landing
/playground
Timeline, diff, metrics, 3D city, copy fix prompt
ghost · zsh
  1. npm install
  2. npm run dev
  3. npm run record -- --repo . --health http://localhost:3000/api/health --duration 60
Then open the playground

TestSprite tells you the PR is red.

Ghost tells youwhich promptturned it red.

GhostInTheCodebase

Black-box recorder and time-travel autopsy for AI coding agents. See what the AI builds. Know when it breaks it.

© 2026 GhostInTheCodebase. Agent-agnostic by design.

Facts from /api/health, not from what the agent says it did.