There is no filing fee associated with this filing. The Writ of Habeas Corpus protects prison inmates from false imprisonment to ensure people are not thrown into jail unlawfully.The original writ of habeas corpus and the inmate are sent to court on the required court appearance date. 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. A federal writ of habeas corpus is a legal remedy available to state and federal prisoners who object to their detention or imprisonment. R WHERE TO FILE: The petition is filed first in the superior court where you were sentenced. It offers collateral rather than direct review and is discretionary with the court. The habeas petition is for situations when a legal error occurred, as we say, outside the "four corners" of the court file. Writ of Habeas Corpus.