Had Theresa May won the election with the landslide she expected, she’d have fired several of the cabinet with her trademark brutality. They knew who they were. And last Monday, three of them took the opportunity to tell the Prime Minister where she had gone wrong. In the first meeting of the political cabinet since she blew her party’s majority, Philip Hammond asked why there had been no economic message in the campaign. Andrea Leadsom said that while May had repeatedly claimed the election was all about Brexit, she had never said what Brexit was actually for. The most pointed contribution, though, came from Sajid Javid, who lambasted the high-handed way that May’s team had run No. 10.

However, this was ritual humiliation, not a mutiny. The Tories have decided to keep Theresa May who, in turn, has agreed to the departure of her two chiefs of staff, Fiona Hill and Nick Timothy. She knows, as her cabinet knows, that she has just committed the greatest unforced error in modern political history. In normal circumstances, she would be gone. But the Conservative party is in shock, petrified of another election and fearful that Jeremy Corbyn could become prime minister. Instead of deposing May straight away, they are going to try to reprogram her: to make her a different kind of politician.

Aside from the total collapse in May’s authority, the biggest change prompted by this general election is in the Tories’ attitude to Jeremy Corbyn. He used to be a figure of ridicule — and hope — for them. He was the great loser, the man who had captured the Labour party and rendered it unelectable for a generation. How things change. From the cabinet down, Tories are now worried that Corbyn is in a position to win an election. ‘The Tory party’s one job is to keep the hard left out — and we are about to fail at that,’ says one influential Tory MP.

Last Monday’s political cabinet soon ended up comparing notes about an aggressive left-wing tide moving across the country. They lamented how Tory posters were defaced, the venom on social media, and how pro-Corbyn students seem to be. It took the Scottish Conservative leader Ruth Davidson, who has had to deal with the cyber-Nats and far worse, to point out that her English colleagues had better get used to this. She told them she had just spent months having been accused of being a ‘rape apologist’ because of the Tory policy of exempting rape victims from its two-child tax credits cap.

At first, Tories saw Jeremy Corbyn’s leadership as a virus in the Labour party. They are now wondering if that virus has infected the electorate, and might take him to No. 10. Their current priority is to avoid a second election for as long as possible. A leadership campaign might quickly descend into chaos and give Mr Corbyn the entrée he needs. The upshot is that May will be given time to bed down this minority government and prove it can function before she is replaced.

But it will not be business as usual for her; the cabinet has made that clear. She will have to consult senior colleagues on all major decisions, widen her circle and deal promptly with ministers’ concerns. Tellingly, her new chief of staff is not a Mayite but the unseated Tory minister Gavin Barwell, who worked at Tory HQ for years before becoming an MP. His loyalty will be to the party as a whole, not just the Prime Minister personally. I understand Barwell is already asking secretaries of state what they need from No. 10, and to let him know if anything is being held up on the Prime Minister’s desk. Quite a contrast from the telephone terrorism that his predecessor, Fiona Hill, used to take pleasure in practising.

Ministers are also hoping to make May more empathetic, to avoid a repeat of her ill-judged speech outside Downing Street the day after the election, which didn’t acknowledge her failure to win a majority. It turns out that she only had one speech, drafted in the expectation of a landslide, and she decided to tweak it rather than write a new one. The few lines about the Northern Irish Democratic Unionists were the only concession to the new reality she found herself in.

In her appearance in front of Tory backbenchers last Monday, May was contrite. She took responsibility for the election failure and acknowledged that she was only in the job for as long as the party wanted her. ‘The new Maybot 3000 comes with an added empathy chip,’ joked one cabinet minister. Throwing herself on the mercy of her MPs was the easy bit, though. The far more challenging thing will be to alter the way she operates on a day-to-day basis. Some are sceptical of her ability to do this.

I understand that one reason George Bridges, one of the most able ministers in the last parliament, has quit the Brexit department is that he doesn’t think Theresa May really will start consulting others, even now. May sacked his colleague, the Brexit minister David Jones, without first discussing it with his boss, David Davis — an indication that old habits die hard.

