Skip to content

Playground

Replay the session. Find the turn. Roll it back.

Seven agent turns on an invoices app. Turn 4 added an unbounded in-memory cache to invoices.ts, memory climbed about 38 MB per sample for two turns, and the autopsy named the turn. Step through it, or roll the file back yourself.

Demo session · invoices app

7 turns recordedSampled from /api/health: cpu, rss, heap, uptime

Current step: t5

Timeline

shadow commits, HEAD untouched
Code city · height is churn, color is health

Memory

change per sample, two samples per turn
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

Diff

change in t5
lib/pdf.ts+7−0
1addedexport async function renderInvoicePdf(invoice: Invoice) {
2added const doc = new PDFDocument({ size: 'A4' })
3added doc.fontSize(18).text(`Invoice ${invoice.number}`)
4added invoice.lines.forEach(line => doc.fontSize(11).text(line.label))
5added doc.end()
6added return toBuffer(doc)
7added}

Renders an invoice to PDF behind a new download route.

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.
Preview the fix prompt
Fix prompt for your agent
Ghost autopsy: turn 4 ("Speed up invoice lookups") added an unbounded in-memory cache to lib/invoices.ts. The cache key includes Date.now(), so every request adds an entry and nothing is ever evicted. Memory climbed about 38 MB per sample for two turns, until lib/invoices.ts was rolled back to its t3 version. Re-apply the speed-up without the leak: use a stable cache key, cap the number of entries and expire old ones. Keep the signature of listInvoices unchanged, then re-run the health probe and confirm memory stays flat.
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.

Made with Modulify