The cabinet secretary, Sir Jeremy Heywood, has David Cameron “by the balls” and the prime minister does nothing without Heywood’s permission, according to the former Conservative special adviser Dominic Cummings.

Speaking at an event organised by the IPPR thinktank, Cummings said: “Heywood is more important than anyone in the cabinet, apart from Cameron and Osborne and arguably more important than Osborne. He sits right next to the prime minister. He has him completely by the balls and Cameron does not do anything without Heywood’s permission.”

Giving a deeply unflattering account of a dysfunctional government machine driven by a short-term media agenda and crisis management, he added: “He is not just a policy adviser to the prime minister” pointing out the new chief operating officer for the civil service will be answerable to Heywood and not to Cameron.

Cummings was the former special adviser to former education secretary Michael Gove, and has been scathing about the prime minister before, but not in such revealing terms.

He claimed Cameron had no political priorities whatsoever and had always operated through a system of chaos.

“It’s the nature of the Cameron team. Quite simply, chaos is all they have ever known. They operate in a bubble in which it is at most 10 days planning or more usually 48 hours or 72 hours. There is no long-term priority. There is no long-term plan. The central people operate in that kind of culture. They don’t think anything can change. They just think that is politics. His most important advisers are Ed Llewellyn and Craig Oliver – both of them are totally and utterly useless. It is not their fault. They are just in the wrong job. The fault lies in Cameron putting them there.

“If you have a prime minister who has no sense of priorities and cannot manage his way out of a paper bag, and his two chief advisers who don’t know what they are doing with Craig Oliver running round with a ridiculous grid which is worrying about Twitter and the news cycle for the next three hours, of course it’s going to be a farce.”

The Cabinet Office system also does not work properly and does not connect properly with the No 10 machine, he said. “It is not abnormal. It is normal. You might think somewhere there must be a quiet calm centre like in a James Bond move where you open the door and there is where the ninjas are who actually know what they are doing. There are no ninjas. There is no door.”

He said that there were no incentives in politics to produce cooperation between government departments, so that during a spending review the departmental strategy is to treat the Treasury as a hostile entity and not to tell the Treasury or Downing Street anything.

“The Treasury knows all departments have got money … hidden away form the centre and from ministers, but if you tell the Treasury where it is they will ask for it. It encourages lying and cheating. Why would you ever tell the truth about where the money is?

“People are not encouraged to think of this as a collective exercise. There is no collective priority setting. It is particularly bad with Cameron there because there are no priorities with Cameron whatsoever.”

He claimed the Treasury did not have the skills needed to cut budgets effectively: “They have never worked in business where you have to cut costs by 35% a year they say: ‘oh my god’ when they have to cut by 3%.”