Free guide · Plan before code
Paid once. Shipped twice.
Payment services sometimes send the same “paid” message more than once. If nobody told your AI, your app may pack, email or ship that order twice. Google has open-sourced a free plugin that makes your AI plan first and lets fresh AI reviewers poke holes in the plan. Here’s how to install it, and the prompt to paste.
Why the order shipped twice
In our reel (a cartoon skit, so the candle shop and its customers are made up), a founder finds that every customer got two candles after paying for one. Claude, the AI that built his shop, owns up: “The payment message came in twice… so I packed every order… twice.”
The shop is invented, but repeated payment messages are real. When someone pays, a service like Stripe sends your app a short message that says the payment went through. Developers call it a webhook. Stripe’s own docs warn: “Webhook endpoints might occasionally receive the same event more than once.” If a message doesn’t get through, Stripe keeps trying for up to three days in live mode.
So a well-built app remembers which payments it has already handled and skips the repeats. Stripe suggests exactly that: log the IDs of the events you’ve processed, “and then not processing already-logged events.”
Why the AI didn’t plan for it
An AI coding tool builds what you describe. “When someone pays, pack the order” is a clear request, and it gets built exactly as asked. The question “what if the same payment message arrives twice?” never came up, so nothing in the code handles it. As Claude says in the reel: “You never asked! So… I did it twice.”
Repeated messages are one example. The same gap shows up whenever a plan assumes things go right the first time: a message arrives late, a step fails halfway, two people click at once.
Ask your app one question
If your app takes payments, open the AI tool that built it and paste this. You don’t need to read any code.
If my payment service sends the same "payment succeeded" message twice, what does my app do? Show me the exact place in my code that stops it from handling the same payment twice, and explain it in plain English.
A good answer points to a check like “we save each event’s ID and skip any ID we’ve seen”. If the answer is vague, or the AI starts writing a fix straight away, treat it as a no and keep reading.
The fix: Google’s Elephant-Goldfish Model
The Elephant-Goldfish Model (EGM for short) is a free plugin for coding agents, the AIs that write and run code on your computer, like Claude Code or Codex. Its motto is “Design with an elephant. Review with a goldfish.”
- The elephant is your usual AI. It remembers your project and the whole chat, and it writes the plan.
- The goldfish are fresh AI reviewers. In Google’s words, they read the plan “without the earlier conversation, helping expose unstated assumptions and blind spots.” They never heard you say “it’ll be fine”, so they ask the awkward questions.
- You make the calls and approve the plan before any code is written.
Its own getting-started example is about this very problem: adding payment-style messages to an app, and deciding “what should happen when a delivery fails, or the same event arrives twice?”
- Made by
- Google Open source; “not an officially supported Google product”
- Licence
- Apache 2.0 Free to use, change and share
- Price
- Free Running it uses your AI plan
- GitHub stars
- About 15,000 Checked November 9, 2026
Step 1: Install it
Open a terminal (the window where you type commands) and run the two lines for your tool, one after the other.
Claude Code:
claude plugin marketplace add google/elephant-goldfish-model
claude plugin install egm@egm
Codex (the command-line version):
codex plugin marketplace add google/elephant-goldfish-model
codex plugin add egm@egm
Both pairs of lines are from the EGM README. It also lists a published plugin for the ChatGPT and Codex desktop apps, and setup for Antigravity, Claude Cowork and ChatGPT Work.
Start a new session after installing. In Claude Code, the plugin’s commands start with /egm:, for example /egm:egm-brainstorm. In Codex, pick the EGM skill from the skill list instead.
Using Cursor, GitHub Copilot or OpenCode? Support for those arrived in version 0.1.1 and is marked “experimental”. Building in Lovable or another browser tool? It can’t install plugins, but you can still paste the question above into its chat.
Step 2: Paste the prompt
This one is for Claude Code. In Codex, choose the brainstorm skill first and paste everything after /egm:egm-brainstorm. It asks your AI to plan how your shop handles payments, then lets the goldfish question the plan before anything changes.
The prompt
/egm:egm-brainstorm Look at how my app handles payments and orders. I'm not a developer, so explain everything in plain English. Questions I need answered before we change anything: 1. What happens if the payment service sends the same "payment succeeded" message twice, or a day late? 2. What happens if a step fails halfway, for example the payment is saved but the order isn't? 3. What happens if a customer clicks "Pay" twice? The goal: each payment is handled exactly once. For example, save each message's ID and skip any ID that was already handled. Don't change any code yet. Ask me before you decide anything about refunds, emails or stock.
What happens next
-
You talk it through
Your AI asks you questions, and fresh reviewers challenge the idea. The agreed direction is saved in a file called
concepts_brief.md. -
It writes the plan
Type
/egm:egm-draft. The AI turns the brief intodesign_draft.mdand stops after each section so you can comment. -
The goldfish review it
Type
/egm:egm-review design_draft.md(use the file name your AI gives you). Fresh reviewers check the plan in five stages. You choose which of their points to fix. -
Then build it
When you’re happy with the plan, ask your AI to build it.
Step 3: Check it worked
EGM checks the plan. Testing the finished app is still your job, so ask your AI for a test that proves it:
Write a test that sends the same test-mode "payment succeeded" message to my app twice, and check that only one order is created and only one email is sent. Run it and show me the result in plain English.
Then make one real purchase in your payment service’s test mode and look at your orders: one payment, one order.
Honest catches
-
It reviews plans, it doesn’t fix bugs
Google says it plainly: “A review does not replace tests or human judgment.” If your app is already live, use the question above to find the problem, then plan the fix with EGM.
-
Your AI tool must be able to start fresh helpers
The goldfish are separate AI sessions. “If your agent cannot create them, EGM stops the review.” Claude Code and Codex can; the setup notes list the rest.
-
It’s young, and it’s not an official Google product
The first release came out in October 2026. The README says “This is not an officially supported Google product”, so expect changes, and read what it suggests before you approve it.
The reel ends with Claude saying “I only do what I’m asked.” So before your AI builds anything that touches money, ask it what could happen twice.
AnyCreo is in beta · Free while in beta
Get your app right the first time
AnyCreo plans, builds, tests and secures your app on your PC, with the AI plan you already have. You don't have to ask for security or testing. Join the beta list for your invite.
We only email you about AnyCreo. Unsubscribe any time. Privacy · What is AnyCreo?
Follow AnyCreo
Cartoon skits about building apps with AI, and the free fix when it breaks.
Credits and sources
Elephant-Goldfish Model by Google (github.com/google/elephant-goldfish-model), Apache License 2.0. It is based on Dave Rensin’s essay. The short quotes on this page come from the EGM README, its setup notes and release notes, and from Stripe’s docs. Everything else is in our own words. The reel is a cartoon skit: the shop, its orders and its customers are made up. We haven’t run EGM on a real shop; the review question in the reel is an example of the kind of question its reviewers ask.
Sources, all opened and checked on November 9, 2026:
- [1] Google, elephant-goldfish-model README on GitHub: what the elephant and goldfish do, the install lines, the webhook example, “five stages”, the limits, Apache 2.0, about 15,000 stars.
- [2] Google, EGM v0.1.1 release notes (November 6, 2026): “experimental Cursor, OpenCode V1, and GitHub Copilot adapters”.
- [3] Google, EGM setup notes: which AI tools can start the fresh reviewers.
- [4] Stripe docs, Receive Stripe events in your webhook endpoint: duplicate events, logging event IDs, retries for up to three days in live mode.
EGM is licensed under the Apache License, Version 2.0. This page quotes it and links to it; it doesn’t copy its code. This site’s fonts, Bricolage Grotesque and Geist, are used under the SIL Open Font License (Bricolage Grotesque licence, Geist licence).