The accounts of the judges, and kings of Israel and Judah, contain such references as:
Out of Ephraim was there a root of them against Amalek;
After thee, Benjamin, among thy people;
Out of Machir came down governors,
And out of Zebulun they that handle the pen of the writer. Deborah in Jud 5:14
Then Samuel told the people the manner of the kingdom, and wrote it in a book, and laid it up before the Lord. 1 Sam 10:25
Now the acts of David the king, first and last, behold, they are written in the book of Samuel the seer, and in the book of Nathan the prophet, and in the book of Gad the seer … 1 Chr 29:29
And the rest of the acts of Jeroboam, how he warred, and how he reigned, behold, they are written in the book of the chronicles of the kings of Israel. 1 Kin 14:19
Now the rest of the acts of Uzziah, first and last, did Isaiah the prophet, the son of Amoz, write. 2 Chr 26:22
As was practiced among all the monarchies of the ancient nations, the events of Israel’s history were kept as a contemporaneous written record.
The prophets likewise, not only delivered the words of YHVH orally, but also wrote them at the time, or else they were written by their servants, or court scribes:
Moreover YHVH said unto me, Take a great roll, and write in it with a man’s pen concerning Mahershalalhashbaz. Isa 8:1
Now go, write it before them in a table, and note it in a book, that it may be for the time to come for ever and ever: Isa 30:8
Thus speaks YHVH God of Israel, saying, Write all the words that I have spoken unto you in a book. Jer 30:2
Then Jeremiah called Baruch the son of Neriah: and Baruch wrote from the mouth of Jeremiah all the words of the Lord, which he had spoken unto him, upon a roll of a book. Jer 36:4
The assertion that the autographs of Hebrew Scripture were of late composition–during or after the Babylonian captivity–from oral tradition, is not internally supported at all through the time of their compilation, from first to last. But once the children of Israel were carried captive to Babylon, the priests of the family of Aaron always had some of their number employed in copying the books of Hebrew scripture that they may not be lost.
Now after these things, in the reign of Artaxerxes king of Persia, Ezra the son of Seraiah, the son of Azariah, the son of Hilkiah … the son of Eleazar, the son of Aaron the chief priest: This Ezra went up from Babylon; and he was a ready scribe in the law of Moses, which YHVH God of Israel had given. Ezr 7:1-6
Summary: God commanded His words to be written in books, when they were first spoken by Him, that they may remain in the time to come as a witness forever and ever.