<PAGE>


                                                                  EXHIBIT 10.40

                      FIRST AMENDMENT TO CREDIT AGREEMENT

     THIS FIRST AMENDMENT TO CREDIT AGREEMENT (the "Amendment"), dated and
effective as of December 31, 1999, is between PEREGRINE SYSTEMS, INC.
("Borrower"), a Delaware corporation, each of the banks or other lending
institutions which is a party hereto (individually, each a "LENDER", and
collectively the "LENDERS") and BANK OF AMERICA, N.A., formerly known as
NationsBank, N.A., as administrative agent for itself and the other Lenders (in
such capacity herein, the "ADMINISTRATIVE AGENT").

                                   RECITALS:

     A. Borrower, Administrative Agent, and the Lenders have entered into
that certain Credit Agreement dated as of July 30, 1999 (as amended,
restated, or modified from time to time, the "AGREEMENT").

     B. Borrower has requested that the Agreement be amended in certain
respects, and Administrative Agent and the Lenders are willing to comply with
such request subject to the terms and provisions of this Amendment.

     NOW, THEREFORE, in consideration of the premises herein contained and other
good and valuable consideration, the receipt and sufficiency of which are hereby
acknowledged, the parties hereto agree as follows:

                                   ARTICLE 1

                                  DEFINITIONS

     Section 1.1 DEFINITIONS. Capitalized terms used in this Amendment, to the
extent not otherwise defined herein, shall have the same meanings as in the
Agreement, as amended hereby.

                                   ARTICLE 2

                                   AMENDMENTS

     Section 2.1 AMENDMENT TO SECTION 10.8. Section 10.8(a) of the Agreement is
hereby amended and restated in its entirety as follows:

                  (a) any of its Receivables, provided that Borrower or any
     other Loan Party may sell up to thirty percent (30%) of its Receivables
     in any Fiscal Quarter; PROVIDED, FURTHER, that Borrower or any other
     Loan Party may sell up to forty percent (40%) of its Receivables in any
     Fiscal Quarter if, on a pro forma basis, the Borrower would have
     satisfied SECTION 11.3 of this Agreement for the prior Fiscal Quarter
     had such Receivables been sold in such prior Fiscal Quarter.


FIRST AMENDMENT TO CREDIT AGREEMENT, Page 1

<PAGE>


                                   ARTICLE 3

                              CONDITIONS PRECEDENT

         Section 3.1 CONDITIONS. The effectiveness of this Amendment is subject
to the satisfaction of the following conditions precedent:

                  (a) The representations and warranties contained herein and in
         all other Loan Documents, as amended hereby, shall be true and correct
         in all material respects as of the date hereof as if made on the date
         hereof, except for such representations and warranties limited by their
         terms to a specific date;

                  (b) No Default or Event of Default shall have occurred and be
         continuing;

                  (c) Borrower and the Lenders shall have delivered to the
         Administrative Agent an executed original copy of this Amendment;

                  (d) All proceedings taken in connection with the transactions
         contemplated by this Amendment and all documentation and other legal
         matters incident thereto shall be satisfactory to the Administrative
         Agent.

                                   ARTICLE 4

                 RATIFICATIONS, REPRESENTATIONS AND WARRANTIES

         Section 4.1 RATIFICATIONS. The terms and provisions set forth in this
Amendment shall modify and supersede all inconsistent terms and provisions set
forth in the Agreement and except as expressly modified and superseded by this
Amendment, the terms and provisions of the Agreement and other Loan Documents
are ratified and confirmed and shall continue in full force and effect.
Borrower, Administrative Agent and the Lenders agree that the Agreement as
amended hereby and the other Loan Documents shall continue to be legal, valid,
binding and enforceable in accordance with their respective terms.

         Section 4.2 REPRESENTATIONS AND WARRANTIES. Borrower hereby
