<PAGE>
                                                                 Exhibit 10.24


                                 NEW FOCUS, INC.
                                 ---------------
                      STOCK EXCHANGE AGREEMENT AND RELEASE
                      ------------------------------------

     This Stock Exchange Agreement and Release (the "Agreement") is made as of
January 10, 2002 (the "Effective Date") between New Focus, Inc., a Delaware
corporation (the "Company") and Peter Hansen (the "Stockholder").

     WHEREAS, the Company granted Stockholder an option (the "Option") to
purchase 81,000 shares of the Company's Common Stock (the "Shares") at a
purchase price of $20.00 per share (the "Original Purchase Price") pursuant to
an option agreement dated May 17, 2000 (the "Option Agreement").

     WHEREAS, Stockholder exercised the Option pursuant to the terms of the
Option Agreement and entered into a Restricted Stock Purchase Agreement dated
May 17, 2000 (the "Purchase Agreement") and paid for the Shares with a
promissory note in the principal amount of $1,620,000 (the "Note").

     WHEREAS, on the Effective Date 54,000 of the Shares are currently unvested
and subject to the Company's right of repurchase as set forth in the Purchase
Agreement (the "Unvested Shares") and 27,000 of the Shares have vested and are
no longer subject to the Company's right of repurchase (the "Vested Shares").

     WHEREAS, Stockholder and the Company each desire that the Company exchange
the Unvested Shares for the cancellation of $1,080,000 of debt evidenced by the
Note (which amount is the number of Unvested Shares times the Original Purchase
Price) (the "Unvested Debt"), and that the Note be amended to reflect that
$540,000 (the number of Vested Shares times the Original Purchase Price) is the
principal amount remaining under the Note (the "Vested Debt").

     WHEREAS, the Company has no obligation to exchange the Unvested Shares for
the cancellation of the Unvested Debt, which is currently above the fair market
value of the Unvested Shares, and in consideration for such exchange, the
Company and Stockholder each desire that Stockholder execute a full release of
any and all claims against the Company, including, but not limited to, any and
all claims arising out the Company's exchange of the Unvested Shares for the
cancellation of the Unvested Debt.

     NOW, THEREFORE, the parties hereto agree as follows:

     1. Exchange and Transfer of Unvested Shares.
        ----------------------------------------

          (a) Stockholder hereby transfers the Unvested Shares to the Company,
and in exchange therefore, the Company hereby cancels the Unvested Debt.


<PAGE>

          (b) The Company shall direct its transfer agent to record the transfer
of the Unvested Shares from Stockholder to the Company and issue to Stockholder
the Vested Shares subject to the applicable restrictive legends.

     2. Amendment of Note. The Company shall amend the Note in accordance
        -----------------
herewith to provide that the principal amount of the Note is the Vested Debt.
All other terms and conditions of the Note shall remain in full force and
effect.

     3. Tax Consequences, Withholding and Representation.
        ------------------------------------------------

          (a) Stockholder understands and acknowledges that the cancellation of
the Unvested Debt that is in excess of the fair market value of the Unvested
Shares may be treated as ordinary compensation for his income tax purposes, and
therefore may be subject to applicable income tax withholding. As a precaution
the Company has asked Stockholder to provide Company with funds sufficient to
satisfy any such withholding obligation in connection with the Company's
cancellation of the Unvested Debt, and Stockholder shall do so within ten
business days after the Effective Date.

          (b) Stockholder has reviewed with Stockholder's own tax advisors the
federal, state, and local tax consequences of this exchange and the transactions
contemplated by this Agreement. Stockholder is relying solely on such advisors
and not on any statements or representations of the Company or any of its
agents. Stockholder understands that Stockholder (and not the Company) shall be
responsible for Stockholder's own tax liability that may arise as a result of
this exchange or the transactions contemplated by this Agreement.

          (c) Stockholder believes he has received all the information he
considers necessary or appropriate for deciding whether to effect the exchange
of the Unvested Shares pursuant to this Agreement. Stockholder represents that
he has had an opportunity to ask questions and receive answers from the Company
regarding the terms and conditions of the exchange of the Unvested Shares and
the cancellation of the Unvested Debt and acknowledges that information
regarding the Company's business, properties, prospects and financial condition
is publicly available or has been made available to him.

     4. Entire Agreement. This Agreement, the Option Agreement and the Purchase
        ----------------
