My builder gave me closing cost credit but the rate isn't competitive -- can I refinance right after closing?

Yes. Agency loans carry no prepayment penalty, so nothing binds you to an uncompetitive rate. In practice, FHA, VA, USDA, and Fannie Mae or Freddie Mac loans have no prepayment penalty. (Regulation Z does permit a small, capped penalty on certain fixed-rate qualified mortgages, and some non-QM loans carry one, so scan your note. On an agency loan you will not find one.) Why builders and their in-house lenders push back so hard on quick refinances: when a loan pays off very early, the original lender's contract with the investor who bought it usually requires giving back the premium the lender earned on the sale. That early-payoff recapture is a contract term between lender and investor, most commonly 180 days, though it varies by investor, roughly 120 to 210. Their money is at stake, and the clause never restricts you. The smarter move happens before closing. A builder's incentive is usually tied to their preferred lender, whose rate is often set above market to recover the credit. Call around and price the same loan without taking the credit at all, then compare the nets both ways. Sometimes a materially better outside rate wins even after you give up the free closing costs. Sometimes the credit wins. You will only know by pricing both. If you take the uncompetitive rate anyway, refinance once the math clearly works, so the credit stops costing you more over time than it saved up front. We will price the without-the-credit version for you on the free Roadmap conversation.