ORDER AND AMENDED OPINION
ORDER
The Opinion filed September 7, 2004, at Slip Op. 12953 is amended as follows:
At page 12956, delete the sentence at line 8 of text that reads:
We conclude that the district court lacked personal jurisdiction over the petition, but that the State of Idaho has waived any jurisdictional defects.
and insert in its stead:
We conclude that the district court lacked personal jurisdiction over the custodian, but that the State of Idaho has waived any jurisdictional defects.
At page 12958, delete section heading A which reads: ..
A. The District Court’s Lack of Personal Jurisdiction over the Petition
and insert in its stead:
A. The District Court’s Lack of Per- sonal Jurisdiction over Smith’s Custodian.
At page 12958, delete the first paragraph of Part A and insert in its stead:
Although neither of the parties nor the district court have considered whether the district court lacked jurisdiction over Smith’s habeas petition because of the failure to name the correct party, we have an independent obligation to examine the jurisdiction of both the district court as well as our court. Belgarde v. Montana, 123 F.3d 1210, 1212 (9th Cir.1997). After consideration as to whether the problem is subject-matter or personal jurisdiction, we conclude that it is personal jurisdiction.
At page 12959 delete the last sentence of the first partial paragraph that reads:
We explained in Stanley that “[fjailure to name the petitioner’s custodian as a respondent deprives federal courts of personal jurisdiction” over the petition. Id.
and insert in its stead:
We explained in Stanley that “[fjailure to name the petitioner’s custodian as a respondent deprives federal courts of personal jurisdiction” over the custodian. Id.
At page 12959 insert a new footnote 3 at the end of the above substituted sentence (i.e., that ends with “custodian. Id.’’): *353longstanding rule that personal jurisdiction, in the traditional sense, can be waived and need not be addressed sua sponte. Rather, we understand Stanley to use the term “personal jurisdiction” in reference to the technical custodian requirement of § 2242 and the Rules Governing Section 2254 Cases. See Stanley, 21 F.3d at 360 (citing 28 foll. U.S.C. § 2254 Rule 2(a)). A court need not raise this technical issue sua sponte, and a party may waive that issue.
*352We do not understand Stanley and Belgarde, read together, to disturb the
*353We understand Belgarde to require us to consider, sua sponte, a different issue — whether the named respondent has power to provide the desired relief. The asserted defect in Belgarde was the failure to name, in addition to the immediate custodian, the state Attorney General. See Belgarde, 123 F.3d at 1212. Here, Smith’s desired relief is release from state custody, which the petitioner’s custodian or a superior of that custodian may grant. Thus, when a habeas petitioner has failed to name the proper respondent pursuant to § 2242, we must ask sua sponte whether the respondent who is named has the power to order the petitioner’s release. If not, the court may not grant effective relief, and thus should not hear the case unless the petition is amended to name a respondent who can grant the desired relief.
OPINION
Ramon Smith (“Smith”) appeals the district court’s dismissal of his petition for a writ of habeas corpus. The district court held that Smith’s claims were procedurally barred because Smith had failed to comply with state procedural rules during his state post-conviction proceedings. The district court also held that Smith had made no showing of cause and prejudice to excuse his procedural default. Smith filed a timely appeal. We conclude that the district court lacked personal jurisdiction over the custodian, but that the State of Idaho has waived any jurisdictional defects. On the merits, we conclude that Smith has not shown cause to excuse his procedural default. We therefore affirm the district court.
BACKGROUND
Smith was convicted in October 1997 in Idaho state court of one count of lewd conduct with a minor under sixteen. He was sentenced to a term of 20 years-to-3ife.
Smith filed a timely appeal of his conviction and sentence with the Idaho Court of Appeals. The Court of Appeals rejected Smith’s claims and affirmed his conviction and sentence on March 22, 1999. Smith’s counsel on appeal did not file a petition for review with the Idaho Supreme Court within the twenty-one-day deadline. The Idaho Court of Appeals therefore issued its remittitur on April 13, 1999, and Smith’s conviction became final.
Smith, proceeding pro se, filed a state post-conviction petition in August 1999. Smith also filed a number of motions, including a motion requesting the trial court to appoint counsel to assist in his post-conviction proceedings. The trial court never ruled on this motion one way or another. Smith’s post-conviction petition was considered by the same trial court that had conducted Smith’s trial, and that court issued a “Notice of Intent to Summarily Dismiss” in which it found that Smith’s claims either failed on the merits or were barred because they were or could have been raised on direct appeal. Because Smith failed to file a response to the trial court’s notice within the 20-day deadline, the court dismissed Smith’s petition *354on April 28, 2000.1
Smith appealed the trial court’s decision to the Idaho Supreme Court. Smith also moved the'trial court once again for appointment of counsel, this time to assist him on appeal. The trial court expressly denied this request without elaboration. Around October 5, 2000, Smith submitted a handwritten pro se brief entitled “Amended and Additional Briefs also Case Law’s” to the Idaho Supreme Court. Smith also filed a motion requesting permission to file a handwritten brief. On October 20, 2000, the clerk of the Idaho Supreme; Court returned the brief to Smith, alerting him that it did not comply with Idaho’s Rules of Appellate Procedure. The clerk’s letter indicated that a copy of the rules was enclosed and that Smith had until November 9, 2000 to file a proper brief. A few days later, Smith’s motion to file a handwritten brief was granted.
After several additional filings by Smith, the Idaho -Supreme Court issued an order on November 14, 2000, warning Smith that his appeal would be dismissed if he did not file a brief that complied with Idaho Rules of Appellate Procedure 34 and 35.2 Smith ultimately failed to comply with the Supreme Court’s order and that court dismissed Smith’s appeal on December 19, 2000.
Smith then filed a federal habeas petition pro se on January 2, 2001. The state filed a motion to dismiss the petition on September 5, 2001. The district court granted this motion on September 3, 2002, finding that all of Smith’s claims were procedurally barred because of Smith’s failure to seek review from the Idaho Supreme Court during his direct appeal and because of his failure to file a proper brief with the Idaho Supreme Court. Smith timely appeals to our Court.
DISCUSSION
A. The District Court’s Lack of Personal Jurisdiction over Smith’s Custodian
Although neither of the parties nor the district court have considered whether the district court lacked jurisdiction over Smith’s habeas petition because of the failure to name the correct party, we have an independent obligation to examine the jurisdiction of both the district court as well as our court. Belgarde v. Montana, 123 F.3d 1210, 1212 (9th Cir.1997). After consideration as to whether the problem is subject-matter or personal jurisdiction, we conclude that it is personal jurisdiction.
It is well-established in our Circuit that a petitioner for habeas corpus relief under 28 U.S.C. § 2254 must name “the state officer having custody of him or her as • the resppndent to the petition.” Stanley v. Cal. Supreme Court, 21 F.3d 359, 360 (9th Cir.1994); see also Rule 2(a) of the Rules Governing. Section 2254 Cases in the United States District Courts; Allen v. Oregon, 153 F.3d 1046, 1050 (9th Cir.1998). “This person typically is the warden of the facility in which the petitioner is incarcerated.” Stanley, 21 F.3d at 360. We explained in Stanley that “[fjailure to *355name the petitioner’s custodian as a respondent deprives federal courts of personal jurisdiction” over the custodian.3 Id.
As the caption of this case indicates, however, Smith named the State of Idaho — and not the state official having custody of him — as the respondent in his federal habeas petition. Thus, under Stanley, the district court lacked personal jurisdiction over Smith’s habeas petition. Our inquiry does not end there, however, because it is well-recognized that personal jurisdiction — unlike subject-matter jurisdiction — may be waived. See Ins. Corp. of Ireland, Ltd. v. Compagnie des Bauxites de Guinee, 456 U.S. 694, 703, 102 S.Ct. 2099, 72 L.Ed.2d 492 (1982) (“Because the requirement of personal jurisdiction represents first of all an individual right, it can, like other such rights, be waived.”); Chan v. Soc’y Expeditions, Inc., 39 F.3d 1398, 1406 (9th Cir.1994). Although we have not previously considered whether the lack of personal jurisdiction over a habeas petition may be waived by the state or an appropriate state official, we see no reason not to apply the general rule in the habeas context.4 In a § 2254 habeas petition, the immediate custodian is named as a respondent in his or her official capacity, as the state official legally responsible for the petitioner’s continued detention. See Or *356 tiz-Sandoval v. Gomez, 81 F.3d 891, 894 (9th Cir.1996). Because the custodian is the state’s agent — and the state is therefore the custodian’s principal — the state may waive the lack of personal jurisdiction on the custodian’s behalf.5
.We hold that the State of. Idaho waived the district court’s lack of personal jurisdiction over Smith’s immediate custodian and submits itself in the custodian’s stead to the jurisdiction of the federal courts.6 We proceed to, consider the merits of Smith’s appeal.
B. Smith’s Claim of Cause to Excuse his Procedural Default
The district court refused to consider the merits of Smith’s claims in his habeas petition because of its conclusion that the claims were procedurally barred. In this appeal, Smith does not dispute that his claims are barred7 but instead contends that he can show cause and prejudice to excuse his procedural default. We review de novo the district- court’s decision to dismiss a habeas petition for procedural default. Cockett v. Ray, 333 F.3d 938, 941 (9th Cir.2003).
“To allege cause for a procedural default, a petitioner must assert that the procedural default is due to an objective factor that is external to the petitioner and that cannot fairly be attributed to him.” Manning v. Foster, 224 F.3d 1129, 1133 (9th Cir.2000) (quoting Coleman v. Thompson, 501 U.S. 722, 753, 111 S.Ct. 2546, 115 L.Ed.2d 640 (1991)). Smith makes two arguments regarding cause, both premised on a state statutory right to counsel that extends beyond the Sixth Amendment right and that has been interpreted to include a right to effective assistance of counsel. On the basis of these premises, Smith argues that his procedural default should be excused, first because his appointed counsel on direct appeal was ineffective in failing to file a petition for review, with the Idaho Supreme Court, and second because the state trial court violated his statutory right to counsel by failing to appoint counsel during his post-conviction proceedings.
Smith’s first argument lacks merit. It is well-established that criminal defendants have no constitutional right to counsel beyond their first appeal as of right, and hence no right to counsel in a discretionary appeal to the State’s highest *357court. Ross v. Moffitt, 417 U.S. 600, 610, 94 S.Ct. 2437, 41 L.Ed.2d 341 (1974); see also Bonin v. Vasquez, 999 F.2d 425, 430 (9th Cir.1993). Ineffective assistance of counsel can constitute cause to excuse a procedural default only if the petitioner had a constitutional right to counsel in the proceeding in which the default occurred. Coleman, 501 U.S. at 752-53, 111 S.Ct. 2546. Any errors committed by Smith’s counsel in seeking (or not seeking) discretionary review from the Idaho Supreme Court during the direct appeal thus cannot constitute cause under Coleman. The fact that counsel is appointed by the state court does not change the result, because counsel is not constitutionally required. See Poland v. Stewart, 169 F.3d 573, 588 (9th Cir.1999).
Smith’s second argument is more compelling. Smith makes a strong case that the state trial court erred — as a matter of state law — in failing to appoint counsel for Smith during his post-conviction proceedings. Under Idaho law as it stood at the time of Smith’s post-conviction proceedings, a defendant was entitled to court-appointed counsel when the defendant showed “that a viable claim for post-conviction relief existed at the time the application was filed.” Fox v. State, 129 Idaho 881, 934 P.2d 947, 951 (1997); see also Brown v. State, 135 Idaho 676, 23 P.3d 138, 140 (2001) (holding, shortly after Smith’s post-conviction proceedings were completed, that a defendant was “entitled to court-appointed counsel unless the district court determined that his petition for post-conviction relief was frivolous.”).8 Smith filed two motions asking the trial court to appoint him counsel: one before the trial court ruled on Smith’s petition, and one seeking counsel on appeal after the trial court’s decision. The record does not reflect that any action was taken with respect to the first motion, and the trial court denied the second without comment. For neither motion did the trial court make the finding of a lack of viability required by Fox.
However, even if we agree with Smith that the trial court erred as a matter of Idaho law in failing to appoint him counsel during his post-conviction proceedings, Smith cannot obtain habeas relief on that basis. See Langford v. Day, 110 F.3d 1380, 1389 (9th Cir.1996) (“[A]lleged errors in the application of state law are not cognizable in federal habeas corpus.”). Smith had no federal constitutional right to counsel during his post-conviction proceedings. Coleman, 501 U.S. at 752, 111 S.Ct. 2546; Poland, 169 F.3d at 588. Therefore, under Coleman, Smith cannot establish cause because of the state trial court’s failure to appoint him counsel, even if such failure was erroneous as a matter of state law. See Bonin, 999 F.2d at 430-31 (“Even if California’s constitutional guarantees were interpreted to grant Bo-nin a right to counsel in state collateral proceedings, the deprivation of that state-law right would not be the ‘independent constitutional violation’ of Coleman, because Coleman referred only to violations of the federal constitution.”) (emphasis in original); see also Burns v. Gammon, 173 F.3d 1089, 1093 (8th Cir.1999) (“[T]here is no Sixth Amendment right to post-conviction counsel, and [ ] neither the absence of such counsel, nor the deficient perform-*358anee of such counsel, if appointed, can create cause to avoid a procedural bar.”)-9
CONCLUSION
We conclude that the State of Idaho waived the district court’s lack of personal jurisdiction over Smith’s custodian. On the merits, we conclude that Smith cannot establish cause to excuse the procedural default that prevented the district court from considering his federal claims.
AFFIRMED.