represents and warrants to Administrative Agent and the Lenders that (i) the
execution, delivery and performance of this Amendment and any and all other
Loan Documents executed and/or delivered in connection herewith have been
authorized by all requisite action on the part of Borrower and will not
violate the articles of incorporation or bylaws of Borrower; (ii) the
representations and warranties contained in the Agreement, as amended hereby,
and any other Loan Document, are true and correct on and as of the date
hereof as though made on and as of the date hereof (except to the extent that
such representations and warranties were expressly, in the Agreement, made
only in reference to a specific date); (iii) after giving effect to this
Amendment, no Default or Event of Default has occurred and


FIRST AMENDMENT TO CREDIT AGREEMENT, Page 2


<PAGE>


is continuing; and (iv) Borrower is in full compliance with all covenants and
agreements contained in the Agreement, as amended hereby, and the other Loan
Documents.

                                   ARTICLE 5

                                 MISCELLANEOUS

         Section 5.1 SURVIVAL OF REPRESENTATIONS AND WARRANTIES. All
representations and warranties made in this Amendment or any other Loan Document
including any Loan Document furnished in connection with this Amendment shall
survive the execution and delivery of this Amendment and the other Loan
Documents, and no investigation by Administrative Agent or any Lender shall
affect the representations and warranties or the right of Administrative Agent
or any Lender to rely upon them.

         Section 5.2 REFERENCE TO AGREEMENT. Each of the Loan Documents,
including the Agreement and any and all other agreements, documents, or
instruments now or hereafter executed and delivered pursuant to the terms
hereof or pursuant to the terms of the Agreement as amended hereby, are
hereby amended so that any reference in such Loan Documents to the Agreement
shall mean a reference to the Agreement as amended hereby.

         Section 5.3 EXPENSES OF ADMINISTRATIVE AGENT. As provided in the
Agreement, Borrower agrees to pay on demand all reasonable costs and expenses
incurred by Administrative Agent in connection with the preparation,
negotiation, and execution of this Amendment and the other Loan Documents
executed pursuant hereto.

         Section 5.4 SEVERABILITY. Any provision of this Amendment held by a
court of competent jurisdiction to be invalid or unenforceable shall not impair
or invalidate the remainder of this Amendment and the effect thereof shall be
confined to the provision so held to be invalid or unenforceable.

         Section 5.5 APPLICABLE LAW. THIS AMENDMENT SHALL BE GOVERNED BY AND
CONSTRUED IN ACCORDANCE WITH THE LAWS OF THE STATE OF CALIFORNIA AND THE
APPLICABLE LAWS OF THE UNITED STATES OF AMERICA.

         Section 5.6 SUCCESSORS AND ASSIGNS. This Amendment is binding upon and
shall inure to the benefit of Administrative Agent, the Lenders, and Borrower
and their respective successors and assigns, except Borrower may not assign or
transfer any of its rights or obligations hereunder without the prior written
consent of all the Lenders.

         Section 5.7 COUNTERPARTS. This Amendment may be executed in one or more
counterparts, and on telecopy counterparts each of which when so executed shall
be deemed to be an original, but all of which when taken together shall
constitute one and the same agreement.

         Section 5.8 EFFECT OF WAIVER. No consent or waiver, express or implied,
by Administrative Agent or any Lender to or for any breach of or deviation from
any covenant, condition or duty by


FIRST AMENDMENT TO CREDIT AGREEMENT, Page 3

<PAGE>


Borrower or any Loan Party shall be deemed a consent or waiver to or of any
other breach of the same or any covenant, condition or duty.

         Section 5.9 HEADINGS. The headings, captions, and arrangements used in
this Amendment are for convenience only and shall not affect the interpretation
of this Amendment.

         Section 5.10 ENTIRE AGREEMENT. THIS AMENDMENT AND ALL OTHER
