Ian Stewart, 56, denies murdering Helen Bailey at their home in Royston, Hertfordshire, in April.
Her body was found in July, dumped in a cesspit under the garage.
St Albans Crown Court heard Mr Stewart told a psychiatric nurse he had thought about taking his own life.
Follow updates on this story and other Hertfordshire news
The nurse Sarah Tooley told the jury she had spoken with Mr Stewart on the phone in May.
He had been to visit Broadstairs in Kent where Ms Bailey had a holiday cottage.
"He'd had thoughts of jumping off a cliff while he was down there," said Ms Tooley.
Earlier, the court was told Mr Stewart had tried to divert a police search of the garage.
According to a statement from Det Con Hollie Daines, read to the court, Mr Stewart said: "If searches are going to take place, you wouldn't find anything in the garage."
When they arrived, DC Daines said Mr Stewart told her he had considered suicide.
She said: "He appeared to be anxious and uncomfortable with what we were asking of him."
On the day of Ms Bailey's disappearance, Mr Stewart claimed he found a note from the Electra Brown author saying she had gone to the holiday cottage in Broadstairs.
According to a statement read to the court, he told police: "If Helen does come back, I don't think I want to be with her any more."
Mr Stewart, of Baldock Road, Royston, Hertfordshire, denies charges of murder, preventing a lawful burial, fraud and three counts of perverting the course of justice.
The trial continues.

Food price inflation was 4.9% in June, compared with 3.2% in May, with rising pork prices partly to blame.
While the headline inflation number was above analysts' expectations, it remains below the government's target figure of 3.5%.
Analysts say the latest figure reduces the prospect of interest rate cuts in 2013.
Cutting interest rates risks inflating a property bubble, while tightening may put additional pressure on the economy in the middle of the current global economic uncertainty.
Bank of America Merrill Lynch economists Lu Ting and Zhi Xiaojia expect authorities to keep monetary policy neutral with "neither easing nor tightening".
China expects economic growth this year to be 7.5% -  which would be the slowest rate in 23 years for the country.
The government is due to release data on gross domestic product for the second quarter of the year on 15 July.

The parade by the campaign group, Veterans for Justice UK, is now set to take place in Coleraine, County Londonderry, on Saturday 4 March.
The original plan was to hold the march in Derry on the same date.
However relatives of Bloody Sunday victims objected, saying it was an "insult" to the people of the city.
John Kelly, whose brother was one of 14 Bloody Sunday victims killed by soldiers who opened fire on a civil rights march in Derry in 1972, had described the original plan as "an act of pure provocation".
The Derry parade was called off last week amid reports of counter-demonstrations planned by republicans.
Veterans for Justice UK has now lodged a fresh application with the Parades Commission to march through the centre of Coleraine.
The group said it expects 150 marchers to take part in the parade, which will start and finish at the Royal British Legion.
Last week, march organiser Anto Wickham said the aim of the event was to protect soldiers serving in Iraq and Afghanistan facing "false prosecutions".
Mr Wickham said he was "upset" by suggestions that the Derry march had been planned to raise tensions in the city.
He told Tuesday's Belfast Telegraph: "With help from the Royal British Legion in Coleraine, we are now able to parade and carry on our fight for justice".
In recent months, a number of former soldiers and Conservative MPs have complained that Army veterans were being unfairly targeted by investigations into Troubles-era killings.
In January, hundreds of veterans marched through London to demand an end to the prosecutions.
A London-based law firm representing a number of ex-soldiers also called for an independent inquiry into the prosecution process.
The criticism drew a response from Northern Ireland's Director of Public Prosecutions Barra McGrory QC, who defended his impartiality.
Mr McGrory told the BBC last month that critics who accuse him of treating former soldiers unfairly had insulted him and his office.
The fiancÃ© of a children's author considered throwing himself off a cliff two months before he was charged with the killing her, a court has heard.
[NEXT_CONCEPT]
China's inflation rate rose by more than expected in June, increasing to 2.7% from 2.1% the month before.
[NEXT_CONCEPT]
Organisers of a march for military veterans, which was cancelled in Londonderry due to security fears, have rearranged the event.