Chapter 248: HABEAS CORPUS AND PERSONAL LIBERTY. "Habeas corpus" is a writ utilized to bring a person before a court, most frequently to ensure that a person' s imprisonment or detention is not illegal.Child; bringing before court; writ of habeas corpus. Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. A writ is a document or order that directs any form of action from a court. The Habeas Corpus petition claims the arrest, sentence, or trial violated constitutional law, making imprisonment unlawful. The writ of habeas corpus gives you the chance to challenge the consequences, restraints, and results of your case. Any court having jurisdiction of actions for divorce or nullity of marriage, separate support, or maintenance, or of any other proceeding. A: Asking the court to order the entity holding someone (usually, the jail) to bring the person before the court. In Massachusetts, a written fee agreement is required in a contingent fee case.