<PAGE>   1
                                                                  EXHIBIT 10.1.7

                               GUARANTY AGREEMENT

     FOR VALUE RECEIVED, as of June 29, 2001, PATTERSON-UTI ENERGY, INC., a
Delaware corporation ("PARENT"), PATTERSON (GP) LLC, a Delaware limited
liability company ("PATTERSON GP"), PATTERSON (LP) LLC, a Delaware limited
liability company ("PATTERSON LP"), PATTERSON PETROLEUM LP, LLLP, a Delaware
limited liability limited partnership ("PPLP"), PATTERSON PETROLEUM TRADING
COMPANY LP, LLLP, a Delaware limited liability limited partnership ("PPTC") and
PATTERSON (GP2) LLC, a Delaware limited liability company ("PATTERSON GP2")
(Parent, Patterson GP, Patterson LP, PPLP, PPTC, and Patterson GP2 are referred
to herein, individually, as a "GUARANTOR" and, collectively and jointly and
severally as, the "GUARANTORS"), guarantee unconditionally the full and prompt
payment to the Lenders ( as defined in the Loan Agreement referred to below) and
THE CIT GROUP/BUSINESS CREDIT, INC., a New York corporation, as Agent for the
benefit of itself and the other Lenders (in such capacity, the "AGENT"), upon
demand, the obligations and indebtedness described below, including, without
limitation, the obligations and indebtedness of UTI DRILLING, L.P., a Texas
limited partnership ("UTI"), UNIVERSAL WELL SERVICES, INC., a Delaware
corporation ("UWSI"), UTI MANAGEMENT SERVICES, L.P., a Texas limited partnership
("UTIMS"), NORTON DRILLING L.P., a Delaware limited partnership, successor in
interest by merger to Norton Drilling Company ("NDLP"), SUITS DRILLING COMPANY,
an Oklahoma corporation ("SDC"), PATTERSON-UTI DRILLING COMPANY LP, LLLP, a
Delaware limited liability limited partnership ("PUDC"), PATTERSON-UTI DRILLING
COMPANY SOUTH LP, LLLP, a Delaware limited liability limited partnership
("PUDCS"), PATTERSON-UTI DRILLING COMPANY WEST LP, LLLP , a Delaware limited
liability limited partnership("PUDCW"), LONE STAR MUD LP, LLLP, a Delaware
limited liability limited partnership, ("LSM"), and AMBAR DRILLING FLUIDS LP,
LLLP, a Delaware limited liability limited partnership ("ADF") (UTI, UWSI,
UTIMS, NDLP, SDC, PUDC, PUDCS, PUDCW, LSM and ADF (together with each additional
Person which may become a "Company" under the Loan Agreement (as defined below)
are referred to herein, collectively, as the "BORROWERS"):

     Any and all indebtedness and obligations, whether direct or indirect,
absolute or contingent, primary or secondary, joint or several, (including the
"Obligations" as defined in the Loan Agreement referred to below) and all
renewals, modifications, increases, rearrangements and extensions thereof for
which the Borrowers are now, or hereafter may become, liable or indebted to the
Agent or the Lenders, and all interest accruing thereon, fees charged in
connection therewith and reimbursable expenses incurred in connection therewith,
whether by lapse of time, acceleration of maturity, or otherwise, now or
hereafter consisting of, arising under or on account of (i) the Loan and
Security Agreement, dated November 22, 1999, among the Borrowers, Agent, certain
Lenders, the Guarantors and the other parties listed therein (as the same may be
renewed, extended or modified from time to time, the "LOAN AGREEMENT"); (ii) any
Loan Document or other document executed in connection with the Loan Agreement
or any renewal, extension, or

                                                                 UTI -  GUARANTY

                                       1
<PAGE>   2

modification of any thereof; and (iii) all costs, reasonable attorneys' fees,
and other expenses incurred by Agent by reason of any event which, with the
giving of notice or the passage of time or both, has occurred and is continuing
and would constitute an Event of Default by the Borrowers under any of the
foregoing (all of the foregoing are hereinafter referred to as the
"OBLIGATIONS").

     To further secure payment of the Obligations, Guarantors grant to Agent, in
addition to all other contractual, legal and equitable rights of Agent, the
right to offset against any account, certificate of deposit, or other funds of
Guarantors in the possession of or under the control of Agent.

     Guarantors hereby waive notice of acceptance of this Guaranty Agreement
(this "GUARANTY") and all other notices in connection herewith or in connection
with the Obligations other than notices set forth in Section 12, Paragraph 6 of
the Loan Agreement, including, without limitation, notice of intent to
accelerate and notice of acceleration, and waives diligence, presentment,
demand, protest, and suit on the part of Agent in the collection of any of the
Obligations, and agrees that Agent shall not be required to first endeavor to
collect any of the Obligations from the Borrowers, or any other party liable for
payment of the Obligations (hereinafter referred to as an "OBLIGATED PARTY"),
before requiring Guarantors to pay the full amount of the Obligations. Without
impairing the rights of Agent against Guarantors, the Borrowers or any other
Obligated Party, suit may be brought and maintained against Guarantors at the
election of Agent with or without joinder of the Borrowers or any other
Obligated Party, any right to any such joinder being hereby waived by
Guarantors.

     Each Guarantor represents to Agent that it is receiving a direct and
indirect benefit as a result of this Guaranty and the Obligations; that each
Guarantor is a direct or indirect subsidiary or affiliate of the Borrowers and
that this Guaranty is necessary and convenient to the conduct, promotion and
attainment of the business of the Guarantors and the Borrowers; represents to
Agent that after giving effect to this Guaranty and the contingent obligations
evidenced hereby it is, and will be, Solvent (as defined in the Loan Agreement);
acknowledges that its liability hereunder shall be cumulative and in addition to
any other liability or obligation to Agent, whether the same is incurred through
the execution of a note, a similar guaranty, through endorsement, or otherwise;
and acknowledges that except as set forth in the Loan Agreement, and the other
Loan Documents, neither Agent nor any officer, employee, agent, attorney or
other representative of Agent has made any representation, warranty or statement
to Guarantors to induce it to execute this Guaranty.

     Each Guarantor hereby agrees that, except as hereinafter provided, its
obligations under this Guaranty shall be continuing, absolute and unconditional,
irrespective of (i) the validity or enforceability of the Obligations or of any
promissory note or other document evidencing all or any part of the Obligations,
(ii) the absence of any attempt to collect the Obligations from the Borrowers or
any other Obligated Party or other action to enforce the same, (iii) the waiver
or consent by Agent or any Lender with respect to any provision of any
instrument evidencing the Obligations, or any part thereof, or any other
agreement now or hereafter executed by the Borrowers and delivered to Agent,
(iv) Agent's election, in any proceeding instituted under

                                                                 UTI -  GUARANTY

                                       2
<PAGE>   3

Chapter 11 of Title 11 of the United States Code (11 U.S.C. Section 101 et seq.)
(the "BANKRUPTCY CODE"), of the application of Section 1111(b)(2) of the
Bankruptcy Code, (v) any borrowing or grant of a security interest by the
Borrowers, as debtor-in-possession, under Section 364 of the Bankruptcy Code,
(vi) the disallowance of all or any portion of Agent's claim(s) for repayment
of the Obligations under Section 502 of the Bankruptcy Code, or (vii) any other
circumstance which might otherwise constitute a legal or equitable discharge or
defense of a guarantor.

     Anything contained in this Guaranty to the contrary notwithstanding, the
obligations of each Guarantor hereunder shall be limited to a maximum aggregate
amount equal to the largest amount that would not render Guarantors' obligations
hereunder subject to avoidance as a fraudulent transfer or conveyance under
Section 548 of the Bankruptcy Code or any applicable provisions of comparable
state law (collectively, the "FRAUDULENT TRANSFER LAWS"), after giving effect to
all other liabilities of Guarantors, contingent or otherwise, that are relevant
under the Fraudulent Transfer Laws and after giving effect as assets to the
value (as determined under the applicable provisions of the Fraudulent Transfer
Laws) of any rights to subrogation or contribution of Guarantors pursuant to (i)
applicable law or (ii) any agreement providing for an equitable allocation among
Guarantors and other affiliates of an Obligated Party (if any) of obligations
under guaranties by such parties.

     No release, waiver, or discharge of the Borrowers or any other Obligated
Party from liability for payment of any of the Obligations, nor any renewal,
supplementation, modification, rearrangement or acceleration of any of the
Obligations, nor any amendment of any document evidencing any of the
Obligations, either express or implied, shall relieve Guarantors from liability
for payment of the full amount of the Obligations; and Guarantors will
immediately pay on the Business Day (as defined in the Loan Agreement) following
demand therefor all Obligations to Agent or other person entitled thereto,
regardless of any defense, right of set-off or counterclaim which the Borrowers
or any other Obligated Party may have or assert, and regardless of whether Agent
or any other party shall have taken any steps to enforce any rights against the
Borrowers, any other Obligated Party, or any other party to collect such sum,
and regardless of any other condition or contingency, including, without
limitation, any neglect, delay or omission of Agent. Agent is hereby authorized,
without notice or demand and without affecting the liability of Guarantors, to,
from time to time accept partial payments on the Obligations.

     Notwithstanding anything to the contrary contained herein, until the
Obligations have been paid in full, Guarantors shall not have any right, claim
or action, now or hereafter, against the Borrowers or any other Obligated Party
arising out of or in connection with this Guaranty or any other document
evidencing the Obligations, including, without limitation, any right or claim of
subrogation, contribution, reimbursement, exoneration or indemnity, all such
rights and claims being hereby expressly and absolutely waived.

     Each Guarantor is familiar with, and has independently reviewed the
financial condition of, the Borrowers and hereby assumes responsibility for
keeping itself informed of the financial condition of the Borrowers, and any and
all endorsers or other guarantors of any instrument or document evidencing all
or any part of the Obligations and of all other circumstances bearing upon the
risk of nonpayment of the Obligations or any part thereof that diligent inquiry
would

                                                                 UTI -  GUARANTY

                                       3
<PAGE>   4

reveal. Each Guarantor hereby agrees that Agent shall have no duty to advise
Guarantors of information known to Agent regarding such condition or any such
circumstances. No Guarantor is relying on the financial condition of the
Borrowers as an inducement to enter into this Guaranty. If Agent, in its sole
discretion, undertakes at any time or from time to time to provide any such
information to Guarantors, Agent shall be under no obligation (i) to undertake
any investigation not a part of its regular business routine, (ii) to disclose
any information which, pursuant to accepted or reasonable commercial finance
practices, Agent wishes to maintain confidential or (iii) to make any other or
future disclosures of such information or any other information to Guarantors.

     Each Guarantor consents and agrees that Agent shall be under no obligation
to marshal any assets in favor of Guarantors or against or in payment of any or
all of the Obligations. Each Guarantor further agrees that, to the extent that
the Borrowers make a payment or payments to Agent, which payment or payments or
any part thereof are subsequently invalidated, declared to be fraudulent or
preferential, set aside and/or required to be repaid to the Borrowers, any of
their estates, trustees, receivers or any other party, including, without
limitation, Guarantors, under any bankruptcy law, state or federal law, common
law or equitable cause, then to the extent of such payment or repayment, the
Obligations or part thereof which has been paid, reduced or satisfied by such
amount shall be reinstated and continued in full force and effect as of the date
such initial payment, reduction or satisfaction occurred.

     Agent may assign its rights hereunder, in whole or in part, to any holder
of the Obligations in accordance with the Loan Agreement and upon any such
assignment all the terms and provisions of this Guaranty shall inure to the
benefit of such assignee, to the extent so assigned.

     Agent is relying and is entitled to rely upon each and all of the
provisions of this Guaranty; and, accordingly, if any provision of this Guaranty
should be held to be invalid or ineffective, then all other provisions shall
continue in full force and effect notwithstanding.

     Any and all notices, requests and demands to or upon Guarantors to be
effective shall be in writing and given in the manner and subject to the terms
set forth in Section 12, Paragraph 6 of the Loan Agreement.

     It is the intention of the Borrowers, Guarantors and Agent to conform
strictly to applicable usury laws. Accordingly, no agreements, conditions,
provisions or stipulations contained in this Guaranty or any other instrument,
document or agreement between Guarantors or the Borrowers and Agent or any
Lender or default of Guarantors or the Borrowers, or the exercise by Agent or
any Lender of the right to accelerate the payment of the maturity of principal
and interest, or to exercise any option whatsoever contained in this Guaranty or
any other agreement between Guarantors or the Borrowers and Agent or any Lender,
or the arising of any contingency whatsoever, shall entitle Agent or any Lender
to collect, in any event, interest exceeding the maximum rate of interest
permitted by applicable state or federal law in effect from time to time
hereafter (the "MAXIMUM LEGAL RATE") and in no event shall Guarantors be
obligated to pay interest exceeding such Maximum Legal Rate and all agreements,
conditions or stipulations, if any, which may in any event or contingency
whatsoever operate to bind, obligate

                                                                 UTI -  GUARANTY

                                       4
<PAGE>   5

or compel Guarantors to pay a rate of interest exceeding the Maximum Legal Rate,
shall be without binding force or effect, at law or in equity, to the extent
only of the excess of interest over such Maximum Legal Rate. In the event any
interest is charged in excess of the Maximum Legal Rate ("EXCESS"), each
Guarantor acknowledges and stipulates that any such charge shall be the result
of an accident and bona fide error, and such Excess shall be, first, applied to
reduce the principal then unpaid hereunder; second, applied to reduce any other
Obligations; and third, returned to Guarantors, it being the intention of the
parties hereto not to enter at any time into a usurious or otherwise illegal
relationship. Each Guarantor recognizes that, with fluctuations in the
applicable rate on the Obligations and the Maximum Legal Rate, such an
unintentional result could inadvertently occur. By the execution of this
Guaranty, each Guarantor covenants that the credit or return of any Excess shall
constitute the acceptance by Guarantors of such Excess.

     If any sum due Agent by Guarantors hereunder is placed in the hands of an
attorney for collection, or is collected through probate, bankruptcy, or other
court proceeding, then Guarantors promise to pay Agent all reasonable costs,
attorneys' fees and other expenses incurred by Agent pursuant to such collection
efforts.

     If the Obligations or any portion thereof are guaranteed by two or more
Guarantors, the obligation of Guarantors shall be several and also joint, each
with all and also each with any one or more of the others, and may be enforced
at the option of Agent against each severally, any two or more jointly, or some
severally and some jointly. Agent, in its sole discretion, may release any one
or more of such guarantors for any consideration which it deems adequate, and
may fail or elect not to prove a claim against the estate of any bankrupt,
insolvent, incompetent or deceased Guarantors; and thereafter without notice to
any other Guarantors, Agent may extend or renew any part or all of the
Obligations and may permit the Borrowers or any other Obligor to incur
additional Obligations or other indebtedness, without affecting in any manner
the unconditional obligation of the remaining Guarantors. Such action by Agent
shall not, however, be deemed to affect any right to contribution which may
exist among the Guarantors.

     The total obligation under this Guaranty shall be UNLIMITED unless
otherwise indicated in this Guaranty, and such obligation shall include in
addition to any limited amount any and all interest thereon, and all costs and
expenses including, without limitation, reasonable attorneys fees incurred in
enforcing any of the duties and obligations of Guarantors under this Guaranty.

     THIS GUARANTY HAS BEEN NEGOTIATED AND SHALL BE DEEMED TO HAVE BEEN MADE IN
THE STATE OF NEW YORK. THIS GUARANTY SHALL BE GOVERNED BY AND CONSTRUED IN
ACCORDANCE WITH THE INTERNAL LAWS OF THE STATE OF NEW YORK (INCLUDING, BUT NOT
LIMITED TO, SECTION 5-1401 OF THE GENERAL OBLIGATIONS LAW OF THE STATE OF NEW
YORK). AS PART OF THE CONSIDERATION FOR NEW VALUE AND BENEFIT THIS DAY RECEIVED
BY GUARANTORS, EACH GUARANTOR HEREBY CONSENTS TO THE JURISDICTION OF ANY STATE
OR FEDERAL COURT LOCATED WITHIN THE STATE OF NEW YORK OR NEW YORK COUNTY AND
WAIVES PERSONAL SERVICE OF ANY AND ALL PROCESS UPON IT AND CONSENTS THAT ALL
SUCH SERVICE OF PROCESS BE MADE BY CERTIFIED

                                                                 UTI -  GUARANTY

                                       5
<PAGE>   6

OR REGISTERED MAIL DIRECTED TO EACH GUARANTOR'S CHIEF EXECUTIVE OFFICE SET FORTH
IN SCHEDULE 7(1) OF THE LOAN AGREEMENT AND SERVICE SO MADE SHALL BE DEEMED TO BE
COMPLETED UPON ACTUAL RECEIPT THEREOF. GUARANTORS WAIVES ANY OBJECTION TO
JURISDICTION AND VENUE OF ANY ACTION INSTITUTED AGAINST IT AS PROVIDED HEREIN
AND AGREES NOT TO ASSERT ANY DEFENSE BASED ON LACK OF JURISDICTION OR VENUE.

     EXCEPT AS OTHERWISE PROVIDED FOR IN THIS GUARANTY, EACH GUARANTOR WAIVES
THE RIGHT TO TRIAL BY JURY (WHICH AGENT AND EACH LENDER HEREBY ALSO WAIVES) IN
ANY ACTION, SUIT, PROCEEDING OR COUNTERCLAIM OF ANY KIND ARISING OUT OF OR
RELATED TO THIS GUARANTY OR THE OBLIGATIONS.

     THIS WRITTEN GUARANTY, TOGETHER WITH ALL OTHER INSTRUMENTS, AGREEMENTS AND
CERTIFICATES EXECUTED BY THE PARTIES IN CONNECTION WITH THE OBLIGATIONS OR WITH
REFERENCE HERETO OR THERETO, REPRESENT THE FINAL AGREEMENT BETWEEN THE PARTIES
AND MAY NOT BE CONTRADICTED BY EVIDENCE OF PRIOR, CONTEMPORANEOUS, OR SUBSEQUENT
ORAL AGREEMENTS OF THE PARTIES. THERE ARE NO UNWRITTEN ORAL AGREEMENTS BETWEEN
THE PARTIES.

                      [THIS SPACE INTENTIONALLY LEFT BLANK]

                                                                 UTI -  GUARANTY

                                       6
<PAGE>   7

     IN WITNESS WHEREOF, this Agreement has been duly executed and delivered as
of the date first written above.

GUARANTORS:

PATTERSON-UTI ENERGY, INC.

By:
    ------------------------------------------------
Name:
      ----------------------------------------------
Title:
       ---------------------------------------------

PATTERSON (LP) LLC

By:
    ------------------------------------------------
Name:
      ----------------------------------------------
Title:
       ---------------------------------------------

PATTERSON (GP) LLC

By:
    ------------------------------------------------
Name:
      ----------------------------------------------
Title:
       ---------------------------------------------

PATTERSON (GP2) LLC

By:
    ------------------------------------------------
Name:
      ----------------------------------------------
Title:
       ---------------------------------------------

PATTERSON PETROLEUM LP, LLLP

By: Patterson (GP) LLC, its general partner

    By:
        --------------------------------------------
    Name:
          ------------------------------------------
    Title:
           -----------------------------------------

PATTERSON PETROLEUM TRADING COMPANY LP, LLLP

By: Patterson (GP) LLC, its general partner

    By:
        --------------------------------------------
    Name:
          ------------------------------------------
    Title:
           -----------------------------------------

                                                                 UTI -  GUARANTY