Nicolo Machiavelli's The Prince, written in 1550, just fifty years before William Shakespeare wrote Hamlet, contains one chapter which is directly applicable to Hamlet's uncle, Claudius: chapter 8, "Concerning Those Who Have Obtained A Principality By Wickedness."
Hence it is to be remarked that, in seizing a state, the usurper ought to examine closely into all those injuries which it is necessary for him to inflict, and to do them all at one stroke so as not to have to repeat them daily; and thus by not unsettling men he will be able to reassure them, and win them to himself by benefits. (Translated by W. K. Marriott)
Claudius managed this part fairly well. He killed the king (his brother, Hamlet's father), and married the dead king's queen within a very short time—"within a month," says Hamlet (1.2.148)—to consolidate his claim to the throne.
The people of Denmark, having been told that the former king died from a snake bite, accepted Claudius as their new king, apparently without question or protest of any kind.
There is also the pressing matter of a potential military conflict with Norway. Young Fortinbras, son of the former king of Norway, is amassing an army at the Denmark-Norway border for the purpose of taking back the lands from Denmark that his father lost in battle to Hamlet's father.
Denmark needs someone to address that military issue as soon as possible, and it seemed prudent to have an experienced leader assume the throne and immediately take steps to resolve the problem with young Fortinbras, which Claudius did.
The problem is that Claudius didn't inflict necessary injuries "all at one stroke," meaning Claudius did nothing about Hamlet at the time that he usurped his father's throne. In Machiavelli's view,
He who does otherwise, either from timidity or evil advice, is always compelled to keep the knife in his hand; neither can he rely on his subjects, nor can they attach themselves to him, owing to their continued and repeated wrongs. For injuries ought to be done all at one time, so that, being tasted less, they offend less; benefits ought to be given little by little, so that the flavour of them may last longer.
It doesn't appear that Claudius suffered from "timidity," or that he had "evil advice." Claudius acted quickly when the opportunity arose to kill his brother. It might be that Claudius wasn't concerned about Hamlet challenging his claim to the throne, or perhaps Claudius believed that he could defeat any challenge that Hamlet might raise.
As it turns out, Hamlet did nothing to challenge Claudius, so Claudius was right in the first instance, and the second instance simply didn't arise.
For whatever reason, Claudius didn't have Hamlet killed by ruffians in Germany before he returns to Denmark—better to have Hamlet killed in Germany that in Denmark, to allay any suspicion as to Claudius's involvement in the deaths of old Hamlet and young Hamlet—and that decision turns out to be Claudius's downfall. In the words of Machiavelli,
And above all things, a prince ought to live amongst his people in such a way that no unexpected circumstances, whether of good or evil, shall make him change; because if the necessity for this comes in troubled times, you are too late for harsh measures; and mild ones will not help you, for they will be considered as forced from you, and no one will be under any obligation to you for them.
Claudius could not have foreseen—who could?—that Hamlet's father would come back from the grave and tell Hamlet how he really died. Even when Claudius suspects that Hamlet knows the truth of the matter, he hesitates to kill him, primarily because he's getting "evil advice" (absolutely wrong advice) from Polonius that caused his indecision—an unfortunate trait shared with his nephew, Hamlet.
By the time Hamlet kills Polonius—thinking that Polonius is Claudius—it's far too late for Claudius to repair the damage caused by his failure to inflict the necessary injuries "all at one stroke" when he killed his brother, and to act decisively when he sensed that Hamlet could be a serious threat to him.
Sending Hamlet to England to be killed turns out to be a monumental disaster for Claudius—who could have anticipated that Hamlet would be captured by pirates?—and for Rosencrantz and Guildenstern, who are executed in Hamlet's place.
All in all, things start out somewhat Machiavellian for Claudius, but Claudius fails to follow through with the essential elements of Machiavelli's advice in chapter 8, and Claudius ultimately loses his throne and his life.