"Shaggai" is a Cthulhu Mythos short story by Lin Carter, first published in the 1971 anthology Dark Things.
Synopsis[]
In ancient Hyperborea, the wizard Eibon summons the alien entity known as Pharol to ask him about a mysterious passage in the Pnakotic Manuscripts concerning "the Worm that Gnaws in the Night", the summoning of which means doom. Despite Eibon's insistence, Pharol gives no answer other than that the question must be asked to "the Dweller in the Pyramid", so Eibon prepares a potion that will allow him to travel to other worlds by astral projection, hoping to find the enigmatic entity.
His first stop is on Yuggoth, where he consults with a Mi-Go archimage who is unable to help him. Eibon then moves on from world to world until "the very rim of transdimensional gulfs", in which a luminous gas creature tells him that the being he is looking for dwells in the shunned planet Shaggai.
There, Eibon locates a mountain-sized pyramid standing on a boreal plateau. Its walls are made of unknown metal and extraordinarily thick, as if designed to contain something. Passing through the walls, Eibon sees a dark abyss, with walls inscribed with symbols that he can read, as the language is similar to that of the Elder Records of Celaeno. He reads and gasps in horror, as he realizes the source of the faint luminescence from the abyss, and the very reason why Shaggai is shunned: a colossal worm that the native insectoid race once summoned, only to realize that there was no way to destroy or banish it, so they built the pyramid to try to contain it while it slowly gnaws away the interior of their planet.