An application for a Writ of Habeas Corpus is filed when a person seeks relief from unlawful detention or imprisonment. This is a petition for a writ of habeas corpus filed on behalf of.XXXXXXXXXXXXXXXXX seeking relief to remedy his unlawful detention. The Habeas Corpus petition claims the arrest, sentence, or trial violated constitutional law, making imprisonment unlawful. The habeas corpus petition must be typewritten or legibly handwritten. This Chapter explains an important right—the writ of habeas corpus. In this video, David offers insight on how to file habeas corpus and compassionate release motions. If a detainee or inmate feels that his constitutional rights in the preceding amendments have been violated, he can file habeas corpus. (The district clerk of the county of conviction will fill in this blank.) IN THE COURT OF CRIMINAL APPEALS OF TEXAS. Ordinarily, the writ of habeas corpus may not be used to litigate matters that could have been raised at trial and on direct appeal.