The district court magistrate’s order that confidential documents could be used only for the writ proceedings pending was proper. Petitioner was convicted of murder in a California state court and sentenced to death. After exhausting his state appeal and habeas filings, he filed a habeas writ in federal district court. Petitioner asserted numerous claims of ineffective assistance of counsel, including a claim that counsel was inadequate in the development and presentation of evidence of his mental health. The magistrate granted the State’s motion for discovery on these claims, finding that “petitioner has waived attorney/client privilege and work product protection with respect to all documents relevant” to his claims of IAC and “any privilege for communications with non-testifying mental health professionals.” However, the magistrate also issued a protective order restricting outside use of these documents by the State, including “use only for purposes of any proceedings incident to the habeas petition,” but not to “other persons or agencies, including any law enforcement or prosecutorial personnel or agencies without a court order.” The State appealed contending that the restrictive order would hamper their ability to share the information with the prosecutors at a future date should the matter end up in State court again. The Court of Appeals here affirmed the magistrate’s order. While a petitioner in a habeas action who raises a Sixth Amendment claim of IAC waives the attorney-client privilege as to the matters challenged (Wharton v. Calderon (9th Cir. 1997) 127 F.3d 1201, 1203), the court’s previous decision in McDowell v. Calderon (McDowell II) (9th Cir. 1999) 197 F.3d 1253, makes it clear that it is within the discretion of the district court to issue an order limiting that waiver to the habeas proceeding in which the IAC question is raised.