Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. How Do I Fill Out the Form?There is an official form (Judicial Council Form HC-001) for filing a state petition for writ of habeas corpus. You do not need to cite law. You may submit additional pages if necessary. You must closely follow the instructions on the form. When a prisoner files a petition for a writ of habeas corpus, her custodian must explain why the restraint is lawful. Where the defendant already has a direct appeal pending, a habeas petition should generally be filed in the Court of Appeal. " (citing Gonzalez v. Completing the Habeas Corpus Petition.