
608 N.W.2d 322 (2000)
2000 SD 40
Roger H. KREBS, Petitioner and Appellant,
v.
Douglas WEBER, Warden, South Dakota State Penitentiary, Appellee.
Nos. 20961, 20962.
Supreme Court of South Dakota.
Considered on Briefs November 29, 1999.
Decided March 29, 2000.
*323 D. Sonny Walter, Sioux Falls, for petitioner and appellant.
Mark Barnett, Attorney General, Craig M. Eichstadt, Assistant Attorney General, Pierre, for appellee.
GILBERTSON, Justice
[¶ 1.] Roger Krebs (Krebs) appeals the trial court's partial denial of his habeas corpus petition. The trial court's order granted partial relief to Krebs holding he could attempt to reinstate his appeal from his first state habeas petition, but denied relief on all other claims. State filed a notice of review. We hold that Krebs is not entitled to habeas relief.

FACTS AND PROCEDURE
[¶ 2.] Krebs was convicted in Beadle County, South Dakota of burglary, grand theft and possession of tools with intent to commit burglary. The background and detailed facts are set forth in State v. Krebs, 504 N.W.2d 580 (S.D.1993) (Krebs I). Krebs was sentenced to fifteen years for burglary, fifteen years for grand theft and ten years for possession of tools with intent to commit burglary. Krebs appealed these convictions to this Court, and we affirmed both the convictions and sentences. In Krebs I, we held that motions for the suppression of evidence seized in a vehicle search were properly denied and the trial court did not err in allowing the state to admit prior bad acts evidence.
[¶ 3.] In 1993 Krebs filed his first pro se petition for habeas corpus relief, asserting four substantive claims: (1) trial counsel was ineffective in failing to advance an alibi defense; (2) denial of his right to a fair trial because his trial was not severed from the co-defendant; (3) denial of his right to a fair trial because alleged tampered evidence was admitted into evidence and used against him; and (4) prosecutorial misconduct. Attorney Michael Thompson (Thompson) was appointed to represent him. In April 1994, Thompson filed a motion to withdraw and a brief pursuant to Sweeney v. Leapley, 487 N.W.2d 617 (S.D. 1992), asserting Krebs' application for habeas corpus had no merit. In response, Krebs requested his issues be protected for federal court review. On May 23, 1994, the original habeas court entered an order quashing Krebs' writ on the merits. Krebs did not appeal this denial of habeas relief. Krebs alleges in his affidavit neither Thompson nor the original habeas court informed him of the appeal procedures found in SDCL 21-27-18.1.
[¶ 4.] Krebs filed his second pro se state petition for habeas corpus relief on November 8, 1994 reasserting the same four *324 substantive claims. Krebs also asserted Thompson's Sweeney brief as an additional ground for relief in this second petition. Krebs' court-appointed counsel, Delmar "Sonny" Walter then filed an amended application for writ of habeas corpus on January 16, 1998.[1] The second habeas court entered findings of fact, conclusions of law and an order partially granting Krebs habeas relief. The court found Krebs should be allowed to return to the original habeas court to seek a certificate of probable cause in order to attempt to appeal from his initial habeas judgment. The court denied habeas relief on Krebs' ineffective assistance of counsel claim. Krebs appeals raising the following issue for our consideration:
Did Thompson render ineffective assistance of counsel in filing a Sweeney brief with the first habeas court.

STANDARD OF REVIEW
[¶ 5.] Our review of habeas corpus proceedings is limited because it is a collateral attack on a final judgment. New v. Weber, 1999 SD 125, ¶ 5, 600 N.W.2d 568, 571 (citing Lien v. Class, 1998 SD 7, ¶ 10, 574 N.W.2d 601, 606) (other citation omitted). It is not a substitute for direct review. Id. (citing Loop v. Class, 1996 SD 107, ¶ 11, 554 N.W.2d 189, 191) (other citation omitted). We are guided by a well-established standard of review:
Habeas corpus can be used only to review (1) whether the court has jurisdiction of the crime and the person of the defendant; (2) whether the sentence was authorized by law; and (3) in certain cases whether an incarcerated defendant has been deprived of basic constitutional rights. Habeas corpus is not a remedy to correct irregular procedures, rather, habeas corpus reaches only jurisdictional error. For purposes of habeas corpus, constitutional violations in a criminal case deprive the trial court of jurisdiction. Further, we may not upset the habeas court's findings unless they are clearly erroneous.
Bradley v. Weber, 1999 SD 68, ¶ 12, 595 N.W.2d 615, 619 (quoting Flute v. Class, 1997 SD 10, ¶ 8, 559 N.W.2d 554, 556) (other citations omitted). The habeas applicant has the initial burden, by a preponderance of the evidence, to prove entitlement to relief. New, 1999 SD 125, ¶ 5, 600 N.W.2d at 572 (citing Lien, 1998 SD 7, ¶ 11, 574 N.W.2d at 607). We may affirm the ruling of the habeas court if it is "right for any reason." Id. (citing Satter v. Solem, 458 N.W.2d 762, 768 (S.D.1990)) (other citation omitted).

