Contains Fields to Complete on-line (print out for filing). Form. 2254 Petition_Instructions.New York State Unified Court System. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. 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. Appendix C lists examples of successful habeas claims. 3. When Do People File Habeas Petitions? IN THE UNITED STATES DISTRICT COURT FOR THE EASTERN DISTRICT OF MICHIGAN SOUTHERN DIVISION Ansly Damus Petitioner, 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. Any defendant who has been convicted of a New York state crime in a proceeding should be aware of their right to file a petition for a Writ of Habeas Corpus.