The writ of habeas corpus is the remedy to be used when any person is restrained in his liberty. What Is Habeas Corpus?In Texas, the state writ of habeas corpus is a legal mechanism that allows individuals to challenge their detention or imprisonment. A Writ of Habeas Corpus (Latin for "that you have the body") may be filed on behalf of a person who is unlawfully imprisoned. In Texas, a writ of habeas corpus is a court order in which the judge demands a law enforcement agency to produce a detainee for a court hearing. In a writ of habeas corpus, a defendant seeks to establish that his or her prison sentence is illegal. This can be done in two ways. A writ of habeas corpus is a legal tool that a person can use to enforce a superior right of possession to a child. A writ of habeas corpus is a legal tool that a person can use to enforce a superior right of possession to a child. If the application is filed prior to disposition of the case, it is filed in the assigned District Court or County Criminal Court at Law.