Agreement represent the entire agreement and understanding between the Company
and Stockholder concerning the Shares and supersede and replace any and all
prior offers, agreements and understandings with respect to the Shares whether
written or oral, express or implied. Neither the Company nor Stockholder shall
be liable nor bound to the other in any manner by any representations,
warranties, or covenants except as specifically set forth herein.

     5. Stockholder Release. In consideration for the Company's exchange of the
        -------------------
Unvested Shares for the cancellation of the Unvested Debt, Stockholder, on
behalf of himself, his heirs, family members, executors, and agents, hereby
fully and forever releases the Company and its respective officers, directors,
employees, investors, stockholders, administrators, affiliates, divisions,
subsidiaries and successors and assigns from, and agrees not to sue concerning
any claim, duty, obligation or cause of action relating to any matter of any
kind, whether presently known or


                                      -2-

<PAGE>

unknown, suspected or unsuspected, that he may possess arising from any
omissions, acts, or facts that have occurred up until and including the
Effective Date of this Agreement, including, without limitation:

     (a) any and all claims relating to or arising from the exchange of
     Stockholder's Unvested Shares for the cancellation of the Unvested Debt as
     set forth in this Agreement;

     (b) any and all claims related to the Shares and any and all offers,
     agreements, acts or omissions with respect to the Shares whether written or
     oral, express or implied;

     (c) any and all claims arising from Stockholder's right to purchase or
     actual purchase of any shares of stock of the Company, including without
     limitation any claims for fraud, misrepresentation, breach of fiduciary
     duty, breach of duty under applicable state corporate law and securities
     fraud under any state or federal law;

     (d) any claim for any loss, cost, damage or expense arising out of any
     dispute over Stockholder's tax consequences as a result of the exchange of
     the Unvested Shares for the cancellation of the Unvested Debt;

     (e) any and all claims for wrongful discharge of employment; constructive
     discharge from employment; breach of contract, both express and implied;
     breach of a covenant of good faith and fair dealing, both express and
     implied; promissory estoppel; fraud; fraudulent inducement; negligent or
     intentional misrepresentation; negligent or intentional interference with
     contract or prospective economic advantage; and unfair business practices;
     and

     (f) any and all claims for attorneys' fees and costs.

     Stockholder acknowledges and agrees that any breach of this paragraph shall
constitute a material breach of the Agreement, and shall entitle the Company to
recover the amount of the Unvested Debt canceled pursuant to Section 1 above.
Stockholder shall also be responsible to the Company for all costs, attorneys'
fees and any and all damages incurred by the Company in: (i) enforcing
Stockholder's obligations under this paragraph, including the bringing of any
action to recover the amount of the Unvested Debt, and (ii) defending against a
claim brought or pursued by Stockholder in violation of this Agreement.

     The Company and Stockholder agree that the release set forth in this
section shall be and remain in effect in all respects as a complete general
release as to the matters released. This release does not extend to any
obligations incurred under this Agreement.

     6. Civil Code Section 1542. Stockholder represents that he is not aware of
        -----------------------
any claim other than the claims that are released by this Agreement. Stockholder
acknowledges that he has been advised by legal counsel and is familiar with the
provisions of California Civil Code Section 1542, which provides as follows:


                                      -3-

<PAGE>

          A GENERAL RELEASE DOES NOT EXTEND TO CLAIMS
          WHICH THE CREDITOR DOES NOT KNOW OR
          SUSPECT TO EXIST IN HIS FAVOR AT THE TIME OF
          EXECUTING THE RELEASE, WHICH IF KNOWN BY HIM
          MUST HAVE MATERIALLY AFFECTED HIS
          SETTLEMENT WITH THE DEBTOR.

     Stockholder being aware of said code section, agrees to expressly waive any
rights he may have thereunder, as well as under any other statute or common law
principles of similar effect.

     7. Arbitration. The parties agree that any and all disputes arising out of
        -----------
the terms of this Agreement, their interpretation, and any of the matters herein
released, shall be subject to binding arbitration in Santa Clara County before
the American Arbitration Association under its National Rules for the Resolution
of Employment Disputes or the California Code of Civil Procedure. Prior to
initiating arbitration, the parties shall agree to mediate any dispute. The
parties agree that the prevailing party in any arbitration shall be entitled to
injunctive relief in any court of competent jurisdiction to enforce the
arbitration award. The parties agree that the prevailing party in any
arbitration shall be awarded its reasonable attorneys' fees and costs. The
parties hereby agree to waive their right to have any dispute between them
resolved in a court of law by a judge or jury. This section will not prevent
either party from seeking injunctive relief (or any other provisional remedy)
from any court having jurisdiction over the parties and the subject matter of
their dispute relating to Stockholder's obligations under this Agreement.

     8. No Admission of Liability. Stockholder understands and acknowledges that
        -------------------------
