This case is before us on a petition for a writ of mandamus filed by Petitioner Bruce Wayne Morris. In considering a mandamus petition, we review a district court’s actions for clear error. Cordoza v. *892Pac. States Steel Corp., 320 F.3d 989, 998 (9th Cir.2003). Five factors guide our determination whether to grant a mandamus petition:
(1) The party seeking the writ has no other adequate means, such as a direct appeal, to attain the relief he or she desires. (2) The petitioner will be damaged or prejudiced in a way not correctable on appeal.... (3) The district court’s order is clearly erroneous as a matter of law. (4) The district court’s order is an oft-repeated error, or manifests a persistent disregard of the federal rules. (5) The district court’s order raises new and important problems, or issues of law of first impression.
Bauman v. United States Dist. Court, 557 F.2d 650, 654-55 (9th Cir.1977) (citations omitted).
The district court has yet to make any definitive ruling, clearly erroneous or otherwise, with respect to Petitioner’s request to amend his first amended habeas petition to include Brady1 and Mooney2 claims based on newly discovered evidence. We therefore deny Petitioner’s petition for a writ of mandamus.
PROCEDURAL BACKGROUND
In order to place the present issues in context, we recite the recent procedural history of this case.3
On November 16, 2001, we remanded Petitioner’s habeas petition to the district court with instructions concerning a new penalty-phase hearing in the state court. We left undisturbed our previous remand for an evidentiary hearing to address Petitioner’s guilt-phase claims of ineffective assistance of counsel and incompetence to aid and assist counsel. Morris, 273 F.3d at 843. On January 29, 2003, the district court made its prehearing scheduling order, setting the evidentiary hearing on Petitioner’s remaining guilt-phase claims for March 22, 2004, and ordering discovery to be completed by November 21, 2003. Because of a series of delays, discovery went well beyond the November 21 deadline. Petitioner filed a motion on January 15, 2004, to compel discovery of several documents, including “complete disclosure of the trial prosecutor’s files.”
At the final pretrial conference on January 29, 2004, Respondent (below) Warden Jeanne S. Woodford produced the trial prosecutor’s files and other documents relating to two prosecution witnesses. During the conference, Petitioner asked the district court to expand the scope of the evidentiary hearing to address two claims on which the district court had properly granted summary judgment. The district court took the motion under submission and, in a February 11 order, deferred ruling on the motion to expand the evidentia-ry hearing. In the same order, the district court gave Petitioner until February 20, 2004, to file his final exhibits list.
Among the items of evidence produced by Respondent at the January 29 conference, Petitioner found two documents that form the bases of his new Brady and Mooney claims. First, Petitioner found a cover note accompanying a letter sent from one of the prosecution witnesses, Avette Barrett, to her mother. Written by the witness’ mother, the cover note reads in part, “I suppose Pete D. should see the letter also as I received a letter from him (Pete) saying Avette was saying Allison was as guilty as she and [Petitioner].” *893Petitioner argues that, by faffing to turn over this allegedly exculpatory evidence, the prosecutor violated Petitioner’s constitutional right to due process. Second, Petitioner discovered a notation in the trial prosecutor’s file stating in part that “Defendant [Barrett] perjured herself at trial.” (Brackets in original.) This notation, regarding one of the prosecution’s key witnesses, forms the basis of Petitioner’s Mooney claim.
On February 13, 2004, Petitioner filed with this court a petition for writ of mandamus, a request to recall the mandate in our 2001 opinion, and a motion to stay the district court’s proceedings set for March 22, 2004, in light of the newly discovered evidence. Petitioner also requested a stay in district court pending the resolution of his petition for writ of mandamus. On February 17, 2004, the district court ordered that “Respondent shall respond to [Petitioner’s request for a stay] no later than close of business February 19, 2004.”
On February 18, 2004, however, Petitioner filed with this court an “Emergency Motion for Immediate Stay of District Court Proceedings.” In that motion, Petitioner argued that by ordering Respondent to respond to the request for a stay, the district court intended that Respondent address “the substantive issues concerning Respondent’s Brady violations and the false presentation of evidence claim.” In an order filed the same day as Petitioner’s emergency motion, the district court construed the motion to suggest (a) that the magistrate judge had “unequivocally ruled” that he had no jurisdiction to expand the issues because of the previous mandate and (b) that the magistrate judge intended to go beyond the request for a stay and finally rule on the merits of the Brady and Mooney claims. Thus, the district court construed Petitioner’s emergency motion as an abandonment of his request for a stay in the district court. On February 20, 2004, this court stayed proceedings in the district court for the purpose of considering Petitioner’s petition for a writ of mandamus.
While the district court proceedings were stayed, the magistrate judge wrote a letter to Petitioner’s lawyer, stating that if both parties stipulated that the resolution of administrative matters, such as determining attorney fees and costs, did not violate the stay, the magistrate judge would begin addressing those issues. On March 10, 2004, Petitioner filed a “Supplement to Petition for Writ of Mandamus” in this court requesting that the case be remanded to a different magistrate judge because of bias.
DISCUSSION
Understandably, the district court and the parties are unsure about where they stand, procedurally, at this juncture. We will do our best to unravel the knot.
Petitioner’s first petition for habeas corpus has not been completely decided because there are pending guilt-phase issues and no final judgment has been entered. Thus, the petition may, in theory, be amended under Federal Rule of Civil Procedure 15(a). This circuit and others have noted that “Rule 15(a) applies to habeas corpus actions with the same force that it applies to garden-variety civil cases.” Calderon v. United States Dist. Court (Taylor), 134 F.3d 981, 986 n. 6 (9th Cir.1998); see also 28 U.S.C. § 2242 (stating that a habeas petition “may be amended or supplemented as provided in the rules of procedure applicable to civil actions”); Johnson v. United States, 196 F.3d 802, 805 (7th Cir.1999) (holding that a petitioner may amend a habeas petition, rather than filing a second or successive petition, when the first petition has not yet reached a final decision).
*894Before the district court can amend the petition, of course, Petitioner must seek leave to amend. Although Petitioner has argued before this court that newly discovered evidence warrants consideration of his Brady and Mooney claims, we decline to address those claims on the merits in the context of mandamus, because Petitioner has another adequate means — presentation to the district court — to have these claims considered in the first instance.
Petitioner’s February 13 motion for a stay of proceedings was, in substance, a request for leave to amend his habeas petition. Because we are denying the mandamus petition and the case therefore returns to district court, we vacate the district court’s February 18 order holding that Petitioner has abandoned his motion to amend by seeking mandamus. When this case returns to the district court, the court must then address Petitioner’s request for leave to amend.
Under Rule 15(a), leave to amend “shall be freely given when justice so requires.” Fed.R.Civ.P. 15(a). We have held that leave to amend, although within the discretion of the trial court, “should be guided by the underlying purpose of Rule 15(a) ... which was to facilitate decisions on the merits, rather than on technicalities or pleadings.” James v. Filler, 269 F.3d 1124, 1126 (9th Cir.2001). A district court may, however, take into consideration such factors as “bad faith, undue delay, prejudice to the opposing party, futility of the amendment, and whether the party has previously amended his pleadings.” Bonin v. Calderon, 59 F.3d 815, 845 (9th Cir.1995);
Respondent notes that, should the district court grant leave to amend, the newly amended habeas petition would be a “ ‘mixed’ petition” containing both exhausted and unexhausted claims. Guillory v. Roe, 329 F.3d 1015, 1017 (9th Cir.), cert. denied, — U.S. -, 124 S.Ct. 449, 157 L.Ed.2d 324 (2003). For his part, Petitioner has two alternative theories about why the exhaustion requirement should not apply to his Brady and Mooney claims. First, Petitioner relies on Strickler v. Greene, 527 U.S. 263, 119 S.Ct. 1936, 144 L.Ed.2d 286 (1999), to argue that, because the state intentionally withheld evidence that would have enabled him to make timely claims in state court, the exhaustion requirement is excused. Alternatively, Petitioner contends that even if, as Respondent argues, the evidence that forms the bases of Petitioner’s Brady and Mooney claims was made available to Petitioner’s trial counsel, trial counsel’s failure to discover or make use of that material is relevant to Petitioner’s claim of ineffective assistance of counsel that is currently before the district court. These arguments are properly addressed to the district court. Before the district court rules on Petitioner’s request for leave to amend, we cannot address either the procedural or substantive issues implicated by the proposed amended petition. See Taylor, 134 F.3d at 989 (stating that “any ruling as to the legitimacy of a step not yet taken would be tantamount to an advisory opinion”).
We leave to the district court’s discretion the further scheduling of whatever proceedings may be appropriate in the circumstances. We trust that all concerned will remain focused on the orderly and prompt resolution of Petitioner’s guilt-phase claims on the merits.
We deny the request to, send the case to a different magistrate judge or district judge on remand.
PETITION DENIED. Stay of the district court proceedings is dissolved.
. Brady v. Maryland, 373 U.S. 83, 83 S.Ct. 1194, 10 L.Ed.2d 215 (1963).
. Mooney v. Holohan, 294 U.S. 103, 55 S.Ct. 340, 79 L.Ed. 791 (1935) (per curiam).
.For a description of the underlying facts, see Morris v. Woodford, 273 F.3d 826, 828-30 (9th Cir.2001), superseding 229 F.3d 775, 777-78 (9th Cir.2000).