The Ancient Library glitch in Final Fantasy V can happen in the SNES and PS versions. It is triggered in the merged world after the player has gone through Ghido's Cave and the events at the Library of the Ancients. After all of the storyline is done, if the player casts Teleport before exiting the library, the party appears outside of Ghido's Cave instead of the library. This allows the player to travel around the world on Boko, since Exdeath removed the mountain blocking the path towards Crescent near where Tycoon Castle used to stand. This allows the player to skip the Pyramid of Moore for the time being, letting them get the more powerful equipment and magic at Mirage Village, as well as being able to do various other things, such as the Phoenix Tower. The player will still need to complete the Pyramid to get the airship to go to the Interdimensional Rift or access any areas that are only accessible via the submarine.
By visiting the Mirage Village, the player can re-obtain the black chocobo and, using it, can travel to Castle of Bal for the wind drake, which is required to complete the Island Shrine without the airship. The player can then visit the Sealed Castle and acquire three of the legendary weapons. The Excalibur, Holy Lance and Sage Staff are all good choices, as they carry a holy effect, which is useful against the numerous undead opponents in the Pyramid of Moore.
The glitch also allows the player one last chance to grab anything from Lix, Walse, and Istory if they did not grab everything from there in Bartz's world. Another, rather humorous part of this glitch involves being able to get Lenna back on the team if the player goes to the Island Shrine before going to the Pyramid of Moore. While this will not yet restore her to the party, her sprite will be present during the scene where the party uses the Sealed Tome to open the way. After completing the shrine, the way to the Fork Tower will be opened. If the player visits the Fork Tower, the game will ask them to decide which way to send each of the characters, including Lenna. From this point on, Lenna is restored to the party and will remain following completion of the events in the tower. At this stage, the party can proceed to the Pyramid of Moore and then return to the Guardian Tree, which will result in having Lenna fighting to rescue herself. After the battle, she will be KOed even if she was not KOed during the fight. Additionally, if the player were to visit the Sealed Castle, the chancellor will comment on Lenna's safety regardless of whether she has been returned to the party.
The glitch was fixed in Final Fantasy V Advance and subsequent releases, where casting Teleport after the events at the Library of the Ancients will properly teleport the player outside of the library.