If you want to challenge a federal judgment that imposed a sentence to be served in the future, you should file a motion under 28 U.S.C. § 2255 in the federal. 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. In Massachusetts, the writs of habeas corpus may be filed in state and Massachusetts federal courts. This remedy is applied for in the convicting court, whether it is a superior court or a district court. The Habeas Corpus petition claims the arrest, sentence, or trial violated constitutional law, making imprisonment unlawful. I am trying to file a writ of habeas corpus for my brother that is incarcerated in wayne county jail. I need help filling it out. The habeas petition did not mention the DOCS sentencing calculation that was the subject of the earlier Article 78 petition. 1 In Massachusetts, every person restrained of his liberty is now entitled, as of right and of course to the writ of habeas corpus.