Contact an award-winning Writ of Habeas Corpus lawyer today. Petition for Relief From a Conviction or Sentence By a Person in State Custody (Petition Under 28 U. S. C. § 2254 for a Writ of Habeas Corpus).First, a U.S.C. § 2254 allows us to file a petition for Habeas Corpus when the client is in custody under sentence of a state court and is in a state prison. This article addresses a defendant's right to file a federal petition for a writ of habeas corpus from a conviction in a state court. Fill out the form below to receive a free and confidential consultation. Send. New York Appellate Attorney, The Law office of Stephen N. Preziosi New York A writ of habeas corpus may be served on any day. A Habeas Corpus Writ is filed with a federal court once the defendant's state appellate remedies have been exhausted. When and to which court a motion for a writ of habeas corpus in New York should be directed depends on each individuals' unique circumstances. You do not need to argue that your habeas petition is not based on new law unless the government brings it up.