Mason Delan’s team added a card_token column to the users table. Two days later they reverted it — storing card data would drop them into PCI-DSS compliance scope. A month after that, a fresh Claude Code session proposed adding the same column again. The code was gone. The reasoning was gone. The agent had no way to know the team had already paid that lesson.

This isn’t an edge case. It’s the defining defect of current agentic workflows.

The rule is simple: never trust an AI agent’s memory, because it has none. Capture its reasoning live, at the moment of decision, before the session closes.

Git tracks what changed. It does not track why. Commit messages capture intent after the fact — a compressed, human-readable summary that an AI model can’t reliably reconstruct. Pull request descriptions miss the debate, the edge cases discovered mid-implementation, the compliance rationale that made you reverse course. By the next morning, the prompt that guided the last session is gone.

This is where the gap lives. Code persists; intent evaporates.

The solution isn’t a better prompt. It’s a reasoning layer alongside your codebase — a persistent store of what agents intended, not just what they produced. Mason built one called Selvedge: an MCP server that the agent calls as it works. Before touching an entity, the agent checks whether the team has been here before. If it makes a change, it logs the reasoning immediately, using the same context that produced the diff. Not a second model guessing later — the actual decision state, captured live.

You don’t need the tool. You need the principle.

Here’s how to apply it today:

  • Pre-mutation check. Instruct your agent (in CLAUDE.md or equivalent) to query a decision log before modifying any schema, API, or configuration. If a prior attempt exists, surface it.
  • Live capture at decision time. When the agent makes a change, have it write the reasoning to a flat file (SQLite, JSON, Markdown) in the project directory. One record per decision: entity touched, what was tried, why it was adopted or rejected, the date, and the session ID.
  • Surface stale decisions. The hard part. A reverted column may be reverted for good reason — or that reason may expire. Nazar Boyko pointed out in the discussion that a “reverted 28 days ago” might steer an agent away from the best current answer if Stripe is eventually replaced. Armorer Labs suggested a three-field record: what was tried, why rejected, and what evidence would make the rejection stale. Append-only with a status field. That’s the pattern.

The open question isn’t whether to capture reasoning. It’s how to know when a past decision is no longer relevant. Every reasoning log creates its own debt. Superseding outdated entries is the next engineering frontier — and it can’t be solved by asking the agent to reflect on its own logs. That loops back to the same trust problem.

For now, start with the one rule. Before your agent acts on an entity, make it check for prior intent. When it makes a change, make it write the why alongside the diff. The codebase will be safer, the team will stop re-reverting the same mistakes, and you’ll have the foundation for agents that actually learn from past sessions instead of repeating them.