Category: Practical Guides

  • AI Image Generation Cost in 2026: Nano Banana Pro Pricing, GPT Image and FLUX Per-Image Rates

    Generating one AI image costs between $0.008 and $0.607 as of November 19, 2026[1][2]. That is a spread of more than seventy times for the same single picture. The company you pick matters less than which model you call and what resolution you ask for.

    Most of the time that number stays hidden behind a monthly subscription. When you generate a picture in ChatGPT or the Gemini app, you never see what the image cost. You only see a message when you hit a limit. The developer price lists published by the same companies do show it, down to fractions of a cent, and those numbers say what a subscription is actually buying.

    Every figure below comes from the official pricing pages, opened and read on November 19, 2026. Prices change often, so check the links again before you pay for anything.

    Resolution and model set the price

    Image services bill by resolution tier, written as 1K (around 1,024 pixels on a side), 2K and 4K. The cheapest combination available today is Black Forest Labs’ FLUX 3 Image Klein at 768×768 pixels: $0.008 per image[2]. The most expensive is the same company’s FLUX 3 Image at 4K: $0.607. On Google’s side, Nano Banana 2.1 runs $0.0336 for a 1K image, while the higher-end Nano Banana Pro costs $0.134 for 1K or 2K[1].

    At a hundred images those gaps turn into real money: $0.90 for Klein at 1K, $3.36 for Nano Banana 2.1, $13.40 for Nano Banana Pro, and $60.70 for FLUX 3 at 4K[7].

    Per-image price by model and resolution
    Per-image price by model and resolution

    What a per-image price covers

    A listed price describes one request that produced one usable image. In real work you often generate five or six to keep one, which multiplies the bill by the same factor. Retry count moves the total more than the unit price does.

    The three companies count different things along the way. Google does not charge for the interim “thought images” a model produces while working out a composition, and it counts a reference image you supply as 560 tokens, about $0.0011[5]. You can mix up to 14 reference images. Black Forest Labs includes prompts and reference images at no extra charge, and does not bill for failed generations or for images its safety filter blocks before delivery[2]. OpenAI adds 100 output tokens per preview frame if you switch on the setting that streams a rough version while the image renders[4].

    Resolution is counted differently from one company to the next. Black Forest Labs bills by the tier named in the request and spells out the pixel count of each tier: 768×768 is roughly 0.6 megapixels, 1K about 1, 1.5K about 2, 2K about 4, and 4K about 16[2]. So 4K costs 12.6 times what 1K costs because it holds sixteen times the pixels, not because the unit price rose. Per megapixel, 4K works out to $0.038 against $0.048 for 1K[7].

    Google prices images by output token

    Google treats an image as a bundle of tokens, the units a model uses to count text or pixels, and charges per million of them. Nano Banana 2.1 bills image output at $30 per million tokens, and a 1K image consumes 1,120 tokens, a 2K image 1,680, a 4K image 3,780[1]. Multiply those out and you get the $0.0336, $0.0504 and $0.113 printed on the page (the last one rounded from $0.1134).

    Google image model (paid tier, standard) 1K 2K 4K Notes
    Nano Banana 2.1 $0.0336 $0.0504 $0.113 Batch is half: $0.0168 / $0.0252 / $0.0567
    Nano Banana 2 (Gemini 3.1 Flash Image) $0.067 $0.101 $0.151 Adds 0.5K (512px) at $0.045
    Nano Banana 2 Lite $0.0336 not listed not listed Low latency tier, batch $0.0168
    Nano Banana Pro (Gemini 3 Pro Image) $0.134 $0.134 $0.24 Input image counted at $0.0011
    Nano Banana (Gemini 2.5 Flash Image) $0.039 not listed not listed Shuts down March 15, 2027

    Every number in that table is from Google’s pricing page[1]. Nano Banana Pro sits at $120 per million output tokens, four times the 2.1 rate, and spends 1,120 tokens on a 1K or 2K image and 2,000 on a 4K one, which is why its 1K and 2K prices are identical at $0.134 and only 4K rises to $0.24[1].

    Picking by version number can cost you money. Nano Banana 2.1 is the successor to Nano Banana 2, and it is cheaper at 1K: $0.0336 against $0.067, because Google cut the token rate from $60 to $30 per million[1]. At 4K the gap narrows, since the two models spend different amounts on the same resolution, 3,780 tokens for 2.1 and 2,520 for 2[1]. The older model also keeps one thing 2.1 lacks: 512-pixel output[5].

    FLUX prices images by resolution tier

    Black Forest Labs publishes a straight per-image number instead of a token rate, so there is nothing to calculate[2].

    FLUX model (API) 768×768 1K 1.5K 2K 4K
    FLUX 3 Image $0.041 $0.048 $0.07 $0.10 $0.607
    FLUX 3 Image Klein $0.008 $0.009 $0.011 $0.014 $0.036

    Those rates and the editing rates below are from the company’s price list[2]. Editing is priced on its own table: FLUX.1 Kontext comes in a standard version at $0.04 per image and a premium one at $0.08, while tools such as outpainting (extending a background past its original edge) and erase (removing an object) are billed by the megapixel of the result.

    OpenAI no longer publishes a per-image price

    OpenAI’s current image models, GPT Image 2.6 in its Sunburst and Flare variants, have no per-image figure on the pricing page. The page lists token rates instead: $30 per million image output tokens, $8 per million image input tokens, $5 per million text input tokens[3]. Quality has five settings (low, medium, high, xhigh, max), and the documentation notes that token counts can differ between models at the same quality setting[4]. Token counts for a given combination appear only in a calculator embedded in the docs, which is drawn in JavaScript and could not be read as text.

    The previous generation still shows the range. Through GPT Image 2, OpenAI published a per-image table for 1024×1024: $0.006 at low quality, $0.053 at medium, $0.211 at high[4]. Low to medium is nearly a ninefold jump, medium to high is four times[7]. The quality switch drives the bill more than anything else. Those are last-generation numbers, so for current models the only reliable figure is the token usage returned with each response.

    The three price lists differ in how much they tell you up front. Google and Black Forest Labs publish the cost before you spend it, while OpenAI shows it afterwards. The smaller your volume, the harder it becomes to predict a monthly bill.

    A monthly subscription buys a usage limit

    What most people actually pay is an app subscription. Google lists its Korean prices in won on the official page, the version that was readable: free at ₩0, Google AI Plus at ₩7,500 a month (about $5.63) for twice the free usage limit, and Google AI Ultra at ₩119,000 (about $89) for five times the AI Pro limit or ₩300,000 (about $225) for twenty times that same AI Pro limit[6][7]. The free tier includes image generation and editing plus limited access to Nano Banana Pro. Google AI Pro, the tier in between, is described as four times the free limit, but no amount appeared in the page, so it is left blank here.

    Divide a subscription by a per-image price and you can see what kind of number it is. The ₩7,500 tier covers 168 images on Nano Banana 2.1 at 1K, or 42 on Nano Banana Pro. The ₩119,000 tier covers 667 Pro images or 2,658 on 2.1[7]. Real in-app limits are different and are not published, but the comparison shows that a subscription prices a monthly allowance rather than marking up a unit cost. Generate a few dozen images a month on a top tier and most of what you paid for goes unused.

    Subscription prices divided by per-image cost
    Subscription prices divided by per-image cost

    ChatGPT and Midjourney subscription prices are missing here. Both official pricing pages (openai.com, midjourney.com) refuse automated requests, so there was no primary source to quote. For monthly plan comparisons checked in October, see ChatGPT vs Claude vs Gemini plan pricing.

    The free options and what they cost you

    Google AI Studio (aistudio.google.com) is free to use in every supported region[1]. You pick a model in the browser, type a prompt, and get a result without entering payment details. For a first comparison of image models, that is the cheapest place to start.

    The free tier of the API is another matter: it carries no image models at all. For both Nano Banana 2.1 and Nano Banana Pro, the free tier column reads “Not available”[1]. The same table says data sent through the free tier is used to improve Google’s products, and that paid-tier data is not. That line is worth reading before you upload company material or someone else’s face. On what not to put into a chatbot at all, see using AI without giving away your data.

    Price aside, generated images arrive with a marker attached. Google states in its documentation that every image produced by Gemini includes a SynthID watermark, a signal embedded in the pixels rather than a visible logo[5]. If the picture is going into a blog post or an ad, that marker goes with it.

    Running open-weight models yourself

    Some FLUX models ship their weights, the numbers a model learns during training, so you can download them and run the model on your own machine instead of calling a server. The Klein and dev lines work this way. Run them yourself and the per-image charge disappears, leaving electricity and hardware. Klein is published at a size that fits on a single consumer graphics card, 5.6 billion parameters[2].

    Commercial use is licensed separately. Black Forest Labs sells self-hosting licenses by monthly volume and domain count: the Builder tier covers 10,000 images a month, one domain and ten licensed users; the Platform tier covers 100,000 a month; anything larger is priced by the sales team[2]. A non-commercial license exists on its own terms. Hobby use and company use fall under different agreements, so read the license first if the output is going into a product.

    Checklist

    • Draft on the cheap combination. There is no reason to spend $0.134 per image while you are still testing composition. Work in the $0.008 to $0.0336 range and save the expensive model for the final version.
    • Do not leave 4K as a default. It is 12.6 times the cost of 1K on FLUX 3 and 3.4 times on Nano Banana 2.1[7]. For anything viewed on a screen, 1K is enough.
    • Send bulk jobs through batch processing, where you submit many requests at once and collect the results later instead of waiting. Google’s batch rate is exactly half[1].
    • Do not read the version number as a price. Nano Banana 2.1 is $0.0336 per 1K image; Nano Banana 2 is $0.067.
    • Count how many images you actually generate per month before picking a tier. The ₩7,500 plan covers 42 images on the Pro model.
    • Start on Google AI Studio if you just want to compare models, and read the line about free-tier data being used for product improvement before you upload anything sensitive.
    • For work use, check the watermark and the license before paying. Google images carry SynthID, and commercial use of open-weight models is a paid license.
    • For how token pricing works in general, see how AI pricing is counted in tokens.

    Both tables on this page will be updated when the price lists change.

    References


    Notes

    1. Gemini API pricing page, read November 19, 2026. Token rates and per-image equivalents for Nano Banana 2.1 ($30 per million output tokens; 1,120 / 1,680 / 3,780 tokens), Nano Banana 2 ($60 per million; 747 / 1,120 / 1,680 / 2,520 tokens), Nano Banana 2 Lite, Nano Banana Pro ($120 per million; 1,120 tokens for 1K and 2K, 2,000 for 4K) and Gemini 2.5 Flash Image; batch rates at half; free tier availability and the data-use column; the note that Google AI Studio usage is free of charge in all available regions. Link ↩
    2. Black Forest Labs pricing page, read November 19, 2026. Per-image prices by resolution tier for FLUX 3 Image and Klein, FLUX.1 Kontext and image tool rates, the billing FAQ (tier-based billing, reference images and prompts included, failed and withheld generations not charged, megapixel count per tier), self-hosting license tiers, and Klein’s 5.6 billion parameters. Link ↩
    3. OpenAI platform pricing page, read November 19, 2026. gpt-image-2.6 Sunburst and Flare at $8 per million image input tokens, $30 output, $2 cached input, $5 text input, and half those rates in batch. Link ↩
    4. OpenAI image generation guide, read November 19, 2026. The five quality settings, the note that token counts can differ by model at the same quality, 100 extra output tokens per partial image, and the legacy per-image table for GPT Image 2 at 1024×1024 ($0.006 / $0.053 / $0.211). Link ↩
    5. Gemini image generation documentation, read November 19, 2026. “All generated images include a SynthID watermark”, up to 14 reference images, interim thought images not charged, 1K/2K/4K support and the 0.5K option limited to Gemini 3.1 Flash Image. Link ↩
    6. Gemini subscription page with country set to Korea, read November 19, 2026. Free tier at ₩0 with limited Nano Banana Pro access, Google AI Plus at ₩7,500 (2× the free limit), Google AI Pro listed at 4× with no price rendered, Google AI Ultra at ₩119,000 (5× AI Pro) and ₩300,000 (20× AI Pro). Link ↩
    7. Hundred-image totals, per-megapixel rates, quality-step ratios, dollar conversions of the Korean subscription prices and the images-per-subscription figures were calculated from the published rates above, using the European Central Bank reference rate of 1,332.33 won to the dollar on November 18, 2026. Link ↩

    Source: https://ai.google.dev/gemini-api/docs/pricing

  • How to Restore Old Photos with AI: Scan Settings, Prompt Order, and Where the Resolution Goes

    Dustin Podell of Black Forest Labs, the lab behind the FLUX image models, named photo restoration as one use his team never planned for. Speaking on the Latent Space podcast episode released on November 16, 2026, he said the lab saw “a ton of people taking old, degraded family photos and then restoring, colorizing them, fixing them up,” and that the model “was able to keep a very, very high level of similarity to what the original would’ve been.” Watching people show those restored pictures to their families, he added, was his favorite thing to come out of the work[1].

    If you have a shoebox of faded prints and want to try the same thing, the order of operations matters more than which tool you pick. Everything below comes from vendor documentation and US preservation guidance checked on November 17, 2026. I did not pay for the commercial tools and run a restoration, so there is no quality comparison here. The question this answers is where the resolution goes, using the input and output limits each service publishes.

    The scan sets the ceiling

    An editing model fills in what is no longer legible with something plausible. A thin scan gives it less to work from and more to invent.

    The Federal Agencies Digital Guidelines Initiative (FADGI), a group of US federal agencies that publishes shared digitization standards, sets four star levels for photographic prints in the third edition of its Technical Guidelines for Digitizing Cultural Heritage Materials. The recommended sampling frequency runs 200 ppi at one star, 250 ppi at two, 400 ppi at three, and 600 ppi at four. Pixels per inch (ppi) is the same number your scanner calls dpi. Preservation masters go to TIFF or JPEG 2000, and the top level asks for 16-bit color even when the original is black and white. A footnote adds that “in rare cases, resolutions higher than 600 ppi may be needed to resolve fine details”[2].

    A consumer flatbed will do 600 ppi, which produces files of these sizes.

    Print size 300 ppi 600 ppi
    3.5 × 5 in 1,050 × 1,500 (1.6 MP) 2,100 × 3,000 (6.3 MP)
    4 × 6 in 1,200 × 1,800 (2.2 MP) 2,400 × 3,600 (8.6 MP)
    8 × 10 in 2,400 × 3,000 (7.2 MP) 4,800 × 6,000 (28.8 MP)

    Source: print dimensions at the FADGI sampling frequencies[2]

    Take a group shot on a 4 × 6 print where one person’s head is 12 mm tall, just under half an inch. At 300 ppi that face lands in 142 pixels. At 600 ppi it gets 283. That gap is how much the model has to work with when you ask it to bring the face back.

    Leave the scan file alone

    FADGI is blunt about the master file: “Color, tone enhancement or restoration is not allowed on master images.” Corrections belong in access versions, and the guidance asks that they be noted in embedded metadata and file naming. Even removing dust that sat on the scanner glass is off limits in the master[2]. Once a file has been corrected, it no longer records what the photograph looked like.

    The US National Archives makes the same point for family collections: “Keep your originals after you digitize them, because digital files have their own preservation risks and can easily be lost.” It also warns that automatic feed scanners “are not suitable for fragile, weak, bent, or valuable papers,” and says to check that the original fits entirely on the scanner bed[3].

    Handling guidance is published too. The Library of Congress says to handle prints with clean hands or clean nitrile gloves, to avoid touching the image area, and never to put tape or sticky notes on a photograph[4]. The National Archives goes further and asks for gloves on photographs and negatives, because fingerprints leave permanent stains[3]. FADGI allows holding a curled print flat under glass, but only when flattening will not crack the emulsion, and it says tightly curled material must not be forced[2].

    Each tool accepts a different size

    Three families of editing models are usable for this. The numbers below come from each vendor’s own documentation. The 1K, 2K and 4K labels are output size tiers: roughly one megapixel (about 1,024 × 1,024), four megapixels and sixteen megapixels[5].

    Tool Reference images Output size Price
    Gemini app (Nano Banana 2) several supported free accounts download at 1K, Google AI plans at 2K[8] included in the plan; via API, $0.0336 per 1K image and $0.113 per 4K image[9]
    OpenAI image models (GPT-Image-2.5 and 2.6) no stated cap; edit input and mask under 50 MB neither edge above 3,840 px, total 655,360 to 8,294,400 px[11] $30 per million image output tokens[11]
    FLUX 3 Image up to 10[6] 2K and 4K[6] $0.048 at 1K, $0.10 at 2K, $0.607 at 4K[5]
    FLUX 3 Image Klein (open weights) up to 10[7] up to 4K[7] free to run locally, or $0.009 per 1K image via API[5]

    Source: vendor documentation, checked November 17, 2026

    Klein is the open-weights member of the family, meaning the model weights are published for download. Black Forest Labs lists it at 5.6 billion parameters and says it “runs on a single consumer GPU,” distributed through Hugging Face[7]. That is the option if you would rather not upload family photographs to someone else’s server, though it asks for a graphics card and an afternoon of setup. Shrinking a large model to fit a home machine is covered in the guide to quantization.

    The Gemini app carries one more condition. Google states that “to generate and edit images, you must be 18 or over,” and that editing images is not available to users under 18 at all[8].

    A 600 ppi scan is not what the model sees

    Black Forest Labs spells this out on its pricing page: “Reference images up to 16 MP are accepted (larger ones are rejected); images above 4 MP are downscaled to 4 MP before processing.” The company counts one MP as 1,048,576 pixels[5].

    Scan a 4 × 6 print at the recommended 600 ppi and you have 8.6 million pixels. Held to the 4 MP ceiling it becomes 1,672 × 2,508, keeping 70 percent of the long edge. An 8 × 10 scanned at 600 ppi comes to 28.8 million pixels, over the 16 MP limit, and is refused outright. Feeding several reference images shrinks things further. The previous generation, FLUX.2, downscales each reference above 1 MP to 1 MP when more than one is supplied[5], which takes that 4 × 6 scan down to 836 × 1,254.

    Stage Size of a 4 × 6 photo 12 mm face
    600 ppi scan master 2,400 × 3,600 283 px
    after the 4 MP input ceiling 1,672 × 2,508 198 px
    with multiple references on FLUX.2, 1 MP each 836 × 1,254 99 px
    downloaded at 1K on a free account 1,024 long edge 81 px

    Source: calculated from the limits each service publishes

    Where resolution disappears between the scan and the download
    Where resolution disappears between the scan and the download

    Shrink the file yourself before you upload it. The service will cut it down regardless, and doing it at home means the dimensions coming back are ones you picked. Printing the result calls for a paid tier that outputs at 2K or 4K. A free Gemini account caps downloads at 1K, which hands you a file smaller than the scan you worked to make[8].

    Write down what must not change

    A prompt for an editing model works differently from one that asks for a new picture. The edit example Black Forest Labs publishes for FLUX 3 Image spends most of its words on what to leave alone: “Keep the large cresting ocean wave, the overcast and cloudy sky, and the rest of the black and white composition exactly unchanged”[6]. The sample prompts on the FLUX.1 Kontext page run short instead, single sentences like “Remove the thing from her face” or “Tilt her head towards the camera”[12].

    Kontext was the model that first shipped this kind of editing. Podell called the earlier workflow a slot machine: reprompt until something good falls out, or paint over the region you dislike and have the model fill the gap. Keeping the same face across images meant training a small add-on for that one person, a LoRA, on top of the base model[1]. Being able to write “leave this person alone and patch the tear behind them” is what replaced that.

    Carried over to restoration, the prompt becomes four steps.

    1. Name what must survive first: facial features, expressions, the pattern on a dress, lettering in the background.
    2. Name one thing to fix. A tear, a mold stain, a crease, one per pass.
    3. Save colorization for its own pass. Asked to repair and colorize at once, a model does both badly and leaves you unable to tell which instruction went wrong.
    4. Feed a good result back in for the next change. Saving each pass lets you roll back only the one that went sideways.

    How to split a restoration prompt
    How to split a restoration prompt

    Four ways this goes wrong

    Most of the damage comes from four habits.

    Writing the result over the scan file tops the list. A restoration is an interpretation with guesswork in it, which is exactly why preservation bodies keep masters and access copies apart[2].

    Uploading the largest file you have rarely helps. An 8 × 10 scanned at 600 ppi is rejected by FLUX 3[5], and anything that does get through is reduced anyway.

    Throwing in several photographs at once backfires too. Adding other pictures of the same person looks like it should help the face, but with more than one reference some products cut each to 1 MP[5]. Pick one or two that earn their place.

    Last, do not circulate a restoration as though it were the photograph. Send it to relatives without saying what it is, and two forwards later that is the family record.

    What the models cannot do

    The face that comes back is a guess. Podell’s own phrasing was that the model stayed close to “what the original would’ve been”[1]. Detail that is genuinely gone, the real shape of a blown-out eye or the lettering on an unreadable name badge, gets filled with something that looks right. Text inside images is still unreliable, which both guests acknowledged, and Andreas Blattmann, Podell’s co-guest and a co-inventor of the latent diffusion method behind Stable Diffusion, said controllability is the problem the field still has to solve at scale[1].

    Google documents that “all generated images include a SynthID watermark,” an invisible signal mixed into the pixels that software can read back[10]. To check later whether a file went through Google’s models, upload it in the Gemini app and ask whether it was created or edited by Google AI. That runs about ten checks per 24 hours, and it recognizes content from Google’s tools only[13].

    The order, in short

    1. Handle prints with clean hands or nitrile gloves and stay off the image area[4]. Do not force a curled photograph flat[2].
    2. Scan on a flatbed at 600 ppi, 16-bit, to TIFF. Scan black and white prints in color mode[2].
    3. Keep that file as the master and edit nothing in it[2].
    4. Make a copy and shrink it to roughly 2,500 pixels on the long edge, under the 4 MP input ceiling[5].
    5. Prompt one pass at a time, naming what must not change before what should.
    6. Colorize only after the damage is repaired.
    7. Save results under new names and record what was changed[2].
    8. Tell relatives the picture is a restoration when you send it.


    Notes

    1. Latent Space podcast, “Building Visual Intelligence — Andreas Blattmann & Dustin Podell, Black Forest Labs,” released November 16, 2026. Quotes taken from the episode transcript; speaker attribution follows the episode write-up. Episode ↩
    2. FADGI, Technical Guidelines for Digitizing Cultural Heritage Materials, third edition (2023), section 3.8 Prints and Photographs. Guidelines ↩
    3. US National Archives, “Digitizing Family Papers and Photographs” and “Tips for Handling Family Papers and Photographs.” Digitizing guidance ↩
    4. Library of Congress, “Care, Handling and Storage of Photographs.” Guidance ↩
    5. Black Forest Labs pricing page, checked November 17, 2026. bfl.ai/pricing ↩
    6. Black Forest Labs, FLUX 3 Image model page. Model page ↩
    7. Black Forest Labs, FLUX 3 Image Klein model page. Model page ↩
    8. Google Gemini Help, “Generate and edit images with the Gemini app.” Help center ↩
    9. Google AI Studio pricing, Gemini Nano Banana 2.1 section. Pricing ↩
    10. Google AI Studio image generation documentation. Docs ↩
    11. OpenAI image generation guide and API pricing page. Guide ↩
    12. Sample prompts on the Black Forest Labs FLUX.1 Kontext model page. Model page ↩
    13. Google Gemini Help, checking whether content was made with Google AI. Help center ↩

    Source: https://www.latent.space/p/bfl

  • Reasoning models explained — what thinking tokens are, what they cost, and how to set the level

    Ask ChatGPT or Claude something hard and the answer does not come straight away. A “thinking” indicator spins for a few seconds or a few minutes, and during that time the model is writing notes it keeps to itself. OpenAI calls them reasoning tokens; Anthropic and Google call them thinking tokens.

    All three companies bill those notes at the same output-token rate as the answer you actually read[1][2][3]. Estimating a bill from the replies you can see leaves out most of what you are paying for.

    The token counts below come from the three companies’ own documentation, and the cost table is the output of code I ran against their published rates. I tried to call a model directly and count thinking tokens, but the environment this was written in has no API key, so there is no measurement of my own here. Nothing below claims how many tokens a particular question consumes in practice.

    What the model writes before it answers

    A non-reasoning model starts producing the first character of the answer as soon as the prompt arrives. A reasoning model writes something else first, meant only for itself: “the units are mixed, convert to months first”, “that sum was wrong, try again”. Each character a model writes becomes part of the input when it predicts the next one, so writing down an intermediate result lets it build the next step on that result instead of jumping to a conclusion. It is the difference between doing a calculation in your head and doing it on paper.

    OpenAI does not hand back the raw notes and gives a summary only on request. Its documentation states that “while reasoning tokens are not visible via the API, they still occupy space in the model’s context window”, the context window being the total amount of text a model can handle at once[1]. Google also returns summaries only, and its documentation is explicit that you pay for the full thoughts even though the API returns only summaries[3]. Anthropic returns thinking blocks, also in summarized form[2].

    How a reasoning model gets to an answer: hidden thinking tokens and the visible answer bill at the same rate
    How a reasoning model gets to an answer: hidden thinking tokens and the visible answer bill at the same rate

    The sizes the documentation names

    How many tokens the thinking takes depends on the question, but the three companies do publish reference points.

    Stated in documentation Amount Source
    Anthropic, minimum thinking budget 1,024 tokens the API rejects smaller values[2]
    Anthropic, starting point for simple tasks near 1,024 tokens raise it incrementally[2]
    Anthropic, starting point for complex tasks 16,000 tokens or more tune for latency and quality[2]
    OpenAI, range for one response a few hundred to tens of thousands the documentation’s own phrasing[1]
    OpenAI, headroom to reserve 25,000 tokens for reasoning and output combined[1]

    A visible answer usually runs a few hundred tokens. Measured against the 300-token answer used in the cost table below, 16,000 tokens of thinking is 53 times as long, and that comparison is my own arithmetic rather than a published figure.

    Where the money goes

    I put those reference values straight into a price calculation: 1,000 questions, 500 input tokens each, a 300-token visible answer, with only the thinking budget changing. The rates are Anthropic’s published prices[5].

    [Claude Haiku 5.5] input $0.1/M tokens, output $0.5/M tokens
    thinking | cost per 1,000 | thinking's share | multiple of no thinking
           0 |          $0.20 |             0.0% |                   1.0x
       1,024 |          $0.71 |            71.9% |                   3.6x
      16,000 |          $8.20 |            97.6% |                  41.0x
      25,000 |         $12.70 |            98.4% |                  63.5x
    
    [Claude Sonnet 5.5] input $2/M tokens, output $10/M tokens
    thinking | cost per 1,000 | thinking's share | multiple of no thinking
           0 |          $4.00 |             0.0% |                   1.0x
       1,024 |         $14.24 |            71.9% |                   3.6x
      16,000 |        $164.00 |            97.6% |                  41.0x
      25,000 |        $254.00 |            98.4% |                  63.5x

    The same 1,000 questions cost 3.6 times more with 1,024 thinking tokens and 41 times more at 16,000. Run the same arithmetic at Claude Opus 5.5 rates and the 16,000-token row comes to $328 per 1,000 questions[5]. Each figure is one multiplication per token type, then a sum.

    const cost = (m, think) =>
      ((INPUT * m.input + (ANSWER + think) * m.output) / 1e6) * CALLS;

    In the two larger rows of that table, 97% to 98% of the cost is thinking the user never sees. The rows fix the thinking budget by hand, so they are not a forecast of anyone’s invoice; a model often stops well before its budget on easy questions[2]. Absolute figures move with your own answer lengths, while the multiples hold.

    Accuracy stops improving past a point

    “When More is Less”, published at ICLR 2026, one of the main machine learning conferences, reports that accuracy follows an inverted U-shaped curve with respect to chain-of-thought length, meaning how long the model’s internal working runs before it answers. Accuracy rises with length, then falls once the chain gets too long. The optimal length grows with task difficulty and shrinks as model capability rises[6].

    Zhou and colleagues, in the Findings track of ACL 2026, a computational linguistics conference, report that marginal returns diminish substantially at higher budgets and that models exhibit overthinking, where extended reasoning is associated with abandoning answers they had already gotten right. Because the optimal length varies by problem, giving every problem the same budget is wasteful, and stopping at moderate budgets cuts computation while keeping accuracy comparable[7]. Both papers are summarized here from their abstracts and public listings; I did not verify the numbers in the full texts.

    The OckBench authors report that models solving the same problems at similar accuracy can differ by up to 5.0x in token length[8].

    Anthropic’s documentation warns about the same thing. Its guidance table for Claude Opus 4.7 says that on most workloads the highest level adds significant cost for relatively small quality gains, and that on structured-output or less intelligence-sensitive tasks it can lead to overthinking[4].

    The effect is sharper on quantized local reasoning models. A study released in May 2026 found that up to 52% of their failures were cases where the model reached the correct answer mid-chain and failed to commit to it[9].

    The setting that controls how much a model thinks

    Developers pass that setting with each API request, and it has nearly the same shape at all three companies. Only the name and the number of levels differ. The level names are plain English, running from low, which means answer fast with little thinking, up to max.

    Company Setting Levels Default
    Anthropic output_config.effort low, medium, high, xhigh, max high (medium on Opus 5.5 and Haiku 5.5)[4]
    OpenAI reasoning_effort none, minimal, low, medium, high, xhigh, max (some unavailable per model) varies by model[1]
    Google thinking_level minimal, low, medium, high (support varies by model) varies by model, usually on[3]
    What each provider calls the thinking setting, and its levels
    What each provider calls the thinking setting, and its levels

    Google’s documentation suggests minimal or low for fact retrieval and classification, the default for moderate work such as comparing concepts, and maximum thinking for advanced coding, math and multi-step planning[3]. OpenAI suggests none or low for latency-sensitive work such as voice, fast retrieval and classification[1]. Anthropic publishes a recommended starting point per model and tells developers to run a fresh sweep on their own evaluations rather than carrying a level over from an older model[4].

    Chat users work with a narrower version of the same control. Anthropic’s support article puts it in the model menu next to the send button: open the model name, hover over Effort, and there is a Thinking switch, with changes applying from the next response. On Haiku 5.5, Sonnet 5.5, Opus 5.5, Fable 5.1 and Opus 5, that switch cannot be turned off in the app at all. On the API, Opus 5.5 and Fable 5.1 always think, and Sonnet 5.5 rejects requests that disable thinking[10].

    Four common mistakes

    1. Sizing the output limit around the answer alone. Thinking tokens are spent inside the same output budget, so a tight limit can be consumed before the answer starts. Google’s documentation states that the response comes back incomplete in that case and the thinking tokens are still billed[3], and OpenAI’s states that the response has status incomplete and may contain no visible output at all[1].
    2. Trimming the output limit to save money. Google’s documentation recommends lowering the thinking level instead, since a small output cap truncates responses[3].
    3. Running every request at the top level. On classification or extraction there are no steps to work through, so the extra tokens buy latency and cost without a gain. All three companies recommend lower levels for simple tasks[1][3][4].
    4. Changing the level mid-conversation. Anthropic notes that the setting is rendered into the prompt, so changing it invalidates prompt caching, the feature that stores a repeated prefix on the server for reuse. Hold one level for the life of a cached conversation, or use the per-message change that preserves the cache[2][4].

    Checklist

    • Classification, extraction, translation and short summaries belong at the lowest level or on a non-reasoning model. There are no steps to lay out.
    • Math, multi-step planning and debugging are where higher levels earn their cost. Reach for the top level only after measuring that it helps.
    • Estimate cost from total output tokens, not from answer length. Even 1,024 thinking tokens makes the bill 3.6 times larger at the rates used above[5].
    • Set the output limit to cover thinking plus the answer. OpenAI suggests reserving 25,000 tokens[1].
    • Run the same prompt at two levels. If the answers match, keep the cheaper one.
    • In the chat apps, check which level the model menu is on. Current Claude models offer no way to turn thinking off[10].
    • When answers grow long without reaching a conclusion, lower the level or split the question rather than asking for more thinking.

    Related reading: how tokens and API pricing work and what quantization does to a model.

    Notes


    Notes

    1. Reasoning tokens not visible via the API, billed as output tokens, a few hundred to tens of thousands per response, the 25,000-token reserve recommendation, `reasoning_effort` levels, and guidance for latency-sensitive work. Reasoning — OpenAI (checked 2026-10-15) ↩
    2. Minimum budget of 1,024 tokens, starting points for simple and complex tasks, `usage.output_tokens_details.thinking_tokens` as the share of billed output tokens spent on internal reasoning, budget as a target rather than a cap, and cache invalidation on budget changes. Extended thinking — Anthropic (checked 2026-10-15) ↩
    3. Cost as the sum of output and thinking tokens, billing for full thoughts behind summaries, the `total_thought_tokens` field, thinking counted inside the output limit and billed even when the response is cut short, and per-difficulty level guidance. Thinking — Gemini API (checked 2026-10-15) ↩
    4. The five `output_config.effort` levels and per-model defaults, the Claude Opus 4.7 guidance table (“On most workloads `max` adds significant cost for relatively small quality gains, and on some structured-output or less intelligence-sensitive tasks it can lead to overthinking”), per-model starting points, and mid-conversation changes and caching. Effort — Anthropic (checked 2026-10-15) ↩
    5. Haiku 5.5 at $0.10 input and $0.50 output, Sonnet 5.5 at $2 and $10, Opus 5.5 at $4 and $20, per million tokens (Haiku rates shown are for prompts up to 100,000 tokens). Pricing — Anthropic (checked 2026-10-15) ↩
    6. Yuyang Wu et al., “When More is Less: Understanding Chain-of-Thought Length in LLMs”, ICLR 2026. Inverted U-shaped accuracy curve; optimal length rises with difficulty and falls with model capability. ICLR 2026 poster ↩
    7. Shu Zhou et al., “When More Thinking Hurts: Overthinking in LLM Test-Time Compute Scaling”, 12 April 2026, ACL 2026 Findings. Diminishing marginal returns, abandoning previously correct answers, and savings from stopping at moderate budgets. arXiv:2604.10739 ↩
    8. Zheng Du et al., “OckBench: Measuring the Efficiency of LLM Reasoning”. Up to 5.0x differences in token length at comparable accuracy. arXiv:2511.05722 ↩
    9. Sanae Lotfi et al., “Quantized Reasoning Models Think They Need to Think Longer, but They Do Not”, 29 May 2026. Up to 52% of failures reached the correct answer mid-chain. arXiv:2606.00206 ↩
    10. Location of the Effort and Thinking settings in the model menu and when changes take effect; the models where thinking cannot be turned off in the app; API behavior on Opus 5.5, Fable 5.1 and Sonnet 5.5. Change the model effort and thinking settings — Anthropic support (checked 2026-10-15) ↩

    Source: https://developers.openai.com/api/docs/guides/reasoning

  • How to Decompile Games With AI: 6-Step Claude Code Workflow

    This is a start-to-finish, step-by-step guide to decompiling old games with AI coding agents, based on three projects that went the distance:

    • Chris Lewis matched all 2,145 functions of the Nintendo 64 game Snowboard Kids in 84 days.[1]
    • Macabeus took the 2001 GBA game Klonoa: Empire of Dreams to 51% with Claude Code and built three tools of his own along the way.[3]
    • Piotr Migdał of Quesma rebuilt the Windows XP-era puzzle game Chromatron four different ways with Ghidra and AI.[2]
    The three games in this guide: the North American box of Snowboard Kids (Nintendo 64), a Klonoa: Empire of Dreams gameplay screen (Game Boy Advance), and a Chromatron gameplay screen (Windows PC)
    The three games in this guide: the North American box of Snowboard Kids (Nintendo 64), a Klonoa: Empire of Dreams gameplay screen (Game Boy Advance), and a Chromatron gameplay screen (Windows PC)

    The three games in this guide (labels added by AI Signal). Snowboard Kids box: Atlus, as shown in Chris Lewis’s decompilation repository cdlewis/snowboardkids-decomp / Klonoa screenshot: Namco, via English Wikipedia (originally MobyGames) / Chromatron screenshot: Silver Spaceship Software, via Piotr Migdał, Quesma blog (2026-03-04)

    Snowboard Kids and Klonoa are console games with known compilers, so they were done as matching decompilations; Chromatron is a PC game, so it was reimplemented. Step 0 explains the difference.

    Why this is a hot topic, the community backlash and the legal debate are covered in How AI Decompiles Old Games, and Where It Stops. The images below were published by the original authors and each is credited.

    If you arrived here from the REA (Reverse Engineer Anything) discussion: REA is an MCP server that connects an agent to Ghidra, IDA or Hopper, so it can stand in for the Ghidra connection in Step 2. Its own DX-Ball and Touhou 4 reconstructions follow the same compile-and-compare loop as this guide. What REA does, its five official cases and its limits are in REA Passes React With 259,000 GitHub Stars.

    One premise: this guide covers analysing a game you legitimately own and publishing code only. It does not cover distributing game files or assets, breaking copy protection, or touching online games. Legal limits are in Step 7.

    Terms first

    • Compile / decompile: turning source code (such as C) into machine code is compiling; reading machine code and writing source back is decompiling.
    • Assembly: machine code written out line by line in human-readable form. The starting point of decompilation.
    • Matching decompilation: rewritten C counts as done only when the same compiler turns it into machine code identical to the original, byte for byte.
    • Function: the unit of work. A game has hundreds to tens of thousands.
    • Agent: an AI that runs commands in a terminal and works through steps on its own, such as Claude Code or Codex.

    Step 0. Pick one of two paths

    Matching decompilation Functional reimplementation
    Goal C that compiles to byte-identical machine code New code that behaves like the original
    Fits N64, GBA, GameCube and other consoles with a known compiler Old PC games
    Referee Byte comparison of compiled output Screen and behaviour comparison
    Output Source that rebuilds the original exactly A program that runs on a new platform
    Example Snowboard Kids (N64), 100% in 84 days[1] Chromatron, 1 pixel of 307,200 different[2]

    Agents work here because there is a referee: the agent proposes code, a machine scores it, and the agent repeats to raise the score without a human. Matching decompilation has the strictest, most automatic referee, so start there. PC games are in Step 6-1.

    Step 1. Choose a game and a project

    Look for an existing project

    Most popular console games already have a decompilation underway. Setting up a new one takes experienced people weeks: splitting the game into functions, reproducing the build environment, and confirming an untouched build relinks identically. Macabeus spent a year on study and tooling before starting Klonoa.[3]

    1. Search decomp.me, the community scratchpad site, by game or platform.
    2. Search GitHub for <game name> decomp; READMEs usually show progress.
    3. Read the project’s CONTRIBUTING guide and find its Discord.

    Look at function size, not just count

    Bigger functions are harder to match.

    Function count and size for Klonoa and four other GBA games. Klonoa has the fewest functions (663) but the largest mean function size (506 bytes) and a much larger share of functions over 512 bytes
    Function count and size for Klonoa and four other GBA games. Klonoa has the fewest functions (663) but the largest mean function size (506 bytes) and a much larger share of functions over 512 bytes

    Image: Macabeus, “Starting a Decompilation Project from Zero” (2026-08-17), gambiconf.substack.com

    Klonoa has 663 functions against Pokémon Emerald’s 15,854, but its mean function is 506 bytes, more than three times the others (102–180 bytes), which made it harder than the count suggests.[3] Beginners should pick games with small functions and projects that are already far along.

    Step 2. Set up the environment

    What you need

    • Your own game file, dumped from a cartridge or disc you own. Projects check its hash to confirm the exact version.
    • A Linux environment: WSL on Windows; macOS mostly works as is.
    • The original compiler: SGI IDO or GCC 2.7.2 for N64, agbcc (GCC 2.95 family) for GBA, Metrowerks CodeWarrior for GameCube, and so on. Projects explain how to get it.
    • A coding agent that can run builds and diffs in a terminal.

    Tools

    Tool What it does When
    splat Splits the game into code and data and emits per-function assembly (.s) When setting up a project
    m2c Produces a mechanical C first draft from assembly When starting a function
    decomp.me Edit C in the browser and see the diff and score live Matching one function, asking for help
    objdiff, asm-differ Show your compiled output next to the original, line by line Matching locally
    decomp-permuter Randomly perturbs C to close the last few bytes Stuck at 95–99%

    Joining an existing project

    1. git clone the repository.
    2. Put your game file in the documented folder under the documented name. Never commit it.
    3. Install the compiler and dependencies as instructed.
    4. Build without changes and confirm you get “OK” (matches the original). If not, your environment is wrong.
    5. Pick a short function from the unmatched list (often asm/nonmatchings/ or a progress page).

    Step 3. Match one function by hand first

    Do one yourself before adding agents, so you can review what they produce.

    1. Create a decomp.me scratch with the project’s platform, compiler and flags, and paste the function’s assembly.
    2. Get the m2c draft. decomp.me fills one in automatically; locally, run m2c.py function.s.
    3. Edit against the diff. The original and your output appear side by side with differing lines highlighted and a score. Change types, operation order and branch shapes to shrink the difference.
    4. Done at zero. Move the C into the project, remove the assembly include, and confirm the full build is still “OK”.

    The m2c draft rarely matches on its own: in Snowboard Kids it matched 17 of 1,830 functions (0.93%).[1] Macabeus built his own GBA decompiler, asmlift, with a browser playground and a public benchmark against m2c.[3]

    asmlift: on the left, a playground that turns pasted GBA assembly into C; on the right, a benchmark comparing per-function match rates with m2c
    asmlift: on the left, a playground that turns pasted GBA assembly into C; on the right, a benchmark comparing per-function match rates with m2c

    Image: Macabeus, “Starting a Decompilation Project from Zero” (2026-08-17), gambiconf.substack.com

    Step 4. Give the agent a loop and prohibitions

    One folder per function

    • target.s: the original assembly to match
    • base.c: the m2c draft
    • build.sh: compiles one C file, compares with the original and prints a 0–100% score
    • CLAUDE.md (or AGENTS.md): instructions the agent reads first

    build.sh should use the project’s real compile command. A skeleton:

    #!/bin/bash
    # usage: ./build.sh base_3.c
    SRC="$1"
    # 1) compile with the project's compiler and flags (replace with the project's command)
    $CC $CFLAGS -c "$SRC" -o out.o || exit 1
    # 2) disassemble, compare with the original, print match percentage (use the project's diff tool)
    ./score.py out.o target.s

    A single numeric score matters most; the agent steers by whether it rises.

    The loop

    Lewis’s CLAUDE.md:[4]

    1. Run ./build.sh base.c to build base.c and get an object dump of the compiled code. You will also get a score, with a score of 100% indicating a perfect match.
    2. Look for an area where the control flow and instructions do not match. Consider what the original developers probably intended to write given the function’s broader purpose. Print out an explanation for why they don’t match.
    3. Test your change by creating a new file (base_n.c where n is your attempt number).
    4. Run ./build.sh base_n.c (where n is your attempt number).
    5. If your possible solution did not improve the match percentage, use tools to analyse what went wrong and summarise your theory. Then apply this theory to improving the match in your next attempt.

    He exposed four tools: build and score, disassembly, object diff with register normalization, and line mapping via debug symbols.[4] Numbered attempt files keep earlier tries comparable instead of overwritten.

    Prohibitions

    Macabeus’s agent tried to modify the compiler when stuck.[3] Add:

    – Do not modify the compiler, build settings, original assembly or build.sh.
    – Do not inline assembly into C.
    – Do not add features or values that aren’t in the original.
    – After three attempts without improvement, stop, summarise your theories and hand off.

    Example instructions file

    # Goal
    Write a C function that matches target.s byte for byte. Compiler: (project compiler and flags)
    
    # Loop
    1. Check the score with ./build.sh base.c.
    2. Find mismatches, guess the original intent, write down why.
    3. Put each change in a new file base_n.c.
    4. Check the score with ./build.sh base_n.c.
    5. If the score doesn't improve, summarise a theory and apply it next.
    
    # Forbidden
    - Editing the compiler, build settings, target.s or build.sh
    - Inline assembly
    - After three attempts without improvement, write theories to notes.md and stop
    
    # When done
    - At 100%, record the final file name and what you learned about variables and structs in notes.md.

    Step 5. Run in parallel; people take the blockers

    Parallel

    Lewis created four Git worktrees (separate folders checked out from one repository) and ran agents at once; they handled most short functions and library code.[1]

    What people do

    About 4.8% of matching commits involved expert intervention, and Lewis says the project would have stalled around 89–90% without that IDO expertise.[1] Agents often get these wrong:[4]

    • Basic arithmetic such as struct field byte offsets
    • C89 rules, such as declaring variables only at the start of a block
    • Reproducing complex compiler-generated control flow

    Permuters for the last bytes

    Functions stuck at 95–99% go to a permuter, which tries thousands of small rewrites (reordering statements, adding temporaries) looking for a zero diff. Macabeus built a GBA one, Transmuter, that graphs which mutations reduced the score.[3]

    Transmuter: a graph showing the score for one function dropping from 10 to 4, 2 and 0 through statement-reordering mutations, with the final C on the right
    Transmuter: a graph showing the score for one function dropping from 10 to 4, 2 and 0 through statement-reordering mutations, with the final C on the right

    Image: Macabeus, “Starting a Decompilation Project from Zero” (2026-08-17), gambiconf.substack.com

    Still stuck? Post the scratch to the project’s Discord.

    Don’t lock in one model

    Lewis found Claude better than Codex on Snowboard Kids 2, then “Codex continued to outperform Claude” on this project.[1][4] Handing a stuck function to another model sometimes solves it.

    Step 6. Verify the whole build, run it, and read it

    Check the hash

    Build the whole project and confirm its hash matches the original game file. Function-level matches can still add up to a mismatch if data or link order is wrong. Most projects fail the build on mismatch; run a full build before every commit.

    Actually run it

    Macabeus built gba-kit, a browser GBA emulator workbench showing the game screen, assembly, registers and memory together. Checks like this are how the agent found a 25-year-old Easter egg on the save-deletion screen.[3]

    gba-kit: the Klonoa game screen top left, the current assembly line in the middle, register values on the right and memory below
    gba-kit: the Klonoa game screen top left, the current assembly line in the middle, register values on the right and memory below

    Image: Macabeus, “Starting a Decompilation Project from Zero” (2026-08-17), gambiconf.substack.com

    Read it and name things

    Freshly matched code is full of names like func_80012345 and var1. Macabeus names “cognitive debt reaching a level that is impossible to pay off” as the main risk.[3] His pipeline runs selection → decompilation → code-quality pass → adversarial review by another agent → human review and merge. Naming and comments are people’s job.

    Step 6-1. PC games: use the screen as the referee

    Old PC games rarely have an obtainable original compiler, so reimplementation is more realistic. Migdał tried four ways to get Chromatron running on Apple Silicon.[2]

    The original Windows Chromatron, level 3: a grid puzzle where you place mirrors to reflect laser beams
    The original Windows Chromatron, level 3: a grid puzzle where you place mirrors to reflect laser beams

    The original game. Image: Piotr Migdał, Quesma blog (2026-03-04), quesma.com

    Steps

    1. Open the executable in Ghidra, the free reverse-engineering tool released by the US National Security Agency.
    2. Let the agent use Ghidra, first through MCP (a protocol for agents to call external tools), later through PyGhidra (Ghidra from Python).
    3. State the goal clearly. He rejected the agent’s suggestion that an emulator would be easier.

    Ghidra with a Claude Code terminal on top; the agent has found the beam-tracing logic and tabulated 13 element types such as mirror, filter, prism and splitter
    Ghidra with a Claude Code terminal on top; the agent has found the beam-tracing logic and tabulated 13 element types such as mirror, filter, prism and splitter

    Claude Code connected to Ghidra identifies the game’s element types. Image: Piotr Migdał, Quesma blog (2026-03-04), quesma.com

    The second attempt ran m2c first and had Claude fix the result. Note the prompt: never invent or add anything; it must work the same way, pixel-perfect. It was abandoned over asset decoding.[2]

    The Claude Code prompt: decompile with m2c, build for this computer and run it; never invent or add anything; it must work the same way, pixel-perfect
    The Claude Code prompt: decompile with m2c, build for this computer and run it; never invent or add anything; it must work the same way, pixel-perfect

    The m2c-approach prompt. Image: Piotr Migdał, Quesma blog (2026-03-04), quesma.com

    The referee is original screenshots

    With no byte score, use screenshots of the original as ground truth: a script compares the same scene pixel by pixel and paints differences red for the agent to see.

    A pixel comparison with differing pixels in red, next to Cursor where GPT-5.2-Codex writes the comparison script
    A pixel comparison with differing pixels in red, next to Cursor where GPT-5.2-Codex writes the comparison script

    Pixel comparison with differences in red. Image: Piotr Migdał, Quesma blog (2026-03-04), quesma.com

    Fonts were the hardest; “Models (all of them) wanted to persuade me it is not worth fighting,” so he built a per-glyph pixel comparison tool.[2] When the agent says “good enough,” give it another referee.

    A font comparison tool overlaying the original game's glyphs with candidate fonts pixel by pixel
    A font comparison tool overlaying the original game’s glyphs with candidate fonts pixel by pixel

    Pixel-level font comparison tool. Image: Piotr Migdał, Quesma blog (2026-03-04), quesma.com

    Results of the four approaches

    Approach Result
    Ghidra + MCP + Claude Opus 4.5 Recognisable but remake-like; the model invented details
    m2c + Claude Opus 4.5 Abandoned over asset decoding
    Ghidra headless + Cursor + GPT-5.2-Codex Fully playable with little feedback over 1–2 hour sessions; visuals slightly off
    PyGhidra + Claude Opus 4.6 307,199 of 307,200 pixels identical
    The four Chromatron rebuilds in a 2x2 grid. Result 1 differs in fonts and layout; result 4 is nearly indistinguishable from the original
    The four Chromatron rebuilds in a 2×2 grid. Result 1 differs in fonts and layout; result 4 is nearly indistinguishable from the original

    The four results (labels added by AI Signal). Image: Piotr Migdał, Quesma blog (2026-03-04), quesma.com

    Comparing 1 and 4: direct access to Ghidra (PyGhidra) plus a referee (screenshot comparison) produced a near-identical result.

    Step 7. What to respect when publishing

    • Publish code only. Legitimate projects ship no graphics, audio or game data; users extract them from their own copy.[5]
    • Don’t break copy protection. Circumvention is restricted separately from decompilation; Nintendo’s August takedown of 403 GitHub repositories targeted emulators using Switch keys.[6]
    • Leave online and live-service games alone. Terms of service and anti-cheat apply.
    • Disclose AI use. The Zelda/Banjo PC port team refused any association with AI-built ports.[7] Say in the README what AI did and what people reviewed.
    • Stay non-commercial.

    Korea’s Copyright Act, Article 101-4, allows reverse analysis only for interoperability information that can’t be obtained otherwise, and forbids using it to build a substantially similar program.[8] Matching decompilation can sit on that line by definition. Studying privately weighs differently from publishing.

    One-table summary

    Step What Key point
    0 Matching or reimplementation What your referee is
    1 Find a project; small functions first decomp.me, GitHub
    2 Own game file, original compiler, tools; untouched build must match Never commit game files
    3 Match one function by hand m2c draft → edit against the diff
    4 Per-function folder, scoring build.sh, loop and prohibitions Return a numeric score
    5 Parallel agents; people, permuters, other models for blockers ~5% expert intervention
    6 Full hash check, run it, name things Don’t leave cognitive debt
    6-1 PC games: screenshots as referee Pixel and font comparison
    7 Code only, no DRM bypass or online games, disclose AI Copyright Act Art. 101-4

    Notes


    Notes

    1. Chris Lewis, “Decompiling a Nintendo 64 Game in 84 Days” (2026-08-26). blog.chrislewis.au ↩
    2. Piotr Migdał, “Reviving the 20-year-old puzzle game Chromatron with Ghidra and AI”, Quesma (2026-03-04). Source of seven images in this article. quesma.com ↩
    3. Macabeus, “Starting a Decompilation Project from Zero: Claude Code and 51% of a 2001 GBA Game” (2026-08-17). Source of four images in this article. gambiconf.substack.com ↩
    4. Chris Lewis, “Using Coding Agents to Decompile Nintendo 64 Games”. blog.chrislewis.au ↩
    5. Android Authority on the Melee decompilation (2026-09). androidauthority.com ↩
    6. GitHub DMCA repository, Nintendo notice, 2026-08-17. github.com/github/dmca ↩
    7. Video Games Chronicle (Chris Scullion), 2026-10-03. videogameschronicle.com ↩
    8. Korea Copyright Act, Article 101-4. casenote.kr ↩

    Source: https://blog.chrislewis.au/using-coding-agents-to-decompile-nintendo-64-games/