<PAGE>   1

                                                                    EXHIBIT 10.6

                      SECOND AMENDMENT TO CREDIT AGREEMENT

     THIS SECOND AMENDMENT TO CREDIT AGREEMENT (this "Amendment") is entered
into as of October 2, 2000, by and among THE KEITH COMPANIES, INC., a California
corporation, and JOHN M. TETTEMER & ASSOCIATES, LTD., a California corporation
(individually and collectively "Borrower"), and WELLS FARGO BANK, NATIONAL
ASSOCIATION ("Bank").

                                    RECITALS

     WHEREAS, Borrower is currently indebted to Bank pursuant to the terms and
conditions of that certain Credit Agreement between Borrower and Bank dated as
of September 1, 1999, as amended from time to time ("Credit Agreement").

     WHEREAS, Bank and Borrower have agreed to certain changes in the terms and
conditions set forth in the Credit Agreement and have agreed to amend the Credit
Agreement to reflect said changes.

     NOW, THEREFORE, for valuable consideration, the receipt and sufficiency of
which are hereby acknowledged, the parties hereto agree that the Credit
Agreement shall be amended as follows:

     1. ESI Engineering Services, Inc. a California corporation ("ESI ") is a
party to and named as a Borrower under the Credit Agreement. ESI is no longer
separate legal entity, but rather a division of The Keith Companies,
Inc.("Keith"). Accordingly, all references in the Agreement and in the other
Loan Documents to ESI as a Borrower are hereby deleted; and all references in
the Agreement and in the other Loan Documents to Keith as a Borrower, include,
without limitation, ESI, as a division of Keith.

     2. Notwithstanding any provision to the contrary in the Credit Agreement,
proceeds of Working Capital Advances under the Line of Credit in a principal
amount not to exceed $1,500,000.00 may be used to finance the acquisition of
Crosby Mead Benton & Associates in accordance with a Stock Purchase Agreement
dated October 13, 2000, a final executed copy of which has been delivered to
Bank.

     3. Section 5.5 is hereby amended by deleting the word "and" between clauses
(a) and (b), deleting the period at the end and replacing it with a comma, and
adding thereto the following: "and (c) the purchase of stock from Crosby Mead
Benton & Associates in accordance with a Stock Purchase Agreement dated October
13, 2000, a final executed copy of which has been delivered to Bank;".

     4. Except as specifically provided herein, all terms and conditions of the
Credit Agreement remain in full force and effect, without waiver or
modification. All terms defined in the Credit Agreement shall have the same
meaning when used in this Amendment. This Amendment and the Credit Agreement
shall be read together, as one document.

     5. Borrower hereby remakes all representations and warranties contained in
the Credit Agreement and reaffirms all covenants set forth therein. Borrower
further certifies that as of the date of this Amendment there exists no Event of
Default as defined in the Credit Agreement, nor any condition, act or event
which with the giving of notice or the passage of time or both would constitute
any such Event of Default.

                                      -1-

<PAGE>   2

     IN WITNESS WHEREOF, the parties hereto have caused this Amendment to be
executed as of the day and year first written above.

THE KEITH COMPANIES, INC.                 WELLS FARGO BANK, NATIONAL ASSOCIATION

By: /s/ Gary Campanaro                    By: /s/ Stephanie Juneau
   -------------------                       ---------------------
Title: CFO                                Title: Vice President

JOHN M. TETTEMER & ASSOCIATES, LTD.

By: /s/ Gary Campanaro
   -------------------
Title: CFO

                                      -2-