This manual explains how someone without a lawyer can file a petition for writ of habeas corpus in the California state courts. This section constitutes an overview on California habeas corpus practice as it relates to the handling of criminal appeals.This petition must be clearly handwritten in ink or typed. You should exercise care to make sure all answers are true and correct. This Chapter explains the writ of habeas corpus and lays out the procedures you will need to follow to petition for the writ. Sample Briefs and Petitions ; State Petition for Writ of Mandate. A writ of habeas corpus is a legal order that requires the custodian to bring the detained individual before a court or judge. Petitioner has filed a petition for a writ of habeas corpus under 28 U.S.C. § 2254 challenging his state conviction. Fax: (408) 286-5437. The person detaining the individual must file a sworn return explaining the legal basis and true cause for the detention.