To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. The "Great Writ" of habeas corpus is a fundamental right in the Constitution that protects against unlawful and indefinite imprisonment.You should use this form if. This Chapter explains an important right—the writ of habeas corpus. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration. The writ of habeas corpus is a legal tool used to bring these cases before a judge and seek release from custody. What Is a Writ of Habeas Corpus? This process allows prisoners to petition the court and claim that their imprisonment is unlawful. Federal courts can hear challenges to state criminal convictions pursuant to petitions for a writ of habeas corpus.