
12 N.Y.3d 268 (2009)
___ N.E.2d ___
___ N.Y.S.2d ___
THE PEOPLE OF THE STATE OF NEW YORK, Respondent,
v.
WALKINS CONTRERAS, Appellant.
Court of Appeals of New York.
Argued February 17, 2009.
Decided April 7, 2009.
*269 Dewey & LeBoeuf LLP, New York City (Krista M. Chiauzzi of counsel), and Legal Aid Society, Criminal Appeals Bureau (Steven Banks, Richard Joselson and Andrew Fine of counsel), for appellant.
*270 Robert M. Morgenthau, District Attorney, New York City (Sheila O'Shea and Alan Gadlin of counsel), for respondent.
Judges CIPARICK, GRAFFEO, READ, PIGOTT and JONES concur; Chief Judge LIPPMAN taking no part.

OPINION OF THE COURT
SMITH, J.
At the outset of defendant's trial for kidnapping, rape and other crimes, the prosecution called the court's attention to notes written by the complainant, defendant's wife. The court decided that the notes had nothing to do with the case  a conclusion amply justified by the record. Defendant argues, however, that his rights were violated by the procedure the court used in reaching that decision, in that the court initially heard from the prosecution and the complaining witness ex parte; and then held a hearing at which defendant's lawyer was present, but defendant himself was not, and ordered defendant's lawyer not to disclose the contents of the notes to his client. We hold that the court's choice of procedures was a proper exercise of its discretion.

I
Defendant, unhappy about the breakup of his marriage to the complainant and her relationship with another man, forced his way into her apartment and held her and her seven-year-old son captive for three hours. During that time, according to the complainant's testimony, he raped her twice, threatened repeatedly to kill her, forced her to write a farewell note to her child and choked her with an electric cord. She was finally able to call 911, and the police came and arrested defendant.
*271 After defendant was arrested and the complainant was taken to the hospital, the police found a small pad of paper on the floor of her apartment, with some notes on it in her handwriting. The notes refer to a romantic relationship; some of the language is erotic, and coarse. The person discussed is not named, but from the content of the notes it could hardly have been defendant, complainant's husband: The notes include the words "get tested," implying a new relationship, not an old one.
Before jury selection began, the prosecutor told the court, in defense counsel's presence, that she was requesting in camera review of some "papers of the complainant." The court, treating the application as one for a protective order (see CPL 240.50), did review the notes in camera, and conducted ex parte proceedings to determine whether the notes were Rosario material (People v Rosario, 9 NY2d 286 [1961]) or Brady material (Brady v Maryland, 373 US 83 [1963]).
During the ex parte proceedings, the prosecutor (relying on what she had learned from the complainant) asserted that the notes had nothing to do with the event at issue in the trial. The court asked to hear from the complainant herself, who testified to the same effect. The complainant said that the notes had been written a month or more before defendant's attack on her, as notes to herself about her new relationship. She said that when defendant forced his way into her apartment, the contents of her purse, including the notes, fell on the floor. She did not know if defendant had seen the notes.
At this point, the court called in defense counsel and told him the contents of the notes, ordering him not to disclose those contents to his client. The court said that it was "excluding" the notes, on the ground that they had nothing to do with the event at issue and that, if they were evidence of the complainant's sexual activity, they would be protected by the Rape Shield Law (CPL 60.42). Defense counsel argued that he should be allowed to use the notes at trial, and asked to question the complainant in an effort to demonstrate their relevance. The court allowed counsel to ask the complainant questions, but the questioning did not yield any evidence of a connection between the notes and the event for which defendant was on trial.
The court did not alter its ruling forbidding use of the notes, and the trial proceeded without reference to them. Defendant was convicted on several counts. The Appellate Division affirmed (47 AD3d 411 [2008]), and a Judge of this Court granted leave to appeal (10 NY3d 933 [2008]). We now affirm.


*272 II
It is important to understand at the outset the purpose of the proceedings about which defendant complains. It was to determine whether the notes were either Rosario material (i.e., prior statements of the complainant relating to the subject of her testimony) or Brady material (i.e., evidence favorable to defendant). Nothing in the record suggests that they were either. There is no reason to doubt that they were exactly what the complainant said they were  notes written at a different time on another subject. There is no evidence that defendant ever saw them, much less that they motivated his conduct.
In light of the notes' apparent irrelevance to the case, defendant did not have a right to any hearing on the Rosario or Brady issue. We have held that, where there is "some basis" to believe that material is subject to Brady, "deference to the prosecutor's discretion must give way" (People v Andre W., 44 NY2d 179, 184 [1978], quoting People v Consolazio, 40 NY2d 446, 453 [1976], cert denied 433 US 914 [1977]), but this case does not appear to meet even that undemanding test. There would, quite likely, have been no error if the prosecution had decided on its own to withhold the document, and there would surely have been no error if the court, having reviewed the document in camera and heard the prosecutor's representations about it, had decided without further proceedings that the notes were not subject to either Rosario or Brady. The prosecutor, in submitting the document to the court, and the court, in deciding to hold a hearing on the issue, were erring on the side of caution.
We heartily approve their decisions to do so. Prosecutors and trial judges invite trouble when they push the rules of disclosure to their limit (see e.g. People v Fuentes, 12 NY3d 259 [2009] [decided today]). But where, as here, the prosecutor and the court have wisely chosen to give defendant a procedural opportunity he is not strictly entitled to, they should not be penalized for not being still more generous. Where a court, although not required to do so, chooses to grant a hearing on the issue of whether a particular piece of evidence constitutes Rosario or Brady material, it has broad discretion as to how the hearing should be conducted. This does not mean that the court's discretion is unlimited, but it does mean that where the trial court has made a reasonable choice among available procedures, that choice will not be second-guessed on appeal.
*273 The trial court's choice of procedures here was reasonable. The document in question, though irrelevant to the case, had a significant tendency to embarrass the complainant, and she might have been warranted in fearing worse than embarrassment if the contents of the document had been communicated to defendant. Defendant was incarcerated at the time of trial, but no one could guarantee that he would long remain so, and there was ample reason to think he would not react well to a document expressing the complainant's romantic interest in another man. Because the document was both irrelevant and potentially inflammatory, the trial court was justified in preventing it from coming to defendant's knowledge.
It is true, as a general matter, that ex parte proceedings are undesirable, and they should be rare (People v Frost, 100 NY2d 129, 132 [2003]). But where the issue to be decided is whether a document should or should not be disclosed to the defense, the initial consideration of the question must be ex parte, almost by its nature; the court can hardly disclose the document before deciding whether to order it disclosed. Also, Criminal Procedure Law § 240.90 (3) expressly permits papers and testimony on a motion for a protective order to be submitted ex parte.
Here, after an ex parte proceeding, the court decided to allow defense counsel to know the contents of the document, to argue for the right to use it at trial and to question the complainant about it, so long as defendant himself was not told what the document said. These rulings were not an abuse of discretion. A defendant is entitled to be personally present at all critical stages of his trial if his presence would contribute to the fairness of the procedure (Kentucky v Stincer, 482 US 730, 745 [1987]; People v Anderson, 16 NY2d 282 [1965]). But that rule is inapplicable here, where the hearing was not only noncritical, but, as a matter of law, unnecessary. And while communication between attorney and client should generally be unrestricted (Geders v United States, 425 US 80 [1976]; People v Enrique, 165 AD2d 13, 16 [1st Dept 1991], affd for reasons stated below 80 NY2d 869 [1992]), there are occasions where restrictions may legitimately be applied (Perry v Leeke, 488 US 272, 283-285 [1989]; Enrique, 165 AD2d at 20-22). The disclosure by lawyer to client of an embarrassing and inflammatory document having nothing to do with the case is not a constitutionally protected communication.
*274 Defendant's remaining contention is without merit.
Accordingly, the order of the Appellate Division should be affirmed.
Order affirmed.