INSTRUMENTS, DOCUMENTS AND AGREEMENTS EXECUTED AND DELIVERED IN CONNECTION WITH
THIS AMENDMENT EMBODY THE FINAL, ENTIRE AGREEMENT AMONG THE PARTIES HERETO AND
SUPERSEDE ANY AND ALL PRIOR COMMITMENTS, AGREEMENTS, REPRESENTATIONS AND
UNDERSTANDINGS, WHETHER WRITTEN OR ORAL, RELATING TO THIS AMENDMENT, AND MAY NOT
BE CONTRADICTED OR VARIED BY EVIDENCE OF PRIOR, CONTEMPORANEOUS OR SUBSEQUENT
ORAL AGREEMENTS OR DISCUSSIONS OF THE PARTIES HERETO. THERE ARE NO ORAL
AGREEMENTS AMONG THE PARTIES HERETO.

                  [remainder of page intentionally left blank]


FIRST AMENDMENT TO CREDIT AGREEMENT, Page 4

<PAGE>


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

BORROWER:                        PEREGRINE SYSTEMS, INC.

                                 By:
                                     -----------------------------------------

                                 Name:
                                      ----------------------------------------

                                 Title:
                                       ---------------------------------------


ADMINISTRATIVE AGENT:            BANK OF AMERICA, N.A.,
                                 as Administrative Agent

                                 By:
                                     -----------------------------------------

                                 Name:
                                      ----------------------------------------

                                 Title:
                                       ---------------------------------------


LENDERS                          BANK OF AMERICA, N.A.,
                                 as Lenders

                                 By:
                                     ------------------------------------------

                                 Name:
                                      -----------------------------------------

                                 Title:
                                       ----------------------------------------


                                 BANKBOSTON, N.A.,

                                 By:
                                     ------------------------------------------

                                 Name:
                                      -----------------------------------------

                                 Title:
                                       ----------------------------------------

FIRST AMENDMENT TO CREDIT AGREEMENT, Page 5
<PAGE>


                                                                  EXHIBIT 10.40

                      FIRST AMENDMENT TO CREDIT AGREEMENT

     THIS FIRST AMENDMENT TO CREDIT AGREEMENT (the "Amendment"), dated and
effective as of December 31, 1999, is between PEREGRINE SYSTEMS, INC.
("Borrower"), a Delaware corporation, each of the banks or other lending
institutions which is a party hereto (individually, each a "LENDER", and
collectively the "LENDERS") and BANK OF AMERICA, N.A., formerly known as
NationsBank, N.A., as administrative agent for itself and the other Lenders (in
such capacity herein, the "ADMINISTRATIVE AGENT").

                                   RECITALS:

     A. Borrower, Administrative Agent, and the Lenders have entered into
that certain Credit Agreement dated as of July 30, 1999 (as amended,
restated, or modified from time to time, the "AGREEMENT").

     B. Borrower has requested that the Agreement be amended in certain
respects, and Administrative Agent and the Lenders are willing to comply with
such request subject to the terms and provisions of this Amendment.

     NOW, THEREFORE, in consideration of the premises herein contained and other
good and valuable consideration, the receipt and sufficiency of which are hereby
acknowledged, the parties hereto agree as follows:

                                   ARTICLE 1

                                  DEFINITIONS

     Section 1.1 DEFINITIONS. Capitalized terms used in this Amendment, to the
extent not otherwise defined herein, shall have the same meanings as in the
Agreement, as amended hereby.

                                   ARTICLE 2

                                   AMENDMENTS

     Section 2.1 AMENDMENT TO SECTION 10.8. Section 10.8(a) of the Agreement is
hereby amended and restated in its entirety as follows:

                  (a) any of its Receivables, provided that Borrower or any
     other Loan Party may sell up to thirty percent (30%) of its Receivables
     in any Fiscal Quarter; PROVIDED, FURTHER, that Borrower or any other
     Loan Party may sell up to forty percent (40%) of its Receivables in any
     Fiscal Quarter if, on a pro forma basis, the Borrower would have
     satisfied SECTION 11.3 of this Agreement for the prior Fiscal Quarter
     had such Receivables been sold in such prior Fiscal Quarter.


