Jeremy Corbyn made an “allotment pact” with his top ministers to agree that Labour would back Remain, but was overruled by his most senior adviser, according to claims in a new documentary.

The Labour leader reportedly met with allies John McDonnell, the shadow chancellor, and Diane Abbott, the shadow home secretary, at his north London allotment during the summer and agreed that the party should move to a position opposing Brexit.

However, the plot was scuppered by Seumas Milne, Mr Corbyn’s director of strategy and communications, according to a Channel 4 Dispatches programme to be aired on Monday night.

Labour said it did not recognise the reports. A spokesperson said: “Labour denies these claims, as the programme makes clear.”

According to Dispatches, the meeting took place after Mr McDonnell and Ms Abbott asked Mr Corbyn for a “serious chat” about Brexit away from Westminster.

The meeting at the allotment reportedly ended with the three agreeing that Labour would “unequivocally” back Remain and that Mr Corbyn would write a newspaper article announcing the change.

Dispatches claimed that the article had been written and ready to publish but that, at the last minute, Mr Milne persuaded Mr Corbyn to ditch the plan.

The party’s Brexit position has been at the centre of a long-running row between senior members of the shadow cabinet and Mr Corbyn’s closest advisers, including Mr Milne and the Labour leader’s former chief of staff, Karie Murphy, who is now overseeing the party’s election campaign.

Mr Corbyn’s senior aides are widely reported to have urged him not to agree to many MPs’ and members’ demands for the party to fully oppose Brexit.

The latest revelation came as Mr Corbyn urged his top team to unite behind the party’s current position, which is that a Labour government would seek to renegotiate the Brexit deal within six months and then put it to the people in a referendum, with Remain as the other option.

Top 10 marginal seats to watch at the general election Show all 10 1 /10 Top 10 marginal seats to watch at the general election Top 10 marginal seats to watch at the general election North East Fife Currently held by the SNP with a majority of 2 Getty Top 10 marginal seats to watch at the general election Kensington Currently held by Labour with a majority of 20 Getty Top 10 marginal seats to watch at the general election Perth and North Perthshire Currently held by the SNP with a majority of 21 Getty Top 10 marginal seats to watch at the general election Dudley North Currently held by independent, formerly Labour, MP Ian Austin with a majority of 22 LivingInMediocrity Top 10 marginal seats to watch at the general election Newcastle-under-Lyme Currently held by Labour with a majority of 30 Derek Harper Top 10 marginal seats to watch at the general election Southampton Itchen Currently held by the Conservatives with a majority of 31 Rob Candish Top 10 marginal seats to watch at the general election Richmond Park Currently held by the Conservatives with a majority of 45 Robin Webster Top 10 marginal seats to watch at the general election Crewe and Nantwich Currently held by Labour with a majority of 48 Jaggery Top 10 marginal seats to watch at the general election Glasgow South West Currently held by the SNP with a majority of 60 Alec MacKinnon Top 10 marginal seats to watch at the general election Glasgow East Currently held by the SNP with a majority of 75 Christine Johnstone

The Labour leader said he had told his divided shadow cabinet that the “debate is now over”.

He told The Guardian: “I just said, ‘Look, this debate is now over. We’ve done it, the party has now made its decision, and that’s it, and that’s what we’re going to campaign on.”

Mr Corbyn also claimed he had unilaterally decided that Labour would support Boris Johnson’s demands for a general election, despite reports of heavy opposition from other senior Labour figures, including chief whip Nick Brown.