Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. Any federal court may grant a writ of habeas corpus to a petitioner who is within its jurisdiction.Habeas corpus is a kind of petition that you can file in federal court to claim that your imprisonment violates federal law. These rules govern a petition for a writ of habeas corpus filed. 2 in a United States district court under 28 U.S.C. § 2254 by: 3. Though subject to different rules, incarcerated people in both state or federal custody may petition for a federal writ of habeas corpus. What Is Habeas Corpus? A 2254 petition must be filed in the federal district court that has jurisdiction over the county where the conviction occurred. 2.3 FEDERAL AND OUT-OF-STATE DECISIONS. An application for a writ of habeas corpus must be made to the appropriate district court.