This is an appeal by the respondent warden from the granting of a writ of habeas corpus and a new trial to the petitioner, Murray R. Gold.
*313On July 24,1986, at the conclusion of his fourth trial, the petitioner was found guilty by a jury of two counts of the crime of murder.1 Subsequently, on August 29, 1986, he was sentenced by the trial court to two concurrent terms of twenty-five years to life imprisonment. The petitioner refused to appeal. The charges for which the petitioner was convicted arose from the stabbing deaths of his former father-in-law, Irving Pasternak, and his former mother-in-law, Rhoda Pasternak, in their Waterbury home in 1974.2
On March 11,1991, after a hearing the habeas court concluded, in a written memorandum of decision, that the petitioner had not been legally competent in 1986, when he was tried for the fourth time for the Pasternak murders.3 The habeas court also concluded that the petitioner had not been afforded effective assistance of counsel. The court reached the latter conclusion apparently because of its finding that defense counsel had failed to take sufficient care to monitor and evaluate the petitioner’s mental health during the course of the trial. Because it found that the petitioner was incompetent at the time of his 1986 trial and that he had not had effective assistance of counsel, the habeas court granted the petitioner’s writ and ordered a new *314trial. Whether the habeas court was correct on either stated ground depends upon whether it reached a proper conclusion that the petitioner was incompetent at the time that he was tried.4
The respondent warden claims that the habeas court improperly: (1) concluded that the petitioner had established, under the proper standard of collateral review, that he was incompetent during his trial; (2) concluded that the petitioner had not been provided effective assistance of counsel; (3) refused to allow the judge who had presided at the petitioner’s trial in 1986 to testify concerning his observations of the petitioner’s demeanor; and (4) ordered a competency evaluation under General Statutes § 54-56d to determine whether the petitioner was competent to stand trial for the fifth time. We agree with the respondent’s third claim and conclude that under the circumstances of this case the habeas court improperly excluded the trial judge’s testimony. Because that conclusion requires that we reverse the decision of the habeas court and order a new hearing, it is not necessary that we address the respondent’s other claims.5
The following sequence of events is relevant. After the petitioner’s third trial was aborted on January 22, 1985, James R. Merikangas, a psychiatrist and neurologist, examined the petitioner and informed the court by letter dated February 4, 1985, that the petitioner *315was incompetent to stand trial at that time. Thereafter, on Merikangas’ recommendation, the petitioner was sent to Whiting Forensic Institute for treatment, observation and evaluation. The petitioner remained at Whiting from February, 1985, until November 8, 1985. In February, May, August and October, 1985, he was evaluated for competency by a psychiatric team consisting of a psychiatrist, Earle L. Biassey, and a clinical psychologist, and a social worker. After the October, 1985 evaluation, the petitioner was determined by the psychiatric team to be competent to stand trial. Subsequent to being found competent, the petitioner was transferred from Whiting to the New Haven correctional center. On May 20, 1986, just prior to the commencement of jury selection for his fourth trial, at the request of Judge William J. Lavery, who was to preside at the trial, the petitioner was reevaluated by Merikangas and was found to be competent at that time.6 Thereafter, the petitioner was tried, convicted and sentenced.
At the habeas corpus hearing the petitioner called as a witness Walter Borden, a psychiatrist, who had examined the petitioner for approximately two hours on December 21,1990, more than four years after the petitioner was tried and sentenced in 1986. Based on that examination, his review of the petitioner’s medical records, and the court records from the petitioner’s third and fourth trials, Borden’s opinion was that the petitioner had not been competent during his fourth trial.
Also called by the petitioner as a witness at the habeas hearing was Attorney John Williams. Williams *316had represented the petitioner at his third trial until, midway through the trial, the petitioner had discharged him and a mistrial had been declared. Williams testified that one day, during the petitioner’s fourth trial, when he had happened to be in Waterbury on other business, he had passed through the courtroom where the petitioner was being tried and had observed the petitioner and his attorney. He stated that at that time he had had an opportunity to view the petitioner for a few minutes while court was in session, the jury was present, and evidence was being taken. In its memorandum of decision the habeas court stated that Williams testified: “ ‘I was struck by the fact that [Gold] seemed to be in a trance. He was staring straight ahead. He wasn’t reacting to anything going on in the courtroom. He did not even react to my presence in the courtroom. . . . His eyes were open but he wasn’t moving. He was simply occupying a chair.’ ”7
Further, at the habeas hearing, a transcript from the petitioner’s fourth trial that Borden referred to in forming his opinion was admitted. That transcript evidenced the following colloquy in the courtroom on July 8,1986, while defense counsel was conducting a voir dire examination of an expert witness outside the presence of the jury.
“Mr. Scanlon [prosecutor]: If your Honor please, I think that the defendant’s confrontation rights are being abandoned at this moment. I point that out to the court.
“The Court: Excuse me?
“Mr. Scanlon: I think his confrontation rights are being abandoned voluntarily by the defendant. I did want to point this out to Your Honor.
*317“The Court: Why?
“Mr. Scanlon: He seems to be sleeping.
“Mr. Serignese [assistant defense attorney]: No, he is not.
“Mr. Scanlon: He seems to be sleeping.
“Mr. Serignese: He’s just resting his eyes. He is not sleeping.
“The Court: No, the record will note that he, the defendant, is awake.
“Mr. Scanlon: His eyes are closed. Excuse me.
“The Court: Proceed.”8
The habeas court, in its memorandum of decision, appears to have placed considerable weight not only on Borden’s expert testimony, but also on Williams’ recitation of what he had seen during his brief observation of the petitioner, and Scanlon’s viewing of the petitioner when the petitioner’s eyes were closed. Lay testimony concerning the petitioner’s demeanor during his trial, therefore, seems to have played an influential role in the habeas court’s conclusion that the petitioner was incompetent when he was tried in 1986. That is readily understandable. Borden’s examination, as previously noted, took place more than four years after the trial.9 See Drope v. Missouri, 420 U.S. 162, 183, 95 S. Ct. 896, 43 L. Ed. 2d 103 (1975) (inherent difficulties in nunc pro tunc determination of defend*318ant’s mental competency at trial that took place six years earlier); Pate v. Robinson, 383 U.S. 375, 387, 86 S. Ct. 836, 15 L. Ed. 2d 815 (1966) (difficult to determine retrospectively an accused’s competence to stand trial); State v. Manfredi, 213 Conn. 500, 511, 569 A.2d 506, cert. denied, 498 U.S. 818, 111 S. Ct. 62, 112 L. Ed. 2d 37 (1990) (if state forced to wait nearly one year to conduct mental status examination, it would have little or no persuasive weight on issue of defendant’s mental condition at time of trial). Something, therefore, was required to link the findings of Borden’s 1990 examination with the petitioner’s mental condition at the time of his trial in 1986. A significant portion of that linkage was clearly forged for the habeas court by Williams’ testimony concerning his observations and Scanlon’s colloquy with the trial court.
To counter Williams’ testimony and Scanlon’s comments, the respondent sought to call, as a witness, Judge Lavery, the presiding judge at the petitioner’s fourth trial.10 The respondent represented to the habeas court that he desired to call Judge Lavery only to testify as to his observations of the petitioner’s demeanor during the course of the trial. The respondent assured the habeas court that he would confine his questions of Judge Lavery to his observations and would make no effort to elicit testimony concerning the judge’s decision-making process. The petitioner filed a motion in limine, moving that Judge Lavery be precluded from testifying. The habeas court granted the petitioner’s motion. In making its ruling the habeas court stated: “The court concludes that although the state may call the judge and he will testify as to what he directly observed in the courtroom, he would then become subject to cross-examination concerning his ability to observe, how he arrived at certain conclusions from his *319observations, and, therefore his mental process would be delved into upon cross-examination.”11
We conclude that under the circumstances of this case the habeas court abused its discretion in excluding Judge Lavery’s testimony.
A judge is not disqualified and is a competent witness to testify at a new trial or collateral proceeding to observed facts that occurred before him or her at a former trial or proceeding. Woodward v. Waterbury, 113 Conn. 457, 465, 155 A. 825 (1931); Bishop v. New Haven, 82 Conn. 51, 53, 59, 72 A. 646 (1909); Gorham v. New Haven, 79 Conn. 670, 675, 66 A. 505 (1907); People v. Tippett, 733 P.2d 1183, 1193 (Colo. 1987); People v. Carpus, 2 App. Div. 2d 653, 152 N.Y.S.2d 27 (1956); Matter of Sheen, 145 Misc. 2d 920, 923, 548 N.Y.S.2d 618 (1989); People v. Bevilacqua, 170 N.Y.S.2d 423, 429, rev’d on other grounds, 5 N.Y.2d 867, 155 N.E.2d 865, 182 N.Y.S.2d 18 (1958); People v. McDermott, 40 N.Y.S.2d 456, 457 (1943); Willoughby v. Oklahoma City, 706 P.2d 883, 888 (Okla. 1985); Leighton v. Henderson, 220 Tenn. 91, 99, 414 S.W.2d 419 (1967); State v. Kelly, 312 A.2d 906, 907 (Vt. 1973); C. Tait & J. LaPlante, Connecticut Evidence § 7.8; C. McCormick, Evidence (3d Ed.) § 68; 3 B. Jones, Evidence (6th *320Ed.) § 20.55, p. 722; 81 Am. Jur. 2d., Witnesses § 101; 97 C.J.S., Witnesses § 105; annot., 86 A.L.R.3d 633, 643.
We do not encourage the calling of a judge as a witness in subsequent proceedings in a case over which the judge presided. Woodward v. Waterbury, supra, 465. Where there is a compelling need for a judge’s testimony as to observed facts in order that justice be done, however, a judge is a competent witness and should not be precluded from testifying. Id. In this case, we believe that a compelling need existed. The habeas court had in evidence lay observations of the petitioner’s behavior at trial in the form of Williams’ testimony and the transcript of Scanlon’s remarks, and relied on that evidence in conjunction with Borden’s testimony in arriving at its conclusion that the petitioner was incompetent at the time of trial. Neither Williams nor Scanlon, however, was in as advantageous a position to observe the petitioner’s conduct during trial as was the judge. As the trial judge, Judge Lavery’s location in the courtroom afforded him a unique opportunity to observe the petitioner’s demeanor throughout the entire trial. Further, his duty to assure the petitioner a fair trial imposed upon him an obligation to scrutinize the petitioner’s behavior closely. Drope v. Missouri, supra, 181; State v. Watson, 198 Conn. 598, 605, 504 A.2d 497 (1986). It stands to reason that the trial judge’s prolonged observation of the petitioner’s demeanor over the course of the entire trial would be highly significant in assessing the petitioner’s competency.
Judge Lavery’s testimony concerning his observations of the petitioner might well have undercut the probative force of Williams’ testimony and Scanlon’s comments. That, in turn, may have so attenuated the value of Borden’s opinion as to decree a different result. See State v. Zdanis, 173 Conn. 189, 196, 377 A.2d 275 *321(1977); State v. Martin, 170 Conn. 161, 167, 365 A.2d 104 (1976). We conclude that the exclusion of Judge Lavery’s testimony deprived the respondent of a fair opportunity to oppose the petition and, despite the latitude accorded the habeas court, was under the circumstances an abuse of discretion by the court that requires a new hearing. Reynolds v. Vroom, 132 Conn. 53, 57, 42 A.2d 336 (1945).
The judgment of the habeas court is reversed and the matter is remanded to that court for a new hearing on the habeas corpus petition.
In this opinion Peters, C. J., Shea and Covello, Js., concurred.
The petitioner’s first trial resulted in a hung jury and a mistrial. The second culminated in a conviction that was overturned on appeal. State v. Gold, 180 Conn. 619, 431 A.2d 501, cert. denied, 449 U.S. 920, 101 S. Ct. 320, 66 L. Ed. 2d 148 (1980). The third trial ended in a mistrial when the petitioner discharged his attorney in open court, before the jury, midway through the proceedings.
The circumstances relating to those murders are related in some detail in State v. Gold, 180 Conn. 619, 431 A.2d 501, cert. denied, 449 U.S. 920, 101 S. Ct. 320, 66 L. Ed. 2d 148 (1980). It is not necessary that they be repeated here.
“The conviction of an accused person who is not legally competent to stand trial violates the due process of law guaranteed by the state and federal constitutions. Conn. Const., art. I, § 8; U.S. Const., amend. XIV, § 1; see Pate v. Robinson, 383 U.S. 375, 378, 86 S. Ct. 836, 15 L. Ed. 2d 815 (1966).” State v. Gonzalez, 205 Conn. 673, 686, 535 A.2d 345 (1987); see also General Statutes § 54-56d.
The petitioner’s claim is that he was legally incompetent throughout all the criminal proceedings in 1986. That is, he claims that he was incompetent during his trial, sentencing, conviction and subsequent refusal to appeal. Although we will refer only to the trial, our opinion encompasses the entire proceedings.
We also decline to consider the petitioner’s request that we review the habeas court’s finding that there was sufficient evidence presented at trial to convict him. The petitioner filed neither a cross appeal under Practice Book § 4005, nor a statement of alternative grounds to affirm the habeas court’s judgment under Practice Book § 4013, which would allow him to reassert on appeal his challenge to the jury’s verdict.
Merikangas testified that on May 20, 1986, he found the petitioner to be “ ‘alert, oriented and cooperative’ ” and concluded that the petitioner’s condition was “ ‘in remission’ ” at that time. The habeas court apparently agreed because it found that it was not until “some time between May 20, 1986, and July 24,1986, [that] the petitioner became legally incompetent.”
The habeas court’s version is not an entirely accurate quote of Williams’ testimony but it conveys its import.
The habeas court quoted the entire exchange in its memorandum of decision, with slightly different wording.
Earle Biassey, a psychiatrist connected with the Whiting Forensic Institute, who had examined the defendant, testified that a psychiatrist would be “standing on thin ice” if he or she tried to venture an opinion as to competency based upon an ex post facto examination of records. He also testified that he could not venture an opinion as to Gold’s competency at the time of trial if he did not see him at that time.
Judge Lavery had been subpoenaed by the respondent and was available and was present in the courtroom on February 27, 1991.
It is true that an examination of the mental processes of a judge in arriving at a judicial decision should not be permitted. United States v. Morgan, 313 U.S. 409, 422, 61 S. Ct. 999, 85 L. Ed. 1429 (1941); Washington v. Strickland, 693 F.2d 1243, 1263 (5th Cir. 1982) (en banc), rev’d on other grounds, 466 U.S. 668, 104 S. Ct. 2052, 80 L. Ed. 2d 674 (1984); Henderson v. Department of Motor Vehicles, 202 Conn. 453, 459, 521 A.2d 1040 (1987). The avowed purpose, however, of Judge Lavery’s contemplated testimony was to elicit his observations of the petitioner’s behavior during the 1986 trial, not his mental processes in arriving at judicial decisions. If the questioning on cross-examination transgressed the line between factual observations and mental processes, it was the habeas judge’s obligation to disallow the questioning. As the respondent says in his brief, it would be inequitable to refuse to allow him “to call a witness for a proper purpose because [the] petitioner may attempt to question him about inadmissible matters.”