(a) A person who is incompetent to be executed may not be executed.
(b) The trial court retains jurisdiction over motions filed by or for a defendant under this article.
(c) A motion filed under this article must identify the proceeding in which the defendant was convicted, give the date of the final judgment, set forth the fact that an execution date has been set if the date has been set, and clearly set forth alleged facts in support of the assertion that the defendant is presently incompetent to be executed. The defendant shall attach affidavits, records, or other evidence supporting the defendant’s allegations or shall state why those items are not attached. The defendant shall identify any previous proceedings in which the defendant challenged the defendant’s competency in relation to the conviction and sentence in question, including any challenge to the defendant’s competency to be executed, competency to stand trial, or sanity at the time of the offense. The motion must be verified by the oath of some person on the defendant’s behalf.
(d) On receipt of a motion filed under this article, the trial court shall determine whether the defendant has raised a substantial doubt of the defendant’s competency to be executed on the basis of:
(1) the motion, any attached documents, and any responsive pleadings; and
(2) if applicable, the presumption of competency under Subsection (e).
(e) If a defendant is determined to have previously filed a motion under this article, and has previously been determined to be competent to be executed, the previous adjudication creates a presumption of competency and the defendant is not entitled to a hearing on the subsequent motion filed under this article, unless the defendant makes a prima facie showing of a substantial change in circumstances sufficient to raise a significant question as to the defendant’s competency to be executed at the time of filing the subsequent motion under this article.
(f) If the trial court determines that the defendant has made a substantial showing of incompetency, the court shall order at least two mental health experts to examine the defendant using the standard described by Subsection (h) to determine whether the defendant is incompetent to be executed.
(g) If the trial court does not determine that the defendant has made a substantial showing of incompetency, the court shall deny the motion and may set an execution date as otherwise provided by law.
(h) A defendant is incompetent to be executed if the defendant does not understand:
(1) that he or she is to be executed and that the execution is imminent; and
(2) the reason he or she is being executed.
(i) Mental health experts who examine a defendant under this article shall provide within a time ordered by the trial court copies of their reports to the attorney representing the state, the attorney representing the defendant, and the court.
(j) By filing a motion under this article, the defendant waives any claim of privilege with respect to, and consents to the release of, all mental health and medical records relevant to whether the defendant is incompetent to be executed.
(k) The trial court shall determine whether, on the basis of reports provided under Subsection (i), the motion, any attached documents, any responsive pleadings, and any evidence introduced in the final competency hearing, the defendant has established by a preponderance of the evidence that the defendant is incompetent to be executed. If the court makes a finding that the defendant is not incompetent to be executed, the court may set an execution date as otherwise provided by law.
(l) Following the trial court’s determination under Subsection (k) and on motion of a party, the clerk shall send immediately to the court of criminal appeals in accordance with Section 8(d), Article 11.071, the appropriate documents for that court’s review and entry of a judgment of whether to adopt the trial court’s order, findings, or recommendations issued under Subsection (g) or (k). The court of criminal appeals also shall determine whether any existing execution date should be withdrawn and a stay of execution issued while that court is conducting its review or, if a stay is not issued during the review, after entry of its judgment.
(l-1) Notwithstanding Subsection (l), the court of criminal appeals may not review any finding of the defendant’s competency made by a trial court as a result of a motion filed under this article if the motion is filed on or after the 20th day before the defendant’s scheduled execution date.
(m) If a stay of execution is issued by the court of criminal appeals, the trial court periodically shall order that the defendant be reexamined by mental health experts to determine whether the defendant is no longer incompetent to be executed.
(n) If the court of criminal appeals enters a judgment that a defendant is not incompetent to be executed, the court may withdraw any stay of execution issued under Subsection (l), and the trial court may set an execution date as otherwise provided by law.