Autopsy

Forensic memory for AI coding agents.
Every failure becomes a guardrail.

Records every action your coding agent takes, autopsies the failures, builds a knowledge graph of why they happened, and injects warnings into the next run's system prompt.

$ curl -fsSL https://install.autopsy.surf/install.sh | bash

Coding agents fail the same way every time.

Every run is a clean slate. Yesterday's lesson is gone. The agent re-discovers the same bugs across every project, on every team, forever.

Exhibit A

Incomplete schema changes

The agent edits a model and ships. The migration is missing. The deploy fails. Next week another agent does the exact same thing in a different repo.

Exhibit B

Frontend / backend drift

Backend types change. Generated frontend types don't. Compilation breaks somewhere downstream nobody noticed.

Exhibit C

Missing test coverage

Code shipped, no test added. The bug surfaces in CI hours later. The agent's already moved on to the next task.

Record. Autopsy. Graph. Preflight.

A four-step closed loop that turns rejected runs into prompt-time warnings for every future run.

01 · Record

Capture every action

A lightweight opencode plugin streams every tool call, file edit, chat message, and rejection into Autopsy in real time. Fire-and-forget, never blocking the agent.

02 · Autopsy

Classify the failure

A deterministic classifier + LLM enhancer extracts FailureModes and FixPatterns from each rejected run.

03 · Graph

Build the memory

Postgres + pgvector store a project-scoped graph of tasks → runs → failures → fixes, with temporal decay and counter-evidence dampening.

04 · Preflight

Warn the next run

When the agent starts a new task, Autopsy retrieves similar past failures and injects a warning into its system prompt, or blocks the tool call entirely.

Built deep, end-to-end.

Not a logging tool. Not a wrapper. A real, end-to-end agent infrastructure layer with retrieval, prevention, and a live dashboard.

Real-time recorder

Captures the live opencode event bus: tool calls, edits, chat, permissions, rejections. Fire-and-forget batched bus that never blocks the LLM stream.

Deterministic classifier

Rule-based pipeline detects schema changes, frontend drift, missing tests, regressions, and more. Augmented by a Gemma LLM pass for semantic depth.

Failure graph

Postgres + pgvector. Project-scoped, temporally decayed, counter-evidence dampened. Hybrid ANN + 3-hop graph walk in ~10ms warm.

Preflight injection

On every chat turn, Autopsy retrieves similar past failures and injects a warning into the system prompt. On every tool call, it can block if the risk crosses a threshold.

Postflight checks

After every code-mod tool, Autopsy runs lint, typecheck, and tests. Failures are folded back into the graph as real rejections so the next run gets warned.

Live dashboard

Next.js + SSE. Timeline of every event, autopsy report on every run, force-graph view of the failure graph, and a badge when Autopsy caught something before it failed.

Project-scoped memory

Every project gets its own isolated graph. Lessons from monolith X never leak into greenfield Y, and team-wide patterns surface where they belong.

Multi-rejection recovery

Reject mid-run as many times as you need. The agent reads the autopsy and tries again on the same thread, no session restart, no context lost.

165+
tests passing
~10ms
warm preflight
3-hop
graph traversal
740×
cache speedup

One command. Zero config.

From the root of your opencode project. Re-run anytime to update.

$ curl -fsSL https://install.autopsy.surf/install.sh | bash