The Old Bailey was told that Ammartiti Muraglia had brandished a semi- automatic pistol at Lord Justice Beldam, Mrs Justice Bracewell and Mr Justice Mance while demanding her children back.
She allegedly shouted: "Don't move or I will shoot someone." Lord Justice Beldam told the jury that he responded: "You can't get justice at the mouth of a gun."
While Mr Justice Mance, 54, slipped out "to get help" Lord Justice Beldam, 71, and 62-year-old Mrs Justice Bracewell, were left to placate Ms Muraglia.
Eventually the mother of two ran out of the judges' door at the court at the Royal Courts of Justice, at the same time as the Lord Chief Justice was walking down the corridor. Fortunately she went in the opposite direction, said Mr Anthony Leonard for the prosecution.
Ms Muraglia, of Islington, north London, denies two charges of possessing an imitation gun with intent in February last year.
Ms Muraglia managed to escape into the street but she returned the next day and was spotted with a gun by court staff and a police constable. Mr Leonard said: "Her arm was straight out and she was shouting `Where is my judge?'." She was arrested by the constable.
The case continues.Reuse content