Provenance for agent-written code
Every line of agent code, explained.
git blame tells you an agent wrote it. Cerebral tells you why — the task, the prompt, the reasoning, the decisions.
Return null instead of throwing
- Task
- A rejected refresh should mean “sign in again”, not a 500 on every page.
- Prompt
- “The API went down for four minutes and the whole app went with it.”
- Reasoning
- First attempt threw a typed AuthError. Every one of the four call sites caught it and did the same thing — redirect to sign-in — so the type bought nothing and one missed catch was still a 500.
- Decision
- Swallow the failure and return null. One branch at each call site, and an unreachable API reads the same as a bad token.
Lines 18, 21–23 · refresh.ts · snapshot on main
BATCH = 96 def embed_batch( texts: list[str], model: str = EMBED_MODEL,) -> list[list[float]]: out: list[list[float]] = [] for i in range(0, len(texts), BATCH): out.extend(embed(texts[i : i + BATCH], model)) return outThe problem
That’s all blame gives you now.
Not what you asked for. Not what it tried first. Not why it landed here.
Three things
Blame that answers “why”
Click a line. See the task, the reasoning, and the decision behind it.
Replayable history
Every prompt, tool call, and diff — step by step, not just the end result.
Real git underneath
Snapshots are real commits in your repo. Nothing proprietary. Delete Cerebral, keep your history.
How it works
One hook, then it’s just git.
Connect your repo.
Your agent works. Cerebral records each step as a git snapshot.
Open any file. Every line traces back to a decision.
Works with
Hooks only. No workflow change.
Also
- Human and agent tasks in one place
- Approval and QA gates mid-run
- Local-first