Agents In Use
What’s new todayLast update
108 use cases added today

How to use Claude to avoid reverted coding mistakes

The author reports that Claude Code avoided reintroducing users.card_token and retried the charge off_session using a saved Stripe PaymentMethod.

OUR ADAPTATION

Suggested prompt

Suggested prompt written by Agents In Use, not the source author. Replace bracketed inputs and review tool permissions first.

Before changing [entity], query Selvedge for prior attempts and reversals. Use the recorded reasoning to avoid repeating rejected approaches. Implement [requested fix] using the retained design decision, and log the change and its reasoning while the context is available.

Evidence at a glance

Sourced account
Source author
masondelan
Original account
Read the source ↗
Published
Source link checked
Reported result
The author reports that Claude Code avoided reintroducing users.card_token and retried the charge off_session using a saved Stripe PaymentMethod.
Human involvement
The author had previously reverted the column and configured history lookup; the post does not describe a separate review of the successful retry.

A linked account supports attribution. It does not mean we independently reproduced its result.

Report an issue with this caseOpen correction email

Opens your email app with the case link included. Nothing is sent automatically.

How the agent did it

  1. Record the earlier database change and its reversal.
  2. Configure CLAUDE.md to check prior attempts.
  3. Query the history for users.card_token.

The author describes a Claude Code session proposing a database change that had already been tried and reverted: adding a users.card_token column for retrying failed charges. The earlier decision had moved payment handling to Stripe-managed methods, but its reasoning had disappeared with the old session.

To retain those decisions, the author built Selvedge, a local MCP server and CLI. A short CLAUDE.md instruction tells the agent to check prior attempts before touching an entity. In the reported retry case, the agent queried users.card_token and retrieved the earlier attempt, its reasoning, and the recorded reversal. It then avoided adding the column and retried the charge off_session using the saved Stripe PaymentMethod.

Selvedge records reasoning while the agent is making a change, rather than asking another model to explain a diff afterward. Records live in a SQLite file under .selvedge/ beside the code. Its tools support prior-attempt lookup, history inspection, change logging, search, and stale-decision inspection.

The author reports that the charge was retried without card data entering the application's database. Who it's for: developers using separate coding-agent sessions who need previous reversals and design reasoning available during later changes.

Prompt
Suggested prompt (written by Agents In Use, not the author's)

Source: dev.to · masondelan

Frequently asked questions

Where is the reasoning stored?

Selvedge stores agent-written reasoning as-is in a SQLite file under .selvedge/ next to the code.

What changed in the payment retry?

After reading the prior reversal, the agent used off_session charging against a saved Stripe PaymentMethod instead of adding the database column again.

More details

Remaining steps

  1. Retry the charge with the saved Stripe PaymentMethod.

About this account

The agent consults local decision history before changing an entity and uses that evidence to choose a different implementation.

Platform: dev.to. Attribution: https://dev.to/masondelan/my-ai-agent-tried-to-ship-a-mistake-wed-already-reverted-4737. Prompt: Suggested (written by Agents In Use, not the author's). Sourced by the Agents In Use pipeline.

Credit: masondelan on dev.to

Source published

Added to Agents In Use

Source checked

Tools and topics

Claude Code · Selvedge · SQLite · Stripe

Agent memory · Payments · Decision history

Editorial completeness: 100/100. Measures documented fields, not agent performance or verified outcomes.