
<PAGE>   1

                                                                    EXHIBIT 10.4


                 SECOND AMENDMENT TO SYNDICATED CREDIT AGREEMENT


     THIS SECOND AMENDMENT TO CREDIT AGREEMENT (the "Amendment"), dated as of
June 30, 1998, is entered into by and among WILLIAMS-SONOMA, INC. (the
"Company"), BANK OF AMERICA NATIONAL TRUST AND SAVINGS ASSOCIATION, as agent for
itself and the Banks (the "Agent"), and the several financial institutions party
to the Credit Agreement (collectively, the "Banks").


                                    RECITALS

     A. The Company, Banks, and Agent are parties to a Credit Agreement dated as
of June 1, 1997 (as previously amended, the "Credit Agreement") pursuant to
which the Agent and the Banks have extended certain credit facilities to the
Company.

     B. The Company has requested that the Banks agree to certain amendments of
the Credit Agreement, including a reduction of the Tranche A Commitments.

     C. The Banks are willing to amend the Credit Agreement, subject to the
terms and conditions of this Amendment.

     NOW, THEREFORE, for valuable consideration, the receipt and adequacy of
which are hereby acknowledged, the parties hereto hereby agree as follows:

     1. Defined Terms. Unless otherwise defined herein, capitalized terms used
herein shall have the meanings, if any, assigned to them in the Credit
Agreement.

     2. Amendments to Credit Agreement.

          (a) The definition of "Expiration Date" in Section 1.01 of the Credit
Agreement shall be amended to read as follows:

                      "Expiration Date" means May 31, 2001.

          (b) Schedule 2.01 to the Credit Agreement is amended to read as
follows with respect to Tranche A (the availability of Tranche B has expired):

<TABLE>
<CAPTION>
     Bank                                      Tranche A Commitment             Pro Rata Share
     ----                                      --------------------             --------------
<S>                                            <C>                              <C>       
     Bank of America National Trust            $33,333,333                      66.666666%
     and Savings Association
     NationsBank, N.A.                         $16,666,667                      33.333334%

     Total                                     $50,000,000                      100%
</TABLE>

          (c) Section 2.11(b) is amended to provide that the Commitment Fee
shall be equal to one-eighth of one percent (0.125%) per annum.

          (d) A new Section 5.20 is added as follows:

               5.20 Year 2000 Compliance. The Company has conducted a
          comprehensive review and assessment of the Company's computer
          applications with



                                       1
<PAGE>   2

          respect to the "year 2000 problem" (that is, the risk that computer
          applications may not be able to properly perform date-sensitive
          functions after December 31, 1999) and, based on that review, the
          Company does not believe the year 2000 problem will result in a
          material adverse change in the Company's business condition (financial
          or otherwise), operations, properties or prospects, or ability to
          repay the credit.

          (e) Section 6.01(a) is amended to provide that the opinion of the
Independent Auditor must not be qualified due to possible failure to take all
appropriate steps to successfully address year 2000 system issues.

          (f) Section 6.03 is amended to read as follows:

               6.03 Tangible Net Worth. The Company shall maintain on a
          consolidated basis, as of each date indicated below, the sum of the
          following:

                    (a) the Company's Tangible Net Worth;

                    (b) plus the amount paid by the Company after February 1,
               1998 to purchase, redeem or otherwise acquire the stock of the
               Company, as permitted by paragraph 7.10 below;

                    (c) minus the amount of the proceeds of any stock sold by
               the Company after February 1, 1998;

                    (d) minus the amount of the proceeds of the conversion of
               any debt to stock after February 1, 1998;

          equal to at least the amounts indicated for each date specified below:

<TABLE>
<CAPTION>
               Date                                Amount
               ----                                ------
<S>                                                <C>         
               April 30, 1998                      $180,000,000
               July 31, 1998                       $180,000,000
               October 31, 1998                    $180,000,000
               January 31, 1999                    $210,000,000
               April 30, 1999                      $210,000,000
               July 31, 1999                       $210,000,000
               October 31, 1999                    $210,000,000
               January 31, 2000                    $255,000,000
               April 30, 2000                      $255,000,000
               July 31, 2000                       $255,000,000
               October 31, 2000                    $255,000,000
               January 31, 2001
               and thereafter                      $305,000,000