ANALYSIS AND DECISION
[¶ 6.] Did Thompson render ineffective assistance of counsel in filing a  Sweeney brief with the first habeas court.
[¶ 7.] Krebs argues Thompson rendered ineffective assistance of counsel per Strickland v. Washington, 466 U.S. 668, 104 S.Ct. 2052, 80 L.Ed.2d 674 (1984) during his first habeas proceeding by filing an ineffective Sweeney brief with the habeas court. State responds Sweeney does not mandate counsel is constitutionally required at every stage of habeas corpus proceedings.
[¶ 8.] In Sweeney v. Leapley, 487 N.W.2d 617, 619-20 (S.D.1992), we held the presence of a state statute authorizing a right to counsel for habeas corpus proceedings does not create a constitutional right to counsel. We concluded, "[s]ince the defendant had no constitutional *325 right to counsel she could not be deprived of effective assistance of counsel." Id. The vast majority of federal courts that have examined this issue agree. State post-conviction proceedings are civil in nature, thus, "the sixth amendment right to effective assistance of counsel does not attach." Mitchell v. Wyrick, 727 F.2d 773, 774 (8th Cir.1984), cert. denied, 469 U.S. 823, 105 S.Ct. 100, 83 L.Ed.2d 45 (1984) (citing Williams v. Missouri, 640 F.2d 140, 144 (8th Cir.1981), cert. denied, 451 U.S. 990, 101 S.Ct. 2328, 68 L.Ed.2d 849 (1981)); Noble v. Sigler, 351 F.2d 673, 678 (8th Cir.1965), cert. denied, 385 U.S. 853, 87 S.Ct. 98, 17 L.Ed.2d 81 (1966). See also Wise v. Williams, 982 F.2d 142, 144 (4th Cir.1992), cert. denied, 508 U.S. 964, 113 S.Ct. 2940, 124 L.Ed.2d 689 (1993) (quoting Coleman v. Thompson, 501 U.S. 722, 752, 111 S.Ct. 2546, 2566, 115 L.Ed.2d 640, 671 (1991) ("[T]here is no constitutional right to an attorney in state post-conviction proceedings. Consequently, a petitioner cannot claim constitutionally ineffective assistance of counsel in such proceedings.")); Morin v. Rhode Island, 741 F.Supp. 32, 36 (D.R.I.1990) (citing Knaubert v. Goldsmith, 791 F.2d 722, 728 (9th Cir.1986), cert. denied, 479 U.S. 867, 107 S.Ct. 228, 93 L.Ed.2d 155 (1986)) (Sixth Amendment's guarantee of effective assistance of counsel does not extend to habeas corpus proceedings). "The Constitution entitles a criminal defendant to representation at the trial and sentencing stages and through the first appeal to which he has a right. However, it does not mandate representation during subsequent proceedings." Morin, 741 F.Supp. at 36 (citing Ross v. Moffitt, 417 U.S. 600, 94 S.Ct. 2437, 41 L.Ed.2d 341 (1974)).
[¶ 9.] Thus, since Kreb's right to counsel is not granted him by the United States and South Dakota Constitutions, any right to counsel must flow from a statutory grant. SDCL 21-27-4 authorizes the appointment of an attorney in habeas proceedings in cases of indigency. Although the holding in Strickland has been well established for some time, our legislature has not seen fit to incorporate its requirements into the protections statutorily given applicants for a writ of habeas corpus.
[¶ 10.] However, Sweeney did recognize that state habeas applicants have rights granted to them by statute outside of those guaranteed by the Constitution. We held that an Anders (Anders v. California, 386 U.S. 738, 87 S.Ct. 1396, 18 L.Ed.2d 493 (1967)) brief is required in habeas cases, as well as in direct appeals where counsel for the defendant determines that the client's claim is without merit. Sweeney, 487 N.W.2d at 620. Anders/Sweeney requires:
[I]f counsel finds his case to be wholly frivolous, after a conscientious examination of it, he should so advise the court and request permission to withdraw. That request must, however, be accompanied by a brief referring to anything in the record that might arguably support the appeal. A copy of counsel's brief should be furnished the indigent and time allowed him to raise any points that he chooses; the courtnot counselthen proceeds, after a full examination of all the proceedings, to decide whether the case is wholly frivolous.
487 N.W.2d at 619 (citing Anders, 386 U.S. at 744, 87 S.Ct. at 1400, 18 L.Ed.2d at 498).
The purpose of this requirement is to avoid "appointed counsel to brief against his client but would merely afford the latter that advocacy which a nonindigent defendant is able to obtain." Id.
[¶ 11.] An examination of the Anders/Sweeney brief filed in this case shows it falls short of the above stated requirements. In one page it disposes of all four substantive claims citing nothing in favor of Krebs and rather than keeping silent on the strength of the State's case, bolsters the State's arguments by concluding Krebs' issues are "without merit," result in no prejudice to him and he was not "denied a fair trial."
[¶ 12.] Nevertheless our review of the record in this case establishes no unfairness, unreliability or prejudice in his underlying *326 conviction. Krebs' substantive issues are without merit. Based on the trial record, no attorney, even one mounting a textbook perfect all-out effort let alone one who meets the Strickland standard of competence, could have produced a different result.
[¶ 13.] Therefore we hold Krebs is not entitled to habeas relief.
[¶ 14.] MILLER, Chief Justice, and AMUNDSON and KONENKAMP, Justices, concur.
[¶ 15.] SABERS, Justice, concurs specially in part and dissents in part.
SABERS, Justice (concurring specially in part and dissenting in part).
[¶ 16.] I agree with the holding of the majority that:
Krebs is statutorily entitled to effective assistance of counsel on one occasion during habeas proceedings but I do not agree that he received it. I write specially to explain the rationale for said holding and I dissent to the result reached by the majority regarding prejudice.
[¶ 17.] I write specially to first point out that habeas corpus is not limited to violations of constitutional rights. Habeas corpus reaches jurisdictional error, constitutional error, all "causes" listed in SDCL 21-27-16(1) through (7) and other illegal detentions, including those resulting from failure to comply with "substantive statutory procedure." Lange v. Weber, 1999 SD 138, ¶ 17, 602 N.W.2d 273, 276 (Sabers, J., concurring specially) (citing Security Sav. Bank v. Mueller, 308 N.W.2d 761, 762-63 (S.D.1981); O'Connor v. Leapley, 488 N.W.2d 421, 425 (S.D.1992) (Sabers, J., concurring specially); Petrilli v. Leapley, 491 N.W.2d 79, 86 (S.D.1992) (Sabers, J., concurring specially); Black v. Class, 1997 SD 22, ¶ 34, 560 N.W.2d 544, 552 (Sabers, J., concurring specially); Lykken v. Class, 1997 SD 29, ¶ 34, 561 N.W.2d 302, 309 (Sabers, J., dissenting)).
[¶ 18.] The right to effective assistance of counsel at trial is guaranteed by the Sixth Amendment of the United States Constitution and applies to trials in state courts through the Fourteenth Amendment of the United States Constitution. Gideon v. Wainwright, 372 U.S. 335, 342-45, 83 S.Ct. 792, 795-97, 9 L.Ed.2d 799, 804-06 (1963). However, the United States Supreme Court has declared that there is no constitutional right to an attorney in state post-conviction proceedings. Coleman v. Thompson, 501 U.S. 722, 752, 111 S.Ct. 2546, 2566, 115 L.Ed.2d 640, 671 (1991) (citations omitted). Therefore, whether a convicted criminal has the right to counsel during habeas proceedings is a question for states to determine.
[¶ 19.] The South Dakota Legislature has required that counsel be appointed for indigent prisoners in habeas proceedings:
If a person has been committed, detained, imprisoned or restrained of his liberty ... and if upon application made in good faith to the court or judge thereof, having jurisdiction, for a writ of habeas corpus, it is satisfactorily shown that the person is without means to prosecute the proceeding, the court or judge shall appoint counsel....
SDCL 21-27-4. Even though Krebs did not have a constitutional right to counsel during his first habeas proceeding, he did have a statutory right to counsel.
[¶ 20.] Obviously, this statutory right to counsel is not restricted to the appointment of a person who merely fulfills the requirements of obtaining a license to practice law in South Dakota. There is an inherent requirement that the attorney be competent and provide adequate representation. See Iovieno v. Comm'r of Correction, 242 Conn. 689, 699 A.2d 1003, 1010 (1997) (claim of ineffective assistance of post-conviction counsel is a viable claim because statute requires the appointment of post-conviction counsel) (citing Lozada v. Warden, 223 Conn. 834, 613 A.2d 818, 821-24 (1992)). The rationale is best explained by the Lozada court: "[i]t would *327 be absurd to have the right to appointed counsel who is not required to be competent:"
`[C]ounsel should be appointed in post conviction matters.... When counsel is so appointed he must be effective and competent. Otherwise, the appointment is a useless formality.'

Lozada, 613 A.2d at 821 (emphasis added) (quoting Cullins v. Crouse, 348 F.2d 887, 889 (10th Cir.1965)) (citing United States v. Wren, 682 F.Supp. 1237, 1241-42 (S.D.Ga.1988) ("an indigent federal probationer's statutory right to appointed counsel at a probation revocation hearing ... `would be meaningless if it did not embody a requirement that counsel be effective as well as merely present.'")). To require counsel and permit less than effective counsel during representation would be to assert that the purpose of this statute is meaningless, the purpose of our judicial system is meaningless and our Rules of Professional Conduct do not apply in habeas.
[¶ 21.] Krebs is statutorily entitled to effective assistance of counsel on one occasion during habeas proceedings. Therefore, the issue is whether attorney Thompson rendered ineffective assistance of counsel in filing a "purported" Sweeney brief favorable to his withdrawal with the first habeas court. In order to prevail on a claim of ineffective assistance of counsel, Krebs must show that his counsel's performance was deficient and that this deficient performance actually prejudiced his defense. Strickland, 466 U.S. at 687, 104 S.Ct. at 2064, 80 L.Ed.2d at 693. To show actual prejudice, Krebs must demonstrate that, but for trial counsel's deficient performance, there is a reasonable probability that the result of the trial would have been different. Id.
[¶ 22.] Since 1992, we have required court-appointed attorneys to follow specific procedures when they believe that the habeas case is wholly frivolous. See Sweeney v. Leapley, 487 N.W.2d 617, 620 (S.D.1992) (recognizing that South Dakota affords more protection for defendants in habeas proceedings than required by the United States Supreme Court). Sweeney was based on Anders v. California, 386 U.S. 738, 744-45, 87 S.Ct. 1396, 1400, 18 L.Ed.2d 493, 498-99 (1967). After a thorough examination of the case, if the attorney determines that his client's case is frivolous, he may request permission to withdraw. However, that request must "be accompanied by a brief referring to anything in the record that might arguably support the appeal." Id. at 619. This does not mean that the brief set forth all the reasons why the attorney believes the case is frivolous. On the contrary, this means that the brief set forth the client's arguments in the best manner possible. This is the only method which enables the court, rather than counsel, to determine whether the case is in fact frivolous.
[¶ 23.] Thompson filed a motion to withdraw, accompanied by a brief, in April of 1994. Krebs, however, argues that Thompson's "no merit" brief was "written for the Stateor, at the very least, to support Thompson's own personal desires to be relieved of further representation." More specifically, one of Krebs' claims on habeas was that his trial counsel was ineffective in failing to interview or call an alibi witness for Krebs. Thompson did not even attempt to investigate the location or proffered testimony of the alibi witness. Instead, he drafted a Sweeney brief, which was devoid of the subject of the alibi witness. Clearly, this selective editing of the subject matter is contrary to the letter and spirit of Anders and our Sweeney decision. See Sweeney, 487 N.W.2d at 619 (stating that it is the court, not counsel, who "decide[s] whether the case is wholly frivolous."). The Sweeney brief is supposed to help, not harm, the petitioner. Thompson's violation of the Sweeney requirements amounts to prejudicial ineffective assistance of counsel.
[¶ 24.] The purpose of the first habeas was to challenge the effectiveness of his attorney at trial. We have often stated *328 that a direct appeal is not the appropriate method to assert ineffective assistance of counsel claims. State v. Cochrun, 434 N.W.2d 370, 373 (S.D.1989) (citations omitted); State v. Davis, 401 N.W.2d 721, 725-26 (S.D.1987) (citations omitted); State v. Tchida, 347 N.W.2d 338, 339 (S.D.1984); State v. McBride, 296 N.W.2d 551, 556 (S.D.1980). See also Fernandez v. Cook, 783 P.2d 547, 550 (Utah 1989) (stating: "[t]he sixth amendment right to effective assistance of counsel is imperiled if an alleged violation of that right cannot be raised for the first time in a habeas corpus proceeding when the allegedly ineffective trial counsel also represented the defendant on appeal and failed to raise the issue at that stage."). Rather, habeas corpus is the more appropriate forum in which to assert these claims. Tchida, 347 N.W.2d at 339 (recognizing that one exception applies which allows the issue of incompetent counsel to be raised on direct appeal: "when the representation was `so casual that the trial record evidences a manifest usurpation of appellant's constitutional rights.'") (quoting State v. Phipps, 318 N.W.2d 128, 131 (S.D.1982)).
[¶ 25.] The State also argued that Krebs was not entitled to bring a second habeas proceeding based on the doctrine of res judicata. I disagree.
[¶ 26.] "The doctrine of res judicata serves as claim preclusion to prevent relitigation of an issue actually litigated or which could have been properly raised and determined in a prior action." SDDS, Inc. v. South Dakota, 1997 SD 114, ¶ 16, 569 N.W.2d 289, 295 (quoting Hogg v. Siebrecht, 464 N.W.2d 209, 211 (S.D.1990)). "The purpose behind the doctrine is to protect parties `from being subjected twice to the same cause of action, since public policy is best served when litigation has a finality.'" Id. (quoting Moe v. Moe, 496 N.W.2d 593, 595 (S.D.1993)).
[¶ 27.] In determining whether res judicata applies, this court considers, among other factors, whether there was a final judgment on the merits. See D.G. v. D.M.K., 1996 SD 144, ¶ 27, 557 N.W.2d 235, 240 (quoting Wintersteen v. Benning, 513 N.W.2d 920, 921 (S.D.1994) (other citations omitted)). "A judgment on the merits is one which is based on legal rights as distinguished from mere matters of practice, procedure and jurisdiction." Chicago & NorthWestern Railway Co. v. Gillis, 80 S.D. 617, 129 N.W.2d 532, 535 (1964) (citation omitted).
[¶ 28.] Because Krebs was deprived of his statutory right to effective assistance of habeas counsel, his first habeas was dismissed based on an improper Sweeney brief. Furthermore, neither Thompson nor the first habeas court advised Krebs that he could appeal the first habeas court's decision, which accepted Thompson's "no merit" brief. Therefore, his first habeas did not receive substantive consideration on the merits. Although Krebs receives that consideration under the majority opinion, I dissent as to the conclusion reached.
[¶ 29.] In summary, Krebs was provided ineffective assistance of counsel at trial. Therefore, pursuant to our rationale above, Krebs correctly brought his ineffective assistance of counsel claim in habeas court. However, he was provided with ineffective assistance of counsel during his first habeas proceeding. In the interest of justice and fairness, Krebs was entitled to effective assistance of counsel on one occasion. However, Krebs was denied this right at trial and during his habeas. Now, the majority opinion tells Krebs that he had a statutory right to assistance of counsel in habeas, and a right to effective counsel, but that he has not shown sufficient prejudice. I disagree and therefore, dissent.
NOTES
[1]  We note there was a four-year lapse before the amended application for writ of habeas corpus was filed on January 16, 1998. It appears from the record the reason for this was that two other attorneys were appointed by the court before Walter was appointed. Sioux Falls attorney Jamie Haworth was appointed by the court on November 17, 1994. On March 5, 1996, Haworth moved to be discharged as Krebs' counsel, and was discharged on March 8, 1996. Attorney Steve Binger, of Sioux Falls, was appointed by the court on March 11, 1996, but was discharged in 1997. Subsequently Walter was appointed Krebs' counsel on October 28, 1997.
