Asio agents were at every court hearing of the Sydney siege gunman in the year leading up to him taking 18 hostages at the Lindt cafe, an inquest has heard.

Officers from Australia’s spy agency watched Man Haron Monis walk free on bail after being charged with being an accessory to murder in December 2013 and then again when he was charged with sex offences in May 2014. When 37 further sexual and indecent assault offences were brought against him in October 2014 neither police nor the director of public prosecutions applied to have his bail revoked.

Asio agents were at the hearings but police involved in the cases were not made aware at the time that they were there.

The coronial inquest into the deaths of Katrina Dawson, Tori Johnson and Monis in the Lindt cafe siege has resumed with an examination of Monis’s bail.

Overseen by coroner Michael Barnes, the inquest heard from Detective Senior Constable Melanie Staples from the homicide squad on Wednesday. She said she was very upset when Monis was granted bail after being charged with being an accessory to murder.

She said she found out almost by accident before the siege that Asio agents had been at the hearings. A female officer from the agency mentioned it to Staples in an email.

“The lady in question [at Asio] was about to go on maternity leave and I think she was seeking an update from me on how I was progressing on arranging a meeting with the DPP, and she was doing that so she could do a handover of sort I assumed,” Staples said.

She said she did not find out why the agents were at the hearing.

Monis was granted bail on the accessory to murder charge in December 2013 despite Staples preparing a briefing note for court that said he was on bail for sending abusive letters to families of dead servicemen at the time of the offence.

The court was not presented with that fact, and the fate of the note has yet to be established. Staples said she handed it to the director of public prosecutions solicitor.

Monis was also on bail for the commonwealth offences of sending the letters when at least three of the alleged sex offences took place but the sex crimes squad and the DPP solicitor in that case both maintain they were not aware of that.

Staples was asked if she thought the sex crimes squad would arrest Monis instead of issuing a notice to appear in court and if she thought the DPP would put in an application to revoke his bail after the 37 further offences were charged.

“I don’t know how to answer that,” she said. “From the police position we always wish for bail to be opposed when offences are serious, that goes without saying.”

She conceded Monis’s bail application was “very good”.

Detective Eugene Stek said the main reason police did not push for bail to be revoked in October last year when the further 37 offences were laid was that the new bail laws meant it was unlikely they would be successful.

“Because of the law at the time, I agreed [the DPP solicitor] was correct in saying opposing bail was futile,” he said.

He was asked if police could have done more to oppose bail. “In hindsight there’s always ways in which to improve and certainly coordinate and put a stronger proposition forward,” he said. “The confounding factor at the time was the Bail Act 2013.”

Monis took 18 people hostage on 15 December last year in a siege that lasted 16 hours. Johnson, Dawson and Monis were all killed in the last few minutes of the siege and the inquest is seeking to establish the circumstances of their deaths and whether they could have been prevented.