FIRST AMENDMENT TO CREDIT AGREEMENT, Page 1

<PAGE>


                                   ARTICLE 3

                              CONDITIONS PRECEDENT

         Section 3.1 CONDITIONS. The effectiveness of this Amendment is subject
to the satisfaction of the following conditions precedent:

                  (a) The representations and warranties contained herein and in
         all other Loan Documents, as amended hereby, shall be true and correct
         in all material respects as of the date hereof as if made on the date
         hereof, except for such representations and warranties limited by their
         terms to a specific date;

                  (b) No Default or Event of Default shall have occurred and be
         continuing;

                  (c) Borrower and the Lenders shall have delivered to the
         Administrative Agent an executed original copy of this Amendment;

                  (d) All proceedings taken in connection with the transactions
         contemplated by this Amendment and all documentation and other legal
         matters incident thereto shall be satisfactory to the Administrative
         Agent.

                                   ARTICLE 4

                 RATIFICATIONS, REPRESENTATIONS AND WARRANTIES

         Section 4.1 RATIFICATIONS. The terms and provisions set forth in this
Amendment shall modify and supersede all inconsistent terms and provisions set
forth in the Agreement and except as expressly modified and superseded by this
Amendment, the terms and provisions of the Agreement and other Loan Documents
are ratified and confirmed and shall continue in full force and effect.
Borrower, Administrative Agent and the Lenders agree that the Agreement as
amended hereby and the other Loan Documents shall continue to be legal, valid,
binding and enforceable in accordance with their respective terms.

         Section 4.2 REPRESENTATIONS AND WARRANTIES. Borrower hereby
represents and warrants to Administrative Agent and the Lenders that (i) the
execution, delivery and performance of this Amendment and any and all other
Loan Documents executed and/or delivered in connection herewith have been
authorized by all requisite action on the part of Borrower and will not
violate the articles of incorporation or bylaws of Borrower; (ii) the
representations and warranties contained in the Agreement, as amended hereby,
and any other Loan Document, are true and correct on and as of the date
hereof as though made on and as of the date hereof (except to the extent that
such representations and warranties were expressly, in the Agreement, made
only in reference to a specific date); (iii) after giving effect to this
Amendment, no Default or Event of Default has occurred and


FIRST AMENDMENT TO CREDIT AGREEMENT, Page 2


<PAGE>


is continuing; and (iv) Borrower is in full compliance with all covenants and
agreements contained in the Agreement, as amended hereby, and the other Loan
Documents.

                                   ARTICLE 5

                                 MISCELLANEOUS

         Section 5.1 SURVIVAL OF REPRESENTATIONS AND WARRANTIES. All
representations and warranties made in this Amendment or any other Loan Document
including any Loan Document furnished in connection with this Amendment shall
survive the execution and delivery of this Amendment and the other Loan
Documents, and no investigation by Administrative Agent or any Lender shall
affect the representations and warranties or the right of Administrative Agent
or any Lender to rely upon them.

         Section 5.2 REFERENCE TO AGREEMENT. Each of the Loan Documents,
including the Agreement and any and all other agreements, documents, or
instruments now or hereafter executed and delivered pursuant to the terms
hereof or pursuant to the terms of the Agreement as amended hereby, are
hereby amended so that any reference in such Loan Documents to the Agreement
shall mean a reference to the Agreement as amended hereby.

         Section 5.3 EXPENSES OF ADMINISTRATIVE AGENT. As provided in the
Agreement, Borrower agrees to pay on demand all reasonable costs and expenses
incurred by Administrative Agent in connection with the preparation,
negotiation, and execution of this Amendment and the other Loan Documents
executed pursuant hereto.

         Section 5.4 SEVERABILITY. Any provision of this Amendment held by a
