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
    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught megemma

    Five Gemma-4 models, one accelerator: what porting E2B 31B to AWS Inferentia2 taught me

    I ported the whole Gemma-4 family — E2B, E4B, 12B, 31B, and the 26B-A4B MoE — to run on...

    X
    xbill
    Hey DEV, I'm Tobore. Let's actually connect.community

    Hey DEV, I'm Tobore. Let's actually connect.

    Hey DEV, I'm Tobore. Let's actually connect. I've been on here for a while now, mostly writing and...

    L
    Laurina Ayarah
    I burned through thousands of AI tokens. Then a friend did it for freeai

    I burned through thousands of AI tokens. Then a friend did it for free

    (yep, kinda clickbait, just for the funsies 😊) At the beginning of the year, I relaunched my...

    P
    Paulo Henrique
    Claude might be saturating your machineai

    Claude might be saturating your machine

    My laptop was sitting idle with the fan at full tilt. Nothing was running that I knew of. The culprit...

    S
    Sidhant Panda
    Automated GitHub Code Reviews Using Google Geminigithubactions

    Automated GitHub Code Reviews Using Google Gemini

    I Built a Thing! TL;DR — Google Gemini-based Pull Request reviews and Issue Triaging for...

    D
    Darren "Dazbo" Lester
    What is an "agentic harness," actually?ai

    What is an "agentic harness," actually?

    I've been hearing the word "harness" thrown around a lot lately. I assumed it just meant "the IDE" or...

    T
    Tilde A. Thurium

    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.

    Neura Market

    Custom AI Systems & Services

    Our team of experienced AI builders will help build custom AI systems, workflows, and solutions for your business.

    Request custom work

    Ready-made automations for this

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

    • Automatic Background Removal for Images in Google Driven8n · $14.99 · Related topic
    • Automate Image Background Removal and Log Results in Google Sheetsn8n · $14.99 · Related topic
    • Automate Daily Photo Background Removal with Photoroom and Google Driven8n · $9.99 · Related topic
    • Automate Background Removal for WooCommerce Product Images Using Google Sheets and BackgroundCut APIn8n · $9.99 · Related topic
    Browse all workflows