My AI agent tried to ship a mistake we'd already reverted —…
    Neura MarketNeura Market/Stable Diffusion
    ChatGPTChatGPTClaudeClaudeGeminiGeminiCursorCursorGrokGrokPerplexityPerplexityStable DiffusionStable Diffusion
    DeepSeekDeepSeekCoPilotCoPilotMidjourneyMidjourney
    View All Directories
    OverviewPromptsBlogVideosGuidesCoursesCommunityModelsLoRAsComfyUI WorkflowsTrending
    Stable DiffusionBlogMy AI agent tried to ship a mistake we'd already reverted
    Back to Blog
    My AI agent tried to ship a mistake we'd already reverted
    ai

    My AI agent tried to ship a mistake we'd already reverted

    Mason Delan July 6, 2026
    0 views

    A month ago we added a card_token column to the users table so a background job could retry failed...

    A month ago we added a card_token column to the users table so a background job could retry failed Pro charges. It lasted about two days. Storing card data in your own database drops you into PCI-DSS (the compliance standard that kicks in the moment card data touches your systems), so we pulled it and moved to Stripe-managed payment methods.

    Last week the charges started failing again. New Claude Code session, no memory of any of that. Its plan? Add a card_token column to users and retry.

    I don't really blame the agent. It had the context the first time and it was right. The problem is that context died when the session closed. That's the part I never see mentioned about building with agents: the code sticks around, the reasoning doesn't. People leave a trail without trying. A commit message, a PR comment, the Slack thread before it. Agents don't, and the prompt that explained everything is gone by morning.

    So I built Selvedge to hold onto the reasoning.

    What happened the second time

    Selvedge is a local MCP server the agent calls as it works. There's a four-line block in our CLAUDE.md that says, roughly: before you touch an entity, check if we've been here before.

    $ selvedge prior-attempts users.card_token
    
      users.card_token
      Prior attempt   28 days ago  (reverted after 2 days)
      Reasoning       Added to store card tokens for one-click retries.
      Outcome         REVERTED — kept card data out of our own DB to stay
                      clear of PCI-DSS scope; moved to Stripe-managed methods.
    

    So it didn't add the column. It charged off_session against the saved Stripe PaymentMethod instead. Charge retried, no card data in our database, done. We paid for that lesson once.

    That question — how do you stop an AI coding agent from repeating a mistake it already made and reverted — is the whole reason prior_attempts exists. There's a longer teardown with the raw JSON shapes at selvedge.sh/prior-attempts.

    How it works

    The agent writes down why live, in the moment, from the same context that made the change. That's the whole trick. A lot of the "git blame for AI" tools take your diff afterward and ask a second model to explain it. That's a guess. It reads well, but you can't really build on it. Selvedge stores what the agent actually meant, in its own words.

    It's 8 tools, over MCP and as a plain CLI: prior_attempts, blame, diff and history for reading the past; log_change to record a change; and changeset, search and stale_decisions for working with what's stored. Data sits in a SQLite file under .selvedge/ next to your code. No account, no telemetry, no network calls in the core, and zero LLM calls in that core path (on purpose). Your reasoning text is whatever the agent wrote, stored as-is.

    You don't have to be a "real" engineer for this to pay off. If you can run pip install and paste four lines into a file, you're set:

    pip install selvedge
    selvedge setup
    

    New in v0.3.9

    selvedge export --format agent-trace writes your history out as Agent Trace v0.1.0, the open attribution format from Cursor and Cognition AI — and selvedge import reads it back, so your history round-trips instead of being stuck inside Selvedge. Export it, hand it to another tool, import it back. Selvedge does the live capture; the format is shared.

    Try it

    pip install selvedge && selvedge setup
    

    If you've ever reopened your own AI-built project and thought "wait, why did I do it like this," that's the whole pitch. git blame tells you what changed and when. Selvedge tells you why, after the session and the model that wrote it are both long gone.

    selvedge.sh · pip install selvedge · github.com/masondelan/selvedge

    I'm building this in the open. If you run it and it breaks, I want to hear about it.

    Tags

    aillmdevtoolspython

    Comments

    More Blog

    View all
    Context bankruptcy: The case for strategic forgetting for AI Agentsai

    Context bankruptcy: The case for strategic forgetting for AI Agents

    Most of us have seen a coding agent fail to complete a task we know it can do. We just don't...

    J
    James O'Reilly
    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestrationgooglecloud

    Parallel Compliance Engine: Drive-to-Sheets Multi-Agent Orchestration

    When building Generative AI applications, developers often encounter a massive bottleneck: sequential...

    A
    Aryan Irani
    Is It Ethical to Post and Ask About Circuits on Dev.to?discuss

    Is It Ethical to Post and Ask About Circuits on Dev.to?

    I’ve been thinking about sharing some electronic circuit posts on Dev.to — small circuits, DIY...

    C
    codebunny20
    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limitsagents

    The One-Click Exporter: AI Studio Antigravity, Probed to Its Limits

    What nobody tells you about exporting your multi-agent prototype to a local workspace. Every...

    L
    leslysandra
    Guarding the till while autonomous data agents do the diggingagenticarchitect

    Guarding the till while autonomous data agents do the digging

    Autonomous agents are genuinely good at answering messy business questions. Give one an LLM and a set...

    S
    Sireesha Pulipati
    Return on Attention: Why AI Code Reviews Are Wearing Us Outai

    Return on Attention: Why AI Code Reviews Are Wearing Us Out

    PR volume went up, ticket quality didn't, and the gap got filled with LLMs on both sides of the review: bots reviewing, bots replying, bots occasionally arguing with bots about priorities that only existed in a teammate's head. Our CEO named the actual problem, and it's bigger than code review.

    C
    christine

    Stay up to date

    Get the latest Stable Diffusion prompts, rules, and resources delivered to your inbox weekly.

    Neura Market LogoNeura Market

    Discover the best AI prompts, plugins, and resources for Stable Diffusion and more.

    Content Types

    • Rules
    • Prompts
    • MCPs
    • Agents
    • Guides

    Platforms

    • ChatGPT Directory
    • Claude Directory
    • Gemini Directory
    • Cursor Directory
    • Grok Directory
    • Perplexity Directory
    • DeepSeek Directory
    • CoPilot Directory
    • Stable Diffusion Directory
    • Midjourney Directory
    • All Directories

    Resources

    • Blog
    • Documentation
    • Help Center
    • Marketplace

    Legal

    • Privacy Policy
    • Terms of Service

    © 2026 Neura Market. All rights reserved.

    |

    Not affiliated with any AI platform vendors.

    Ready-made automations for this

    Workflows from the Neura Market marketplace related to this Stable Diffusion resource

    • Effortless Background Removal for Google Drive Imagesn8n · $13.14 · Related topic
    • Automate WooCommerce Product Image Background Removal via API & Google Sheetsn8n · $24.99 · Related topic
    • AI Image Background Remover with Google Sheets Trackingn8n · $14.99 · Related topic
    • Automate Photo Background Removal with Photoroom API & Google Driven8n · $14.99 · Related topic
    Browse all workflows