court of competent jurisdiction to be invalid or unenforceable shall not impair
or invalidate the remainder of this Amendment and the effect thereof shall be
confined to the provision so held to be invalid or unenforceable.

         Section 5.5 APPLICABLE LAW. THIS AMENDMENT SHALL BE GOVERNED BY AND
CONSTRUED IN ACCORDANCE WITH THE LAWS OF THE STATE OF CALIFORNIA AND THE
APPLICABLE LAWS OF THE UNITED STATES OF AMERICA.

         Section 5.6 SUCCESSORS AND ASSIGNS. This Amendment is binding upon and
shall inure to the benefit of Administrative Agent, the Lenders, and Borrower
and their respective successors and assigns, except Borrower may not assign or
transfer any of its rights or obligations hereunder without the prior written
consent of all the Lenders.

         Section 5.7 COUNTERPARTS. This Amendment may be executed in one or more
counterparts, and on telecopy counterparts each of which when so executed shall
be deemed to be an original, but all of which when taken together shall
constitute one and the same agreement.

         Section 5.8 EFFECT OF WAIVER. No consent or waiver, express or implied,
by Administrative Agent or any Lender to or for any breach of or deviation from
any covenant, condition or duty by


FIRST AMENDMENT TO CREDIT AGREEMENT, Page 3

<PAGE>


Borrower or any Loan Party shall be deemed a consent or waiver to or of any
other breach of the same or any covenant, condition or duty.

         Section 5.9 HEADINGS. The headings, captions, and arrangements used in
this Amendment are for convenience only and shall not affect the interpretation
of this Amendment.

         Section 5.10 ENTIRE AGREEMENT. THIS AMENDMENT AND ALL OTHER
INSTRUMENTS, DOCUMENTS AND AGREEMENTS EXECUTED AND DELIVERED IN CONNECTION WITH
THIS AMENDMENT EMBODY THE FINAL, ENTIRE AGREEMENT AMONG THE PARTIES HERETO AND
SUPERSEDE ANY AND ALL PRIOR COMMITMENTS, AGREEMENTS, REPRESENTATIONS AND
UNDERSTANDINGS, WHETHER WRITTEN OR ORAL, RELATING TO THIS AMENDMENT, AND MAY NOT
BE CONTRADICTED OR VARIED BY EVIDENCE OF PRIOR, CONTEMPORANEOUS OR SUBSEQUENT
ORAL AGREEMENTS OR DISCUSSIONS OF THE PARTIES HERETO. THERE ARE NO ORAL
AGREEMENTS AMONG THE PARTIES HERETO.

                  [remainder of page intentionally left blank]


FIRST AMENDMENT TO CREDIT AGREEMENT, Page 4

<PAGE>


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

BORROWER:                        PEREGRINE SYSTEMS, INC.

                                 By:  /s/ MATT GLESS
                                     -----------------------------------------

                                 Name:    Matt Gless
                                      ----------------------------------------

                                 Title:   VP Finance
                                       ---------------------------------------


ADMINISTRATIVE AGENT:            BANK OF AMERICA, N.A.,
                                 as Administrative Agent

                                 By:  /s/ MATTHEW A. GABEL
                                     -----------------------------------------

                                 Name:    Matthew A. Gabel
                                      ----------------------------------------

                                 Title:   Vice President
                                       ---------------------------------------


LENDERS                          BANK OF AMERICA, N.A.,
                                 as Lenders

                                 By:  /s/ Signature
                                     ------------------------------------------

                                 Name:
                                      -----------------------------------------

                                 Title:    Vice President
                                       ----------------------------------------


                                 BANKBOSTON, N.A.,

                                 By:  /s/ JOHN B. DESMOND
                                     ------------------------------------------

                                 Name:    John B. Desmond
                                      -----------------------------------------

                                 Title:   Vice President
                                       ----------------------------------------

FIRST AMENDMENT TO CREDIT AGREEMENT, Page 5