Defendants who are in custody because of convictions of crimes frequently try to overturn their convictions by filing petitions for a writ of habeas corpus. These petitions are civil suits, technically brought against the state official who has custody of the defendant, usually the prison warden or the Director of the Department of Corrections. They can only raise claims that the pretrial, trial, sentencing, or appeal were not properly conducted; they cannot simply claim that the defendant is innocent. The major difference between habeas corpus review and direct appeals is that habeas corpus petitions can and for the most part must raise complaints based on facts which do not appear in the written record of trial. Examples of such claims are allegations of errors by defense counsel or misconduct by the prosecutor in suppressing evidence favorable to the defense or coaching witnesses.
Although such suits are usually not brought until after the direct appeal has been concluded, they are sometimes filed before or during the direct appeal, or even in cases in which no direct appeal has been pursued. Habeas corpus petitions can be filed in either state or federal courts, but federal courts will generally not consider claims that have not previously been considered by the Supreme Court of Virginia, either in a direct appeal or in a state habeas corpus proceeding. In all habeas corpus proceedings, except those brought against a local sheriff by a defendant who has only been sentenced to serve time in the local jail, the Attorney General's Office will represent the state official and the interests of the Commonwealth.
It is the unusual habeas case which results in any relief in favor of the prisoner. Of the ones that do, the most common form of relief is to order only that the prisoner be allowed a new direct appeal.