No one seriously thinks she will ever recover her stature. ‘It is like with Gordon, once you have seen the flaws, you can’t un-see them,’ says one minister. Some of her cabinet colleagues have been astonished at her handling of negotiations with the DUP. Her decision to declare publicly that she wanted a deal with them and to send her chief whip to Belfast to negotiate it suggested a failure to grasp the basics of negotiating technique. Why was she willing to accept their demand for a written deal, rather than govern as a minority and call their bluff, given they’d never put Corbyn in No. 10?

If she struggles in negotiations with patriotic Ulstermen, how will she handle Brexit? ‘She’s a busted flush,’ warns one minister. ‘She can’t carry out these negotiations; just look at the cartoons of her in the foreign press.’ A Dutch newspaper has depicted the Prime Minister in Brexit talks repeatedly hitting her head with a hammer to the bemusement of her counterparts.

There is no obvious successor, however. Boris Johnson, Amber Rudd and David Davis are regarded as the frontrunners when May goes. Others, such as Nicky Morgan and Sajid Javid, will probably throw their hats into the ring, too. There are also young turks who will push Dominic Raab to run as the candidate of a new generation of free-enterprise Tories.

None of these candidates is ideal. Boris Johnson is far from universally popular — and if the election was in part a backlash against Brexit, in a country still split on this question, should the Tory party be led by the Leave campaign’s most recognisable face? In the party, there are those determined to stop him. Ruth Davidson, the Scottish Tory leader, loathes him and considers him toxic north of the border. She would throw her ever-growing political power behind who-ever was the ‘Stop Boris’ candidate (she had her own meeting with Amber Rudd when she came to London last Monday). There are also Tories who fret that the EU couldn’t be seen to give a good deal to Boris, given his role in the referendum. Another concern is that Boris means drama, and the country has had quite enough of that from the Tories in the past 12 months.

Then again, Boris is the Conservative antidote to Corbyn. He oozes optimism, likes meeting voters, connects with the public and twice won in London, a Labour city. No one could accuse him of being a robotic politician, and he has done naughtier things than running through a wheat field. As one cabinet minister toying with the idea of backing him puts it: ‘To beat a populist, you need a populist.’ Several influential Tory donors have also come to this conclusion.

Then there is David Davis. His closest allies are letting it be known that he is currently holding the Prime Minister together. If she fell apart, he’d be in the running to replace her. As Brexit secretary, he would offer continuity. Aged 68, he may appeal to younger MPs who want a temporary leader: young cardinals tend to vote for old popes. Then again, he ran in 2005 and lost, so picking him would make the Tories seem as if they were going back to the pre--Cameron era. Some of his critics ask if he has the work ethic or attention to detail required of a prime minister.

Amber Rudd is the great hope of those in the party who want a softer Brexit, one of the few in Theresa May’s team to emerge from the campaign with any credit. A liberally minded Tory, she is the ideal candidate, say her supporters, to win back Canterbury, Reading and Kensington. But she has a gossamer-thin majority: if 174 voters in her constituency changed their mind, she’d lose her seat. Even those attracted to her candidacy fret that it would lead ‘to the rest of the country being held hostage by a couple of hundred voters in Hastings’. Those who know her best say that she doesn’t regard her majority as a bar to her running for the leadership. But I understand she would happily stand aside in favour of Ruth Davidson if the leader of the Scots Tories swapped her plan to be First Minister for a stint in No. 10.

So much is at stake. The Tory party schism over the EU was closing, but it has now been reopened by the indecisive election result. The differences over policy and personnel within the parliamentary party, on Brexit and austerity, are such that many Tories think the party is entering one of its most dangerous periods in living memory. ‘It could be explosive enough to blow the party apart,’ warns one former cabinet minister. This is why the Tories are behaving so well: they’re afraid of Corbyn, yes, but they’re just as afraid of each other.

This is why so many Tories will hope that the reprogrammed Maybot can keep functioning. Not out of admiration or respect, but because they desperately need to buy themselves some time and hope that the contradictions in Corbyn’s Labour coalition begin to become apparent. If they cannot hold themselves together, the Tories will face the wrath of an electorate enraged by the drama that they have unleashed on the country.

'The Tory party's one job is to keep the hard left out - and we are about to fail at that,' says an MP

Spectator.co.uk/podcast James Forsyth and Andrew Rawnsley on Theresa May’s future.