                     FOR PUBLICATION

    UNITED STATES COURT OF APPEALS
         FOR THE NINTH CIRCUIT


 NAOMI FAWN MARSH,                                 No. 12-17014
              Plaintiff-Appellant,
                                                     D.C. No.
                     v.                           3:11-cv-02096-
                                                       CRB
 CAROLYN W. COLVIN, Acting
 Commissioner of Social Security
 Administration                                   ORDER AND
                Defendant-Appellee.              SUPERSEDING
                                                   OPINION


       Appeal from the United States District Court
           for the Northern District of California
     Charles R. Breyer, Senior District Judge, Presiding

                    Submitted June 8, 2015*
                    San Francisco, California

                       Filed July 10, 2015

       Before: Barry G. Silverman, Ronald M. Gould,
          and Andrew D. Hurwitz, Circuit Judges.

                            Order;
                    Opinion by Judge Gould

  *
    The panel unanimously concludes this case is suitable for decision
without oral argument. See Fed. R. App. P. 34(a)(2).
2                        MARSH V. COLVIN

                           SUMMARY**


                          Social Security

    The panel granted a joint motion for clarification,
withdrew the opinion filed on June 18, 2015, and filed a
superseding opinion vacating the district court’s order
affirming the Social Security Commissioner’s denial of a
claimant’s application for social security disability benefits.

     The panel held that harmless error analysis applied to the
case to assess the impact of the administrative law judge’s
failure to mention Dr. David Betat or his clinical progress
notes. The panel further held that the district court did not
offend the principle of SEC v. Chenery Corp., 332 U.S. 194,
196 (1947) (stating that a reviewing court may only affirm
agency action on “the grounds invoked by the agency”), when
it applied harmless error analysis.

    The panel also held that the ALJ erred by not mentioning
Dr. Betat or his notes in the written decision. The panel could
not confidently conclude that the error was harmless.
Pursuant to sentence four of 42 U.S.C. § 405(g), the panel
remanded with instructions to the district court to remand to
the ALJ, and specifically to invite the ALJ to comment on Dr.
Betat’s medical opinions and records.




  **
     This summary constitutes no part of the opinion of the court. It has
been prepared by court staff for the convenience of the reader.
                     MARSH V. COLVIN                        3

                        COUNSEL

James Hunt Miller, Oakland, California, for Plaintiff-
Appellant.

Melinda L. Haag, United States Attorney, Grace M. Kim,
Regional Chief Counsel, Region IX, and Shea Lita Bond,
Special Assistant United States Attorney, Social Security
Administration, San Francisco, California, for Defendant-
Appellee Carolyn W. Colvin.


                          ORDER

   The parties’ “Joint Motion for Clarification of the Court’s
June 18, 2015 Opinion” is GRANTED. The opinion in the
above-captioned matter, filed on June 18, 2015, is
WITHDRAWN. The superseding opinion shall be filed
concurrently with this order.



                         OPINION

GOULD, Circuit Judge:

    Naomi Marsh appeals the district court’s order affirming
the Social Security Commissioner’s denial of her application
for social security disability benefits. We have jurisdiction
under 28 U.S.C. § 1291, and we vacate and remand with
instructions.
4                    MARSH V. COLVIN

                              I

    Marsh applied for disability benefits on November 21,
2006, claiming that she became disabled on October 2, 2001
from a work-related injury to her back, leg, and hip, and from
complications arising from a car wreck. After the agency
denied her application initially and on reconsideration, Marsh
requested a hearing before an Administrative Law Judge
(“ALJ”); the ALJ also denied benefits. The record on which
the ALJ denied Marsh’s application contains, among other
evidence, medical opinions from several doctors, including
clinical progress (SOAP) notes from Dr. David H. Betat,
M.D. Dr. Betat’s SOAP notes track Marsh’s clinical
progress, beginning in September 2003 and ending in
November 2006. Dr. Betat’s SOAP note from January 31,
2006 states, in part:

       The patient has chronic trochanteric bursitis to
       the point that she is pretty much
       nonfunctional. She also finds herself not
       being able to concentrate enough to do office
       work such as bookkeeping. The patient
       appears to be disabled, unfortunately, at a
       fairly young age. It seems to be legitimate,
       although it is sometimes difficult to tell for
       sure.

The ALJ’s decision denying Marsh disability benefits
nowhere mentions Dr. Betat or his SOAP notes.

    The ALJ’s denial became the agency’s final decision after