</TABLE>

          (g) A new Section 6.15 is added to the Agreement as follows:

               6.15 Fixed Charge Coverage Ratio. The Company will maintain a
          Fixed Charge Coverage Ratio of at least 2.25:1.00. "Fixed Charge
          Coverage Ratio" means the ratio of:

                    (a) the sum of net income (or net loss), excluding any tax
               credit; plus depreciation, depletion, amortization and other
               non-cash charges; plus 



                                       2
<PAGE>   3

               income tax expense; plus Operating Lease Expense; plus Rent
               Expense; plus Interest Expense; to

                    (b) the sum of Operating Lease Expense; plus Rent Expense;
               plus Interest Expense; plus principal payments made on amortizing
               long-term debt; plus payments on capital leases; plus principal
               amounts which came due during the period on Indebtedness
               permitted by Subsection 7.05(g) below (distribution center
               financing), to the extent not already included in calculating
               this subsection (b).

          This ratio will be calculated at the end of each fiscal quarter, using
          the results of that quarter and each of the three immediately
          preceding quarters. "Operating Lease Expense" means the amount of
          regularly scheduled payments due under operating leases covering
          personal property. "Rent Expense" means the sum of the following
          amounts for leases covering real property: the sum of minimum rent,
          plus adjustments/credits for deferred lease rent, plus percentage
          rent, plus offsite storage rent. "Interest Expense" means interest on
          Indebtedness, calculated in accordance with GAAP.

          (h) Subsection (d) of Section 7.01 ("Limitation on Liens") is amended
