A Muslim convert was "snitched on" by his pregnant wife as he tried to join so-called Islamic State (IS), a court heard.
Ismael Watson, 27, from Liverpool, travelled to Turkey and was stopped as he tried to cross the border into Syria in February, the Old Bailey heard.
He denies preparation of terrorist acts but has refused to attend his trial and opted to represent himself.
The judge ordered jurors not to hold it against him for deciding not to attend.
Prosecutor Oliver Glasgow QC told jurors the defendant, who was born Jack Watson and came from a non-Muslim family, had made preparations to join IS between January 2016 and 23 February.
He told jurors Mr Watson had travelled to Turkey then made contact with people on the internet who he believed could help him cross into Syria.
"Little did he realise that two of the people with whom he discussed his plans were in fact agents working for the security services and that everything he said was being recorded."
Mr Watson told an undercover security service agent, known as Abumuj, he wanted to reach the city of Raqqa in Syria, the court heard.
In a conversation on 30 March last year, he told him: "My wife snitched on me and left. While pregnant told them everything..."
On what jobs he wanted to do in Syria, he suggested he could help with film-making, proof-reading and cooking.
In April, another agent, known as Abu Hafs, chatted with Mr Watson and he told how he had slicked his hair back to look more Syrian but admitted "can only change face so much", the court heard.
The court heard that following his conversion to Islam, he had been "quickly radicalised".
He married Sharmina Begum in 2015 in Birmingham but the relationship broke down in January last year after he became increasingly radicalised by watching IS videos, jurors heard.
On 19 January 2016, Mr Watson was detained under counter terrorism laws as he boarded an EasyJet flight to Marrakech from Manchester Airport.
The following day, he took another flight to the Moroccan city from Gatwick Airport and then travelled on to Turkey.
Transcripts of his conversations with the agents revealed the 27-year-old's hatred for Western society, the court heard.
Mr Glasgow said: "There is no doubt that had he succeeded in his attempts to enter Syria he would have joined IS and that he would have fought for them."
He told jurors the facts were not at issue but the defendant disputes that his actions amounted to a criminal offence and he does not recognise the court.
Mr Watson denies preparation of terrorist acts and the trial continues.