Instructions and form for filing a petition for writ of habeas corpus under 28 USC § 2254. In most cases federal law requires that a habeas corpus petition be filed within one (1) year of the date your conviction became final.If you are incarcerated in a federal prison, you cannot file for state habeas corpus. You must file a petition for federal 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. Petition for Writ of Habeas Corpus. You must file a petition for habeas corpus under under 28 USC § 2254 petition in the District Court for the region in which you were convicted. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. The procedure for filing a petition for a writ of habeas corpus is spelled out in the CPLR Article 70. How is a post-conviction habeas corpus proceeding different than the "direct appeal" in a criminal case?