to read as follows:

                    (d) Cash collateral and security deposits provided in
               connection with operating lease obligations incurred to finance
               the acquisition of fixed assets (excluding real property and
               excluding security deposits with utility companies); provided
               that the amount of such collateral and security deposits must not
               exceed Five Million Dollars ($5,000,000) at any time.

          (i) New subsections (l) and (m) are added to Section 7.01 ("Limitation
on Liens") as follows:

                    (l) the interest of a lessor under a capital lease permitted
               under Section 7.09.

                    (m) Liens on real property securing Indebtedness permitted
               by Subsection 7.05(g) below (distribution center financing).

          (j) Subsection (c) of Section 7.02 ("Disposition of Assets") is
amended to read as follows:

                    (c) dispositions of assets and relinquishment of rights in
               connection with store closings in accordance with the business
               plans of the Company and its Subsidiaries, so long as the
               aggregate book value of all such assets disposed and rights
               relinquished after the date of this Agreement does not exceed
               Eight Million Dollars ($8,000,000) per fiscal year (net of any
               insurance proceeds).

          (k) Subsections (d) and (e) of Section 7.05 ("Limitation on
Indebtedness") are amended to read as follows:

                    (d) Indebtedness to BofA (or another replacement lender) in
               connection with commercial and standby letters of credit issued
               for the account 




                                       3
<PAGE>   4

               of the Company in a principal amount not to exceed Seventy-Five
               Million Dollars ($75,000,000) outstanding at any one time;

                    (e) Indebtedness incurred in connection with leases
               permitted pursuant to Subsections 7.09(a) through (d);

          (l) New subsections (g) and (h) are added to Section 7.05 ("Limitation
on Indebtedness") as follows:

                    (g) Additional Indebtedness (including capital leases)
               incurred to finance the Company's new distribution center;
               provided, however, that the terms of the Indebtedness, in the
               reasonable opinion of Majority Banks, are not more restrictive on
               the Company than the terms of this Agreement (except that the
               Indebtedness may include terms relating to Permitted Liens
               securing the Indebtedness); and provided further that, for any
               Indebtedness covered by this subparagraph (g) in an amount in
               excess of Fifty Million Dollars ($50,000,000) in the aggregate,
               the average life of such excess Indebtedness must not be less
               than seven years.

                    (h) Additional Indebtedness not exceeding Five Million
               Dollars ($5,000,000) in principal amount outstanding at any one
               time.

          (m) Subsections (c) and (d) of Section 7.09 ("Lease Obligations") are
amended to read as follows, and a new subsection (e) is added:

                    (c) leases entered into by the Company or any Subsidiary
               after the Closing Date pursuant to sale-leaseback transactions in
               an aggregate amount not to exceed Seven Million Five Hundred
               Thousand Dollars ($7,500,000) per fiscal year;

                    (d) capital leases in an aggregate amount not exceeding
               Twelve Million Five Hundred Thousand Dollars ($12,500,000)
               outstanding at any one time.

                    (e) capital leases permitted under Subsection 7.05(g).

          (n) Section 7.10(d) of the Agreement, which permitted certain
repurchases and redemptions of stock, is hereby deleted. Due to this deletion,
and the expiration of Tranche B, the "Stock Purchase Trigger Date" defined in
section 7.10(d) will not occur. Consequently, the related increase to the
Applicable Margin and the Leverage covenant in Section 6.04 will not apply.

     3. Representations and Warranties. The Company hereby represents and
warrants to the Agent and the Banks as follows:

          (a) No Default or Event of Default has occurred and is continuing.

          (b) The execution, delivery and performance by the Company of this
Amendment have been duly authorized by all necessary corporate and other action
and do not and will not require any registration with, consent or approval of,
notice to or action by, any Person (including any Governmental Authority) in
order to be effective and enforceable. The Credit Agreement as amended by this
Amendment constitutes the legal, valid and binding 



                                       4
<PAGE>   5

obligations of the Company, enforceable against it in accordance with its
respective terms, without defense, counterclaim or offset. 

          (c) All representations and warranties of the Company contained in the
Credit Agreement are true and correct.

          (d) The Company is entering into this Amendment on the basis of its
own investigation and for its own reasons, without reliance upon the Agent and
the Banks or any other Person.

     4. Effective Date. This Amendment will become effective as of June 30, 1998
(the "Effective Date"), provided that each of the following conditions precedent
is satisfied:

          (a) The Agent has received from the Company and each of the Banks a
duly executed original (or, if elected by the Agent, an executed facsimile copy)
of this Amendment, together with a duly executed Guarantor Acknowledgment and
Consent in the form attached hereto (the "Consent").

          (b) The Agent has received from the Company and each Guarantor a copy
of a resolution passed by each corporation's board of directors, certified by
the Secretary or an Assistant Secretary of such corporation as being in full
force and effect on the date hereof, authorizing the execution, delivery and
performance of this Amendment or the Consent, as applicable. 

     5. Reservation of Rights. The Company acknowledges and agrees that the
execution and delivery by the Agent and the Banks of this Amendment shall not be
deemed to create a course of dealing or otherwise obligate the Agent or the
Banks to forbear or execute similar amendments under the same or similar
circumstances in the future.

     6. Bank Merger. The parties acknowledge that BankAmerica Corporation and
NationsBank Corporation have announced an agreement to merge. In the event that
the merger is consummated, the parties agree to negotiate in good faith to add
an additional Bank to the syndicate. 

     7. Miscellaneous.

          (a) Except as herein expressly amended, all terms, covenants and
provisions of the Credit Agreement are and shall remain in full force and effect
and all references therein to such Credit Agreement shall henceforth refer to
the Credit Agreement as amended by this Amendment. This Amendment shall be
deemed incorporated into, and a part of, the Credit Agreement.

          (b) This Amendment shall be binding upon and inure to the benefit of
the parties hereto and thereto and their respective successors and assigns. No
third party beneficiaries are intended in connection with this Amendment.

          (c) This Amendment shall be governed by and construed in accordance
with the law of the State of California.

          (d) This Amendment may be executed in any number of counterparts, each
of which shall be deemed an original, but all such counterparts together shall
constitute but one and the same instrument. Each of the parties hereto
understands and agrees that this document (and any other document required
herein) may be delivered by any party thereto 



                                       5
<PAGE>   6

either in the form of an executed original or an executed original sent by
facsimile transmission to be followed promptly by mailing of a hard copy
original, and that receipt by the Agent of a facsimile transmitted document
purportedly bearing the signature of a Bank or the Company shall bind such Bank
or the Company, respectively, with the same force and effect as the delivery of
a hard copy original. Any failure by the Agent to receive the hard copy executed
original of such document shall not diminish the binding effect of receipt of
the facsimile transmitted executed original of such document of the party whose
hard copy page was not received by the Agent.

          (e) This Amendment, together with the Credit Agreement, contains the
entire and exclusive agreement of the parties hereto with reference to the
matters discussed herein and therein. This Amendment supersedes all prior drafts
and communications with respect thereto. This Amendment may not be amended
except in accordance with the provisions of Section 10.01 of the Credit
Agreement.

          (f) If any term or provision of this Amendment shall be deemed
prohibited by or invalid under any applicable law, such provision shall be
invalidated without affecting the remaining provisions of this Amendment or the
Credit Agreement, respectively.



                                       6
<PAGE>   7

          (g) The Company covenants to pay to or reimburse the Agent, upon
demand, for all costs and expenses (including allocated costs of in-house
counsel) incurred in connection with the development, preparation, negotiation,
execution and delivery of this Amendment.

          IN WITNESS WHEREOF, the parties hereto have executed and delivered
this Amendment as of the date first above written.

     BANK OF AMERICA NATIONAL TRUST 
     AND SAVINGS ASSOCIATION, as Agent
                                            WILLIAMS-SONOMA, INC.
     By /s/ Patrick W. Zetzman
       ---------------------------
       Patrick W. Zetzman
       Vice President                       By /s/ W. Howard Lester
                                              ----------------------------------
                                              W. Howard Lester
                                              Chief Executive Officer
     BANK OF AMERICA NATIONAL TRUST 
     AND SAVINGS ASSOCIATION, as a Bank
                                            NATIONSBANK, N. A.,
     By /s/ Hagop V. Bouldoukian            as successor by merger to Nations
       ---------------------------          Bank of Texas, N.A.
       Hagop V. Bouldoukian
       Vice President                       By /s/ Michael Shea
                                              ----------------------------------
                                              Michael Shea
                                              Senior Vice President



                                       7
<PAGE>   8

                      GUARANTOR ACKNOWLEDGMENT AND CONSENT



     The undersigned, each a guarantor with respect to the Company's obligations
to the Agent and the Banks under the Credit Agreement, each hereby (i)
acknowledge and consent to the execution, delivery and performance by Company of
the foregoing Second Amendment to Credit Agreement (the "Amendment"), and (ii)
reaffirm and agree that the respective guaranty to which the undersigned is
party and all other documents and agreements executed and delivered by the
undersigned to the Agent and the Banks in connection with the Credit Agreement
are in full force and effect, without defense, offset or counterclaim.
(Capitalized terms used herein have the meanings specified in the Amendment.)

          Dated as of June 30, 1998         WILLIAMS-SONOMA STORES, INC.

                                            By /s/ Jerry S. B. Dratler
                                              ----------------------------------
                                              Jerry S. B. Dratler
                                              Assistant Secretary

                                            HOLD EVERYTHING, INC.

                                            By /s/ Jerry S. B. Dratler
                                              ----------------------------------
                                              Jerry S. B. Dratler
                                              Assistant Secretary


                                            CHAMBERS CATALOG
                                            COMPANY, INC.

                                            By /s/ Jerry S. B. Dratler
                                              ----------------------------------
                                              Jerry S. B. Dratler
                                              Assistant Secretary

                                              GARDENER'S EDEN, INC.

                                            By /s/ Jerry S. B. Dratler
                                              ----------------------------------
                                              Jerry S. B. Dratler
                                              Assistant Secretary

                                            POTTERY BARN EAST, INC.

                                            By /s/ Jerry S. B. Dratler
                                              ----------------------------------
                                              Jerry S. B. Dratler
                                              Assistant Secretary



                                       8
