Nobody inside CCHQ was prepared for election night’s 10 p.m. exit poll. Lynton Crosby’s last text to me predicted that we were going to ‘do well’, which according to our expectations would mean a Conservative majority of more than 60. A late projection, based on data from the ground and Jim Messina’s modelling, suggested we would win 371 seats, giving us a majority of 92. In the end, the Conservatives got their highest share of the vote since 1983, and more votes than Tony Blair managed in any of his elections, yet still we ended up with a hung parliament.

Skilful leadership may deliver stability, but the absence of an overall majority means the nature of the Brexit deal the government negotiates is more uncertain. There has long been talk of a choice between ‘hard’ and ‘soft’ forms of Brexit, with the latter requiring membership of the EU’s single market. Since that would involve accepting the jurisdiction of the European Court of Justice, vast annual membership payments to the EU, and the continuation of free movement rules, people who voted to leave the European Union might wonder whether advocates of a ‘soft’ departure really do understand that Brexit means Brexit.

Because this election failed to produce the majority we needed, it is impossible to call the campaign anything but a failure. Before it began, we envisaged a return to traditional campaigning methods, with daily press conferences to scrutinise Labour and promote our policies. Theresa, never comfortable hogging the limelight, expected to make more use of her ministerial team. On the advice of the campaign consultants, and following opinion research that showed Theresa to be far more popular than the party or her colleagues, we eschewed our instincts. We were wrong to do so.

My biggest regret, however, is that we did not campaign in accordance with the insight that took Theresa to Downing Street in the first place. While the referendum result was undoubtedly an instruction for Britain to leave the EU, it was also a vote for change. One can disagree with Theresa’s prescription — a strategic role for the state to broaden economic opportunity, a clampdown on corporate excesses, rights for workers, intervention in dysfunctional markets and, through school reform, house-building and tax policy, a determination to make Britain the world’s Great Meritocracy — but it is very difficult to disagree with her diagnosis.

That is why the Conservative manifesto, which I authored jointly with the brilliant Ben Gummer, rejected ‘untrammelled free markets’ and ‘selfish individualism’, and declared that ‘our responsibility to one another is greater than the rights we hold as individuals’. I was surprised to read some commentators describe these statements as ‘left-wing’ when the manifesto was consciously Burkean in its style and substance. Burke’s great revelation was that if we value something, we must be prepared to reform it in order to keep it. I fear the election will cause many to conclude that we should return to the modern consensus politics of pure social and economic liberalism, which I believe is one of the causes of the division we see in Britain today.

The manifesto was later written off as ‘the worst in history’. One of the criticisms is that, instead of offering voters giveaways and bribes, we spelt out where cuts would fall. While I accept that the manifesto might have been too ambitious, I worry that the implication of this argument is that politicians should not be straight with the electorate.

The biggest complaint, though, was about our social care proposals. You can criticise the policy, but we need to be honest with ourselves. Since we have an ageing population, we need to spend more on health and care, and we need to decide how to pay for it. We can ask older people to meet the costs, subject to certain protections, from the wealth they have accrued through life, or we can tax younger generations even more. Somehow we have reached a point where older people with assets expect younger, poorer people to pay for their care. With Britain’s demographics, that is not sustainable; neither is it socially just.

Personal attacks come with the job when you work in government, but at times like these, you find out who your true friends are, and you realise that the people who are hurt most by the criticism are your loved ones. So the biggest lesson of the past week for me has been a reminder of the importance of friends, family and love.

Nick Timothy was the PM’s chief of staff from July 2016 until last week. His diary appears in this week's issue of The Spectator, out tomorrow