Pokémon Red / Blue · Game Boy · Manipulation · Saves: Enables catching any Pokémon without wild encounter routing; saves 30+ minutes in glitch categories · Documented: 1999
Using Fly or Teleport the moment a Trainer initiates a battle corrupts the encounter pointer, causing the next wild encounter to load any Pokémon — including the otherwise uncatchable Mew.
The Trainer-fly glitch is one of the most studied bugs in Game Boy software. When a Trainer spots the player and initiates a battle, the game writes a battle-start pointer to a specific memory address. If the player uses Fly or Teleport during the one-frame window when the Trainer's exclamation mark appears but the battle has not yet locked input, the warp executes before the battle is committed. This leaves the battle-start pointer in a partially written state: the game believes a battle should occur but has lost the context for which Trainer initiated it. The next wild Pokémon encounter inherits this corrupted pointer and queries an adjacent memory address for the encounter data. That address corresponds to the special stat of the last Pokémon viewed in the party or PC, and the special stat value maps directly to which Pokémon will appear in the corrupted encounter. By manipulating the special stat to a specific value — most famously 21 for Mew — the player can engineer the appearance of any Pokémon in the game as a catchable wild encounter. The glitch was the origin of the widespread playground belief that Nintendo had hidden Mew in the game as a secret, because players who encountered it via the glitch assumed they had found a legitimate secret rather than a software error.
Pokémon Red and Blue handle Trainer encounters through a two-step process: a sight-check pass that detects player proximity and sets a battle-pending flag, followed by a battle-initialization sequence that loads the Trainer's party data. The Fly command during the exclamation mark animation fires before the initialization sequence completes, cancelling it partway through. The battle-pending flag is cleared by the warp, but a secondary pointer — identifying the type of battle encounter — is left in memory pointing to a partially initialized address.
The engine reads this address when the next random encounter triggers, interpreting whatever value is there as a Pokémon species index. The special stat of the last party Pokémon is stored at a nearby address that, due to the partial initialization, falls within the range the encounter system reads. Special stat values map to species IDs on a one-to-one basis: stat 21 is Mew, stat 128 is Tauros, and so on. By adjusting the special stat before triggering the corrupted encounter — typically by battling wild Pokémon and managing experience points — any species ID can be written to the relevant address.
In speedrunning, the Trainer-fly glitch enables the Glitchless versus Any% category split that defines modern Pokémon Generation I competition. Any% routes use the glitch to capture Pokémon with stat profiles that allow sequence-breaking of the badge gate system or to access areas locked behind specific HM requirements without obtaining the relevant badge. The Mew application specifically is used in categories targeting the fastest possible Pokédex completion, since Mew is otherwise unavailable without event distribution.
The cultural impact is equally significant. Playground rumours of the mid-1990s constructed elaborate narratives around Mew's supposed legitimate location — under the truck near the S.S. Anne, accessible only if you had Strength before leaving — because players who encountered Mew via the glitch sincerely believed they had found a designed secret. Nintendo contributed to this ambiguity by distributing Mew through official events, confirming it was a real Pokémon while never explaining how the playground version had been caught. The Trainer-fly glitch is the origin point of Pokémon's enduring mythology around hidden content.