Is it true that Ezra rewrote the sacred books after they were burned?
That is what 2 Esdras 14 (also called 4 Ezra) tells. Because the Law had been burned, Ezra asks God for the Holy Spirit, drinks a cup of something "like fire" and dictates for forty days to five scribes, who write ninety-four books. God orders the first twenty-four to be published for all, and the last seventy to be kept for the wise.
2 Esdras is a Jewish apocalypse written around the year 100, after the Romans destroyed the Temple, with Christian chapters added at the beginning and end.
In it, Ezra argues with the angel Uriel about why God let Israel suffer and receives seven visions, such as an eagle with three heads and a man rising from the sea.
In chapter 14 God speaks to Ezra from a bush, as with Moses, and tells him the Law was lost in the burning of Jerusalem. The twenty-four public books correspond to the traditional number of books in the Hebrew Bible.
The seventy secret ones would be books of wisdom reserved for the worthy, "for in them is the spring of understanding".
The story shows that at the end of the 1st century Jews already counted twenty-four books as scripture while also valuing other writings thought to be revealed, such as apocalypses.
In rabbinic Judaism, Ezra is also remembered as the scribe who restored the Law after the exile (Nehemiah 8).