In the third game in the series, Clarke builds the Codex because he thinks he needs to turn the Machine off. Then it is revealed to him that
the Machine was actually created to keep that freaky moon in stasis, and therefore must be kept on. So Danik overhears and takes the Codex so he can turn the Machine off. Along the way, Clarke regains possession of the Codex.
Why doesn’t he destroy it immediately?