Though not many of his words have been recorded, Gad was a prophet sent by the Lord to advise and help David (see 2 Samuel 24:11). Eventually serving at the royal court, prophets like him took responsibility for writing down the records of royal reigns.1
5 Then the prophet Gad said to David, “Do not remain in the stronghold; depart, and go into the land of Judah.” So David departed and went into the forest of Hereth.