Sen. John McCain said Hillary Clinton erred in writing her account of the 2016 presidential race so quickly and noted her problem is that “she doesn’t have anything to do.”

“One of the almost irresistible impulses you have when you lose is to somehow justify why you lost and how you were mistreated: ‘I did the right thing! I did!’ The hardest thing to do is to just shut up,” the Arizona Republican told Esquire magazine in an interview published Sunday.

McCain, who announced last month that his memoir “The Restless Wave” will come out in April and cover parts of his 2008 presidential run, said Clinton cannot rewrite history.

“What’s the f–king point? Keep the fight up? History will judge that campaign, and it’s always a period of time before they do. You’ve got to move on,” he said in the interview. “This is Hillary’s problem right now: She doesn’t have anything to do.”

“What Happened” was released in September, less than a year after her stunning loss to Republican Donald Trump.

In it, the former first lady and President Barack Obama’s secretary of state blames a number of people for her loss, including herself.

“You can blame the data, blame the message, blame anything you want — but I was the candidate. It was my campaign. Those were my decisions,” she writes in the book.

She also casts blame on challenger Bernie Sanders for his personal attacks on her, former FBI Director James Comey for his handling of the private server investigation and Russian hacking.