Built for opencode & Devin

Autopsy

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

Autopsy records every action your coding agent takes, autopsies the failures, builds a graph of why they happened, and injects warnings into the next agent's system prompt, so it doesn't make the same mistake twice.

The problem

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 migration bug, the same type drift, the same missing test, across every project, on every team, forever.

!

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.

!

Frontend / backend drift

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

!

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.

How it works

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 if the risk is high enough.

What's in the box

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 the call if the risk crosses a threshold.

Postflight checks

After every code-mod tool, Autopsy automatically runs lint, typecheck, and tests. Failures are folded back into the graph as a real rejection 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 whole failure graph, and a green 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

Get started

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