the agency’s Appeals Council denied further review. Marsh
sought judicial review of the agency’s decision, and the
district court affirmed the agency. The district court also
                     MARSH V. COLVIN                         5

denied Marsh’s Rule 59(e) motion for reconsideration, see
Fed. R. Civ. P. 59(e), which challenged the district court’s
application of harmless error to the ALJ’s denial of benefits.

                              II

    We review de novo a district court’s judgment upholding
an agency denial of social security benefits. See Berry v.
Astrue, 622 F.3d 1228, 1231 (9th Cir. 2010). We will set
aside a denial of benefits only if the denial is unsupported by
substantial evidence in the administrative record or is based
on legal error. See id.

                             III

    Marsh argues that the law applying harmless error
analysis to social security cases is unclear and that no
published authority of our court has applied harmless error
analysis to a social security case where an ALJ ignores a
treating source’s medical opinion. But we apply harmless
error analysis to social security cases. See McLeod v. Astrue,
640 F.3d 881, 887 (9th Cir. 2011); Molina v. Astrue, 674 F.3d
1104, 1115 (9th Cir. 2012) (“We have long recognized that
harmless error principles apply in the Social Security Act
context.”).     The nature of that application is fact-
intensive—“no presumptions operate” and “we must analyze
harmlessness in light of the circumstances of the case.” Id. at
1121 (internal quotation marks omitted). We decline to draw
the distinction that Marsh urges, i.e., one based on the nature
or source of evidence ignored in an ALJ’s opinion. We hold
that harmless error analysis applies in this case to assess the
impact of the ALJ’s failure to even mention Dr. Betat or his
SOAP notes, let alone its failure to give “specific and
legitimate reasons that are supported by substantial evidence”
6                       MARSH V. COLVIN

for rejecting a treating source’s medical opinion. Garrison v.
Colvin, 759 F.3d 995, 1012 (9th Cir. 2014).

    Marsh also argues that the district court exceeded its
authority when it applied harmless error analysis, violating
the rule of Sec. & Exch. Comm’n v. Chenery Corp., 332 U.S.
194, 196 (1947) (stating that a reviewing court may only
affirm agency action on “the grounds invoked by the
agency”). If the district court had applied harmless error in
a way that affirmed the agency on a ground not invoked by
the ALJ, then the district court would have violated the
Chenery principle. See Stout v. Comm’r, Soc. Sec. Admin.,
454 F.3d 1050, 1054 (9th Cir. 2006). But Marsh did not
show that the district court affirmed the agency on a ground
that the ALJ had not invoked in its written decision. The
district court’s conclusion that Dr. Betat’s SOAP notes
“provide minimal additional insight,” as to Marsh’s condition
did not preclude the district court from “[g]iving full effect”
to the ALJ’s reasoning. Molina, 674 F.3d at 1121. The
district court expressly stated that Dr. Betat’s notes “do[] not
contradict the determination of the ALJ.” The district court
did not offend the principle of Chenery.

    Marsh further argues that the ALJ erred by not
mentioning Dr. Betat’s SOAP notes in its written decision.
We agree. As we note above, an ALJ may reject a treating
source’s opinion that is contradicted by another doctor’s
opinion only “by providing specific and legitimate reasons
that are supported by substantial evidence.”1 Garrison,


    1
    We reject the Commissioner’s contentions that Dr. Betat was not a
“treating source” and that his SOAP notes were not “medical opinion.”
The district court correctly applied the Commissioner’s regulation
defining “treating source” to conclude that Dr. Betat was one of Marsh’s
                         MARSH V. COLVIN                                7

759 F.3d at 1012. Here, the ALJ gave no reasons for not
mentioning Dr. Betat or his SOAP notes. That was error.
Because a court must give “specific and legitimate reasons”
for rejecting a treating doctor’s opinions, it follows even
more strongly that an ALJ cannot in its decision totally ignore
a treating doctor and his or her notes, without even
mentioning them. See id. (“Where an ALJ does not explicitly
reject a medical opinion . . . he errs.”).

    We next address whether that error was harmless. As we
explained above, harmless error analysis applies in the social
security context, and we find no authority that would lead us
to adopt the rule suggested by Marsh to make distinctions
where a treating source’s medical opinion is not mentioned.
However, our precedents have been cautious about when
harmless error should be found, even though the analytical
framework itself applies broadly. For example, in Stout, we
held that an ALJ’s silent disregard of lay testimony was not
harmless, and we explained that ALJ errors in social security
cases are harmless if they are “inconsequential to the ultimate
nondisability determination” and that “a reviewing court
cannot consider [an] error harmless unless it can confidently
conclude that no reasonable ALJ, when fully crediting the
testimony, could have reached a different disability
determination.” Stout, 454 F.3d at 1055–56. Recently, in
McLeod, we cautioned:




