TASHIMA, District Judge:
Appellant Tom Neeley Mullis (“Mullis” or “appellant”) appeals the district court’s dismissal of his civil rights action against four bankruptcy judges (the “bankruptcy judge” or “judges”) of the United States Bankruptcy Court for the District of Nevada (the “bankruptcy court”), the bankruptcy court clerk and two deputy clerks (the “clerk” or “clerks”) and a bankruptcy court trustee (“Martz” or the “trustee”). We affirm.
I. FACTS AND PROCEDURAL BACKGROUND
This dispute arises from the treatment of a bankruptcy petition. The complaint alleges that Mullis sent his wife to the bankruptcy court with his bankruptcy petition, which contained no designation of the chapter of the Bankruptcy Code under which Mullis was filing.1 He sent his wife there to find out from the clerks under which chapter of the Bankruptcy Code he could file that would permit him subsequently to withdraw or dismiss his petition as a matter of right.
Mullis alleges that the clerks neither provided his wife with the requested information nor advised her that they could not give legal advice, but instead “took” his petition and schedules from her, “stating that the petition and schedules would be filed under the appropriate chapter of the bankruptcy code.” The clerks collected a filing fee from his wife, then accepted and filed the petition under Chapter 7. A clerk later refused to accept and file an amended petition and schedules on the ground that the chapter designated on the petition was incorrect.
[1387]*1387Mullis filed a motion to withdraw his petition and dismiss the bankruptcy case. The bankruptcy judge denied this motion. Mullis purported to appeal this order. Both the bankruptcy judge and the district judge to whom the appeal was taken denied Mullis’ motions for a stay of the bankruptcy court’s order and suspension of further proceedings pending appeal.2 Mullis also petitioned this Court for writs of mandamus and prohibition directing the bankruptcy court to cease all further proceedings in the bankruptcy case for want of jurisdiction pending final disposition of the appeal to the district court. We denied the petition, finding that Mullis had not demonstrated that he was threatened with irreparable injury.3
The district court, first noting that the denial of a motion to dismiss is an interlocutory order and that Mullis had not sought leave to appeal, concluded that the bankruptcy court had a reasonable basis for its order.4 Treating the notice of appeal as a motion for leave to appeal under Bankr.R. 8003(c), it denied leave to appeal and dismissed the appeal.5
Mullis then commenced this action. He alleges that through a variety of acts relating to the treatment of his bankruptcy case, described further below, appellees violated his rights to due process under the Fifth Amendment, to self-representation under the Sixth Amendment and to petition the government for redress of his grievances and to access to the courts under the First and Sixth Amendments. He seeks monetary damages, declaratory and injunc-tive relief.
II. ISSUES6
1. Are appellees immune from damages?
2. Are appellees immune from injunc-tive and declaratory relief?
III. DISCUSSION
Initially, we note that Mullis mistakenly designates his action throughout his complaint and briefs as an action under 42 U.S.C. § 1983 (“§ 1983”). The district court also treated it as a § 1983 action. Because appellees were all acting under color of federal law, not state law, the constitutional violations alleged in the complaint are more properly characterized as alleging direct constitutional tort claims under Bivens v. Six Unknown Named Agents of the Fed. Bureau of Narcotics, 403 U.S. 388, 91 S.Ct. 1999, 29 L.Ed.2d 619 (1971).7 See Daly-Murphy v. Winston, 820 F.2d 1470, 1477 (9th Cir.1987).
The district court dismissed the action on the grounds that: (1) the bankruptcy court eo nomine was absolutely immune under the doctrine of sovereign immunity;8 (2) the judges were absolutely immune under [1388]*1388the doctrine of judicial immunity; and (3) the clerks and trustee had absolute quasi-judicial immunity. It also held that appel-lees’ judicial or quasi-judicial immunity barred appellant from seeking prospective injunctive relief.
A. Standard of Review
A dismissal under Rule 12(b)(6) is subject to de novo review. E.g., Kelson v. City of Springfield, 767 F.2d 651, 653 (9th Cir.1985). In reviewing such a dismissal, it must appear to a certainty that plaintiff would not be entitled to relief under any set of facts that could be proved. E.g., King v. Atiyeh, 814 F.2d 565, 567 (9th Cir.1987). In civil rights cases where, as here, the plaintiff is acting pro se, the court has an obligation to construe the pleadings liberally and to afford the plaintiff the benefit of any doubt. Id. However, facts subject to judicial notice may be considered on a motion to dismiss. Mack v. South Bay Beer Distrib., Inc., 798 F.2d 1279, 1282 (9th Cir.1986).9
B. Immunity From Damages
(1)The Bankruptcy Judges
Judges are absolutely immune from civil liability for damages for their judicial acts. Bradley v. Fisher, 80 U.S. (13 Wall.) 335, 347, 20 L.Ed. 646 (1872). See also Pierson v. Ray, 386 U.S. 547, 87 S.Ct. 1213, 18 L.Ed.2d 288 (1967) (applying judicial immunity to § 1983 action). “A judge will not be deprived of immunity because the action he took was in error, was done maliciously, or was in excess of his authority; rather, he will be subject to liability only when he has acted in the ‘clear absence of all jurisdiction.’ ” Stump v. Sparkman, 435 U.S. 349, 356-57, 98 S.Ct. 1099, 1104-05, 55 L.Ed.2d 331 (1978) (citing Bradley, 80 U.S. (13 Wall.) at 351, 20 L.Ed. 646).
Mullis alleges that the bankruptcy judges committed the following acts:
(1) failed to allow Mullis to withdraw from bankruptcy;
(2) (after notice of Mullis’ appeal) continued to:
(a) administer the bankruptcy estate,
(b) conduct creditor meetings and debtor examinations, and
(c) enter orders;
(3) communicated ex parte with the trustee;
(4) failed to comply strictly with Local Rule 16(e) (which provides that failure to file a memorandum of points and authorities with a motion constitutes a consent to the denial of the motion);
(5) (with respect to Mullis’ motion to remove the trustee) refused to allow Mullis to present evidence, struck as scandalous one of Mullis’ filings, ordered Mullis to leave the courtroom, and failed to remove Martz as trustee;
(6) refused to increase the trustee’s bond;
(7) granted Martz’s ex parte motion requiring Mullis to pay him $1,000 before Mullis could take his deposition; and
(8) issued a temporary restraining order preventing Mullis from using the earnings from his private medical practice and ordered Mullis to produce confidential records.
Appellant does not dispute that the bankruptcy judges engaged in judicial acts. He contends that the acts were performed in the “clear absence of all jurisdiction.” Mullis advances two grounds for this argument. First, he asserts that his bankruptcy petition was jurisdictionally defective under 11 U.S.C. § 301, which provides that a voluntary bankruptcy case is commenced by filing a petition under one of the chapters of Title ll.10 He contends that be[1389]*1389cause his petition failed to indicate on its face on which chapter of the Bankruptcy Code he was relying, the petition did not invoke the jurisdiction of the bankruptcy court under § 301. Second, he contends that the bankruptcy judges lacked all jurisdiction over matters arising from his bankruptcy petition after he filed his notice of appeal from the order denying his motion to withdraw his petition and to dismiss the bankruptcy case. He argues that his properly filed notice of appeal divested the bankruptcy court of jurisdiction over his petition, citing In re Bialac, 15 B.R. 901, 903 (Bankr. 9th Cir.1981), aff’d, 694 F.2d 625 (9th Cir.1982).
These contentions are without merit. Appellant misconstrues the meaning of the “clear absence of all jurisdiction” exception to the doctrine of judicial immunity. The Supreme Court has illustrated the distinction between an act in the clear absence of jurisdiction and an act in excess of jurisdiction with this example:
if a probate judge, with jurisdiction over only wills and estates, should try a criminal case, he would be acting in the clear absence of jurisdiction and would not be immune from liability for his action; on the other hand, if a judge of a criminal court should convict a defendant of a nonexistent crime, he would merely be acting in excess of his jurisdiction and would be immune.
Stump, 435 U.S. at 357 n. 7, 98 S.Ct. at 1105 n. 7 (citing Bradley, 80 U.S. (13 Wall.) at 352, 20 L.Ed. 646). A clear absence of all jurisdiction means a clear lack of all subject matter jurisdiction. Bradley, 80 U.S. (13 Wall.) at 351-52. See also Rankin v. Howard, 633 F.2d 844, 848-49 (9th Cir.1980) (“a judge who acts in the clear and complete absence of personal jurisdiction loses his judicial immunity”), cert. denied, 451 U.S. 939, 101 S.Ct. 2020, 68 L.Ed.2d 326 (1981); O’Neil v. City of Lake Oswego, 642 F.2d 367, 369 (9th Cir.1981) (holding that a judge who convicted defendant for contempt, an act within the court’s jurisdiction, but without the affidavit required by statute to confer jurisdiction over the offense charged was still entitled to immunity; his act was merely in excess of his jurisdiction).
The bankruptcy judges clearly had subject matter jurisdiction over the bankruptcy petition and proceedings under 28 U.S.C. §§ 151 and 1334. Mullis does not allege that he did not intend to file for bankruptcy; he merely states that his petition did not indicate under which chapter he was filing and that the bankruptcy court improperly retained jurisdiction after commencement of his appeal to the district court. What Mullis alleges are, at most, errors or acts in excess of jurisdiction, not acts in the clear absence of all jurisdiction.11
Thus, we affirm the district court’s ruling that the bankruptcy judges had absolute judicial immunity from money damages.
[1390]*1390(2)The Clerks
Mullis contends that the clerks who initially accepted and filed his petition and who later refused to accept an amended petition are entitled to only qualified immunity or that, if they are entitled to quasi-judicial immunity, they acted in the clear absence of all jurisdiction.
Court clerks have absolute quasi-judicial immunity from damages for civil rights violations when they perform tasks that are an integral part of the judicial process. See Morrison v. Jones, 607 F.2d 1269, 1273 (9th Cir.1979) (§ 1983 case), cert. denied, 445 U.S. 962, 100 S.Ct. 1648, 64 L.Ed.2d 237 (1980); Shipp v. Todd, 568 F.2d 133, 134 (9th Cir.1978) (same); Stewart v. Minnick, 409 F.2d 826 (9th Cir.1969) (same). Cf. Sharma v. Stevas, 790 F.2d 1486 (9th Cir.1986) (Clerk of United States Supreme Court had absolute quasi-judicial immunity under Federal Tort Claims Act because his acts were an integral part of the judicial process).
The complaint alleges that the court clerks committed the following acts:
(1) failed to give proper counselling and notice regarding the chapters of the Bankruptcy Code under which Mullis could file, as allegedly required by 11 U.S.C. § 342(b);
(2) accepted and filed the incomplete bankruptcy petition under Chapter 7; and
(3) later refused to accept an amended petition.
Even if all of these allegations are taken as true, they all properly are characterized as integral parts of the judicial process. The commencement of an action by filing a complaint or petition is a basic and integral part of the judicial process. See, e.g., 11 U.S.C. § 301 (voluntary bankruptcy case commenced by filing a petition); Bankr.R. 1002(a) (same); F.R.Civ.P. 3 (civil action commenced by filing a complaint). The clerk of court and deputy clerks are the officials through whom such filing is done. Consequently, the clerks qualify for quasi-judicial immunity unless these acts were done in the clear absence of all jurisdiction.
As noted above, a mistake or an act in excess of jurisdiction does not abrogate judicial immunity, even if it results in “grave procedural errors.” Stump, 435 U.S. at 359, 98 S.Ct. at 1106. Here, the complaint alleges that the clerks erred in failing to carry out their alleged duties. All of the acts complained of, however, are within the general “subject matter jurisdiction” of the bankruptcy clerks, as is evident from 11 U.S.C. §§ 301 and 342(b).
Thus, the clerks had quasi-judicial immunity and did not act in the clear absence of all jurisdiction. As a result, the district court’s ruling that the court clerks had absolute immunity from damages is affirmed.
(3)The Bankruptcy Trustee
Martz also has absolute quasi-judicial immunity from damages. Lonneker Farms, Inc. v. Klobucher, 804 F.2d 1096, 1097 (9th Cir.1986); Mosher v. Saalfelt, 589 F.2d 438, 442 (9th Cir.1978), cert. denied, 442 U.S. 941, 99 S.Ct. 2883, 61 L.Ed.2d 311 (1979). The trustee or receiver derives his immunity from the judge who appointed him. Id. Thus, the trustee also loses his immunity if he acts in the clear absence of all jurisdiction.
The complaint alleges that Martz performed the following acts:
(1) refused to recommend Mullis’ motion to withdraw and refused to enforce the requirements of 11 U.S.C. §§ 301 and 342(b);
(2) refused to acknowledge that the bankruptcy court lost jurisdiction once notice of appeal was filed;
(3) filed a motion for the appointment of a guardian ad litem and admitted that this motion was an attempt to prevent Mullis from representing himself; and
(4) communicationed ex parte with the judges.
These were all acts or omissions within the ambit of the trustee’s official duties. Mullis does not dispute this, but repeats his arguments that the acts were performed in the clear absence of all jurisdiction. These arguments were discussed and disposed of [1391]*1391above, in relation to the bankruptcy judges’ immunity. Since the judges had immunity, so did the trustee they appointed. Consequently, the district court’s ruling as to Martz’s immunity from damages also is affirmed.
C. Immunity From Declaratory and Injunctive Relief
In addition to damages, Mullis seeks both declaratory relief under 28 U.S.C. §§ 2201 and 2202 and injunctive relief. He contends that even if appellees are entitled to judicial or quasi-judicial immunity from damages, that immunity does not apply to prospective equitable relief. Appellant seeks an order declaring that appellees violated his constitutional rights in various ways during the bankruptcy proceedings and an injunction ordering the dismissal of the bankruptcy case and prohibiting enforcement of any orders or judgments entered during the proceedings.12 The district court, relying on Mirin v. Justices of the Supreme Court, 415 F.Supp. 1178 (D.Nev.1976), and MacKay v. Nesbett, 285 F.Supp. 498 (D.Alaska 1968), aff’d, 412 F.2d 846 (9th Cir.), cert. denied, 396 U.S. 960, 90 S.Ct. 435, 24 L.Ed.2d 425 (1969), held that absolute judicial and quasi-judicial immunity barred declaratory and injunctive relief.
These cases, both brought under § 1983, have been overruled. It is now established that judicial immunity does not bar declaratory or injunctive relief in actions under § 1983. Pulliam v. Allen, 466 U.S. 522, 541-42, 104 S.Ct. 1970, 1980-81, 80 L.Ed.2d 565 (1984); Ashelman v. Pope, 793 F.2d 1072, 1075 (9th Cir.1986) (en banc). However, whether the Pulliam exception applies or whether judicial immunity bars equitable relief in a Bivens action, such as the case at hand, is an issue of first impression in this Circuit.
Our research has found only two post-Pulliam cases in which the defendant asserted judicial immunity against equitable relief in a Bivens action.13 In Affeldt v. Carr, 628 F.Supp. 1097 (N.D.Ohio 1985), the court dismissed an action for damages and declaratory and injunctive relief against a United States magistrate based on asserted violations of plaintiff’s constitutional rights. The court there followed Pulliam, holding that the magistrate had absolute judicial immunity from damages, [1392]*1392but that judicial immunity did not apply to claims for declaratory and injunctive relief. Id. at 1102. Nonetheless, the court noted that the usual requirements for an award of equitable relief applied in civil rights cases so that “the plaintiff must show that he has an inadequate remedy at law and a serious risk of irreparable harm.” Id. at 1103 (citing Pulliam, 466 U.S. at 537, 104 S.Ct. at 1978). Affeldt held that plaintiff had an adequate remedy at law because all of the magistrate’s acts could have been reviewed on appeal to the district court, the court of appeals and the Supreme Court or by extraordinary writ. As an alternative, plaintiff could have sought disqualification of the magistrate. Id. The court also found that plaintiff had not shown any threat of irreparable harm or injury and that greater injury would “be caused to the administration of justice and the ability of the Magistrate to perform his duties” if it were to grant the declaratory and injunctive relief sought. Id. Thus, the court held that equitable relief was unavailable in the circumstances of that case.14
Affeldt illustrates the anomaly that arises when the Pulliam exception to judicial immunity is applied against a federal judicial officer. Where a federal official meets the prerequisites for judicial or quasi-judicial immunity from damages, there will invariably be an adequate remedy through either ordinary appeals or by extraordinary writ. In the case at bench, appellant had adequate remedies through: (1) appeal from the bankruptcy court to the bankruptcy appellate panel or the district court and then to this Court under 28 U.S.C. § 158(a), (b)(1) and (d);15 (2) this Court’s powers under the All Writs Act, 28 U.S.C. § 1651;16 (3) a motion to withdraw the reference to the bankruptcy court, 28 U.S.C. § 157(d); or (4) a motion to disqualify the bankruptcy judge, Bankr.R. 5004(a), or the district judge, 28 U.S.C. §§ 144 & 455. Indeed, a quick perusal of the voluminous entries on the docket of the underlying bankruptcy case17 reveals that Mullis made more than ample use of the available procedures for appeal and mandamus.
Given these remedies, a bankruptcy litigant cannot show an inadequate remedy “at law” and a serious risk of irreparable harm, prerequisites to injunctive relief under Pulliam, 466 U.S. at 537, 104 S.Ct. at 1978.18 However, the threat of damage to the orderly administration of justice in the federal court system is great. By styling his or her complaint as a Bivens injunctive action, a federal court litigant could circumvent the limitations on direct appeal, including interlocutory appeal, and for extraordinary writs. To allow a district court to grant injunctive relief against a bankruptcy court or the district court in the underlying bankruptcy case would be to permit, in effect, a “horizontal appeal” from one dis[1393]*1393trict court to another or even a “reverse review” of a ruling of the court of appeals by a district court.19 Such collateral attacks on the judgments, orders, decrees or decisions of federal courts are improper.20 See Brown v. Baden, 815 F.2d 575, 576-77 (9th Cir.1987); In re Braughton, 520 F.2d 765, 766 (9th Cir.1975); Tanner Motor Livery Ltd. v. Avis, Inc., 316 F.2d 804, 810 (9th Cir.), cert. denied, 375 U.S. 821, 84 S.Ct. 59, 11 L.Ed.2d 55 (1963).
In addition, were the district court to grant the injunctive relief appellant here requests, it would in essence be issuing a writ of mandamus to the bankruptcy court and the district court in the underlying proceeding. See Lewis v. Green, 629 F.Supp. 546, 553 (D.D.C.1986). A district court lacks authority to issue a writ of mandamus to another district court. Id.
These problems suggest that the Pulliam exception to judicial immunity should not apply in a Bivens action pending in federal court. Pulliam was a § 1983 action against a state magistrate who imposed bail for nonjailable misdemeanors and committed plaintiffs to jail when they did not post bond. As the dissent pointed out, and the majority acknowledged, the plaintiffs may have had an adequate remedy at law through state court appellate review of the orders which required excessive bail and through state habeas corpus relief from unlawful detention. See 466 U.S. at 553 n. 13, 104 S.Ct. at 1977 n. 13 (Powell, J., dissenting); id. at 542 n. 22,104 S.Ct. at 1981 n. 22. However, the Pulliam majority stressed that Congress enacted § 1983 and its predecessor, § 2 of the Civil Rights Act of 1866, 14 Stat. 27:
to provide an independent avenue for protection of federal constitutional rights. The remedy was considered necessary because “state courts were being used to harass and injure individuals, either because the state courts were powerless to stop deprivations or were in league with those who were bent upon abrogation of federally protected rights.
Id. at 540, 104 S.Ct. at 1980 (quoting Mitchum v. Foster, 407 U.S. 225, 240, 92 S.Ct. 2151, 2161, 32 L.Ed.2d 705 (1972)).
In Pulliam, the Court further noted that many years had passed since those statutes were enacted and that today it would be improper to assume that a state court would not act to prevent, or that a state judge would engage directly in, a deprivation of federal constitutional rights. Id. at 541, 104 S.Ct. at 1980. Nonetheless, the Court concluded “that Congress intended § 1983 to be an independent protection for federal rights” and that there was “nothing to suggest that Congress intended to expand the common-law doctrine of judicial immunity to insulate state judges completely from federal collateral review.” Id.21
[1394]*1394The reasoning of Pulliam simply is inapplicable to a Bivens action. There is no need to carve out an exception to judicial immunity to permit declaratory and injunc-tive relief against federal judicial officers. Should a federal judge or other federal official performing a judicial or quasi-judicial act violate a litigant’s constitutional rights in a proceeding pending in federal court, Congress has provided carefully structured procedures for taking appeals, including interlocutory appeals, and for petitioning for extraordinary writs in Title 28 of the United States Code.22 Through these procedures, a litigant, such as Mullis, receives full federal court review of allegations of deprivations of federal constitutional rights by federal judicial officers acting under color of federal law. To allow an action for declaratory and injunctive relief against federal officials who would be entitled to judicial immunity from damages merely engenders unnecessary confusion and a multiplicity of litigation.
We hold that when a person who is alleged to have caused a deprivation of constitutional rights while acting under color of federal law can successfully assert judicial or quasi-judicial immunity from damages, that immunity also will bar declaratory and injunctive relief. The judicial or quasi-judicial immunity available to federal officers is not limited to immunity from damages, but extends to actions for declaratory, injunctive and other equitable relief. We thus affirm the district court’s ruling, albeit for different reasons.
IV. CONCLUSION
Because it is plain from the face of the complaint and judicially noticeable facts that all appellees were engaged in judicial or quasi-judicial acts and were not acting in the clear absence of all jurisdiction, they are absolutely immune from damages and from declaratory and injunctive relief.
The judgment is AFFIRMED.