From the Imperial Court
Anastasia belonged to an aristocratic family of Constantinople and held the rank of patrician, moving in the highest circles of the court during the reign of Justinian. The recensions of her life differ on the precise circumstances of her departure: one tradition records that she served as a lady-in-waiting to the Empress Theodora and that the emperor's interest in her provoked the empress's jealousy, so that to escape the dangers of court Anastasia left for Alexandria. Another, preserved in the OCA synaxarion, relates that she was widowed young, and that the likewise-widowed Justinian intended to marry her, prompting her to leave the capital secretly for a life apart from worldly affairs.
In both accounts she made her way to Alexandria, where she established a small monastery not far from the city—placed by one tradition at Pempton—and devoted herself entirely to God, living under monastic discipline and supporting herself by weaving cloth.
Life as a Desert Hermit
When the emperor sought to recall her to Constantinople—after the death of the Empress Theodora in 548, by the Wikipedia account—Anastasia withdrew further, seeking refuge at Scetis, where she came under the guidance of Abba Daniel, the elder of the monastery. To shield her from unwanted attention, Daniel permitted an extraordinary arrangement: he clothed her in a man's monastic habit and, by tradition, gave her the name of the eunuch Anastasius, placing her in a remote cave with strict instruction never to leave it and to receive no one. Only a single appointed monk knew her true location, and the wider community believed a male eunuch dwelt in the cell.
For about twenty-eight years she lived in this seclusion. Daniel is said to have visited regularly—weekly, by one account—and arranged for a disciple to bring her water. As she approached death she made her end known by a message inscribed on an ostracon, a fragment of broken pottery, which by tradition bore the words 'Bring the spades and come here.' Daniel, recognizing the signal, came to give her communion and receive her final words before she reposed. Only in preparing her body for burial did the attending monk discover that the hermit had been a woman.
Repose and Relics
The traditions place her repose in the later sixth century—around 567–568 by the OCA account, or in 576 by the Wikipedia account. Her relics are recorded as having been translated to Constantinople in the year 1200.
Her story is preserved through the accounts associated with Daniel of Scetis and, in the Coptic tradition, through the Copto-Arabic Synaxarion.