The issue of 'free will' beggars Harari's history. It is almost impossible to write a world history that negates human 'free will'.
However, the issue of will remains obscure in many ways, and isn't quite the same as in all cases.
In Decoding World History we adopt the terminology of 'free agency' instead of 'free will' in order to evade arguments. But a reader would conclude from the reading that 'free agency' is about choice, and 'willed' actions and/or passive choices perhaps, and passive 'wills'. Nonetheless, if 'free agency' quacks like a duck as it were, it must be the same as 'free will'. The book allows that interpretation, prefers it, but allows a more extended study of the range of possibilities. The basic issue is that a causal 'science' of history doesn't exist.
Further Decoding World History moves to a next level: it shows how human agents in history act as free agents, and yet at the same time show changes of consciousness that wilfully carry out a teleological potential.
Teleology would seem a better challenge to 'free will'. But there again the model in Dec/WH shows that at key points a larger system is realized in the relative free agency of its human agents. What on earth does that mean? sit down and study the model and its discussion of transitions which show a creative potential realized in short bursts of macro action. But the action is carried out by creative individuals whose realization is their own willed action, but under a subtle constraint of . This is a complex hybrid described in the description of two modes: system action and free action, or free agency. And this varies over time: during periods of transition, the willing agent is bemused as it were by the larger system whose potential he carries out in a complex hybrid of mental states.
The issue of free will exists in a larger field that includes 'consciousness', its cousin, 'self-consciousness' and states of creative action. Creativity and 'will'/'free will' are a prodigiously complex subject. Was classical music the result of the free will of musicians? We wouldn't quite say so, the question leaves us non-plussed.The complexity is made the worse by the fact that creative musicians don't appear at random, at least at the level of the work of a Mozart, and classical music is suspiciously a hybrid of 'eonic determination', so-called: Beethovens don't appear randomly distriguted over cultural time, but appear a key moment in  a larger system, a point a reader here might ask for clarification.

The nature of creative states is a mystery, one compounded by the way creative eras appear in a non-random fashion, our transitions again. So consciousness is a close companion to the will, but not the same, and the will is not always able to be creative and in history we see that 'free agents' realize a larger plan or, as we suspect, or teleology (a dangerous term). Note that a human agent is free to negate a larger teleology. He is free to do that. But mostly he is unaware of a larger process in which he is immersed. Look at world history in light of the eonic effect: certain periods stand out as creative eras par excellence, while others lapse into a kind of mechanical consciousness. But while the agent is free in that system he is not quite free as yet to initiate the larger dynamic evolution of history. Christians struggled with this and thought the answer was 'god acting in history'. We wouldn't say so now, it is not a coherent view but man has always tried to grasp his relation to his own civilization and the nature of his freedom, and freedom in general. A careful study of Decoding World History (and its source text) can greatly clarify this.

The relationship of 'free will' to consciousness, the self-consciousness, which is like 'mindfulness' and we might well note that self-consciousness is in some ways distracted consciousness focused in the power of attention, which is what? Attention is closely related to the issue of will, but only if the agent wills a kind of consciousness of his consciousness. So attention is a close correlate to 'free will'. Note that the canons of meditation forever warn that the 'free agent' must find a way to bring the 'will' to his mental states, etc...
Overall modern society in legal contexts must assume the factor of 'free will' subject to certain exceptions. And that is altogether appropriate.
This is a huge field: Kant and Schopenhauer are two strangely related but cousin thinkers in the realm of 'transcendental idealism'. In Schopenhauer a strange clue emerges: the 'Will' in nature is an aspect of the 'thing-in-itself', in Kant the noumenal. That approach is a strange breakthrough which is nonetheless not completely clear. It suggests the way the will seems latent in a stream of mechanical consciousness but can manifest in the phenomenon.

The issue of obviously complex to a degree that baffles us. Man's body/consciousness/will is a stupendously complex machine/metamachince, one that man rarely grasps. Man's evolution in civilization is a voyage of discovery, of himself.

Source: Is Free Will a Dangerous Myth? | Mind Matters