this Agreement constitutes a compromise and settlement of any and all potential
disputed claims. No action taken by the Company hereto, either previously or in
connection with this Agreement, shall be deemed or construed to be: (a) an
admission of the truth or falsity of any potential claims; or (b) an
acknowledgment or admission by the Company of any fault or liability whatsoever
to Stockholder or to any third party.

     9. No Cooperation. Stockholder agrees that he will not act in any manner
        --------------
that might damage the business of the Company. Stockholder agrees he will not
encourage, advise, or assist any agency, attorneys or their clients in the
presentation or prosecution of any disputes, differences, lawsuits, grievances,
claims, charges, or complaints against the Company, unless under a subpoena or
other court order to do so. Stockholder agrees both to immediately notify the
Company in writing upon receipt of any such subpoena or court order, and to
furnish, within three (3) business days of its receipt, a copy of such subpoena
or court order to the Company. If approached by anyone for counsel or assistance
in the presentation or prosecution of any disputes, differences, grievances,
claims, charges, or complaints against the Company, Stockholder shall state no
more than that he cannot provide counsel or assistance. The parties agree that
Stockholder's initiation and/or prosecution of any claims or disputes against
the Company that are not otherwise prohibited by this Agreement shall not
constitute a violation of this paragraph.

     10. Severability. In the event that any provision hereof becomes or is
         ------------
declared by a court of competent jurisdiction to be illegal, unenforceable or
void, this Agreement shall continue in full force and effect without said
provision.


                                       -4-

<PAGE>

     11. No Oral Modification. This Agreement may only be amended in writing
         --------------------
signed by the parties hereto.

     12. Governing Law. This Agreement shall be construed, interpreted governed
         -------------
and enforced in accordance with the laws of the State of California, without
regard to the choice of law principles.

     13. Counterparts. This Agreement may be executed in counterparts, and each
         ------------
counterpart shall have the same force and effect as an original and shall
constitute an effective, binding agreement on the part of each of the
undersigned.

     14. Assignment. This Agreement and all rights under this Agreement shall be
         ----------
binding upon, inure to the benefit of and be enforceable by the parties hereto
and their respective personal or legal representatives, executors,
administrators, heirs, distributees, devisees, legatees, successors and assigns.
This Agreement is personal in nature, and neither of the parties to this
Agreement shall, without the written consent of the other, assign or transfer
this Agreement or any right or obligation under this Agreement to any other
person or entity.

     15. Voluntary Execution of Agreement. This Agreement is executed
         --------------------------------
voluntarily and without any duress or undue influence on the part or behalf of
the parties hereto, with the full intent of releasing all claims. The parties
acknowledge that:

          (a) They have read this Agreement;

          (b) They have been represented in the preparation, negotiation, and
execution of this Agreement by legal counsel of their own choice or that they
have voluntarily declined to seek such counsel;

          (c) They understand the terms and consequences of this Agreement and
of the releases it contains; and

          (d) They are fully aware of the legal and binding effect of this
Agreement.

     IN WITNESS WHEREOF, each of the parties hereto has executed this Agreement
as of the date first written above.


STOCKHOLDER                                  NEW FOCUS, INC.

/s/ Peter Hansen                             /s/ William L. Potts, Jr.
-----------------------------------          -----------------------------------
Peter Hansen                                 William L. Potts, Jr.
                                             Chief Financial Officer


                                       -5-

<PAGE>

                                CONSENT OF SPOUSE
                                -----------------

     The undersigned spouse of Peter Hansen has read and hereby approves the
foregoing Stock Exchange Agreement and Release. In consideration of the
Company's promises contained in the Agreement, the undersigned hereby agrees to
be irrevocably bound by the Agreement and further agrees that any community
property interest shall be similarly bound by the Agreement. I hereby appoint my
spouse as my attorney-in-fact with respect to any amendment or exercise of any
rights under the Agreement.

                                       Signature:  /s/ Susan N. Hansen
                                                 -------------------------------

                                       Name:  /s/ Susan N. Hansen
                                            ------------------------------------
                                       (Please Print)


                                       -6-