treating sources. See 20 C.F.R. § 404.1502. Dr. Betat’s SOAP notes are
“medical opinion,” because they contain “statements from [Dr. Betat] that
reflect judgments about the nature and severity of [Marsh’s]
impairment(s), including [her] symptoms, diagnosis and prognosis, what
[she] can still do despite her impairment(s), and [her] physical or mental
restrictions.” 20 C.F.R. § 404.1527.
8                     MARSH V. COLVIN

       [W]here the circumstances of the case show a
       substantial likelihood of prejudice, remand is
       appropriate so that the agency can decide
       whether re-consideration is necessary. By
       contrast, where harmlessness is clear and not
       a borderline question, remand for
       reconsideration is not appropriate.

McLeod, 640 F.3d at 888 (internal quotation marks omitted).

     We reject the idea that not mentioning a treating source’s
medical opinion precludes use of harmless error doctrine, but
at the same time, because our law requires “specific and
legitimate reasons that are supported by substantial evidence”
for rejecting a treating source’s medical opinion, that
precedent surely implies that an ALJ must discuss the
relevant views of a treating source. Our precedents do not
quantify the degree of certainty needed to conclude that an
ALJ’s error was harmless, and we would hesitate to suggest
a rigid rule for all such cases. But it does seem that where the
magnitude of an ALJ error is more significant, then the
degree of certainty of harmlessness must also be heightened
before an error can be determined to be harmless. In other
words, the more serious the ALJ’s error, the more difficult it
should be to show the error was harmless.

    Here, the district court gave persuasive reasons to
determine harmlessness. But the decision on disability rests
with the ALJ and the Commissioner of the Social Security
Administration in the first instance, not with a district court.
See 20 C.F.R. § 404.1527(d)(1)–(3). In the circumstances of
this case, where the ALJ did not even mention Dr. Betat’s
opinion that Marsh’s chronic bursitis rendered her “pretty
much nonfunctional,” we cannot “confidently conclude” that
                          MARSH V. COLVIN                                 9

the error was harmless. See Stout, 454 F.3d at 1056; Bowen
v. Comm’r of Soc. Sec., 478 F.3d 742, 750 (6th Cir. 2007).
We think it is most appropriate to vacate the district court’s
opinion, remand with instructions to the district court to
remand to the ALJ, and specifically to invite the ALJ to
comment on Dr. Betat’s medical opinions and records.2 This
remand is pursuant to sentence four of 42 U.S.C. § 405(g).3

   VACATED and REMANDED with INSTRUCTIONS.
Each party shall bear its own costs.


  2
     We reject Marsh’s argument that the ALJ erred by discounting her
testimony on symptom severity and physical limitations because the ALJ
“held Marsh’s good work history against her.” An ALJ may reject a
claimant’s testimony about symptom severity “only by offering specific,
clear and convincing reasons for doing so.” Lingenfelter v. Astrue,
504 F.3d 1028, 1036 (9th Cir. 2007). And such reasons must be supported
by substantial evidence from the administrative record. See Meier v.
Colvin, 727 F.3d 867, 872 (9th Cir. 2013). Here, the ALJ satisfied this
standard when he found: (1) that Marsh’s treatment was “routine or
conservative”; (2) that gaps existed in Marsh’s treatment regimen; (3) that
Marsh did not take a type and dosage of medication consistent with the
alleged severity of her impairments; (4) that Marsh was able to attend
vocational rehabilitation classes, “indicating activities in excess of the
residual functional capacity”; (5) that Marsh, with assistance, cared for a
six-year-old child; and (6) that Marsh’s “limited work history also detracts
from the credibility of her subjective allegations.” None of these reasons
was impermissible. We reject Marsh’s contention that the ALJ’s reference
to her work history was improper. See 20 C.F.R. § 404.1529(c)(3);
Thomas v. Barnhart, 278 F.3d 947, 959 (9th Cir. 2002). The ALJ properly
discounted the credibility of Marsh’s testimony about the severity and
intensity of her symptoms, and the physical limitations caused by those
symptoms.
  3
     Sentence four of 42 U.S.C. § 405(g) states: “The court shall have
power to enter, upon the pleadings and transcript of the record, a judgment
affirming, modifying, or reversing the decision of the Commissioner of
Social Security, with or without remanding the cause for a rehearing.”
