Many of the costs paid at closing are not immediately deductible.
The exception is points you pay to purchase your home loan. They are deductible for that year. Points paid when you refinance an existing mortgage must be deducted over the life of the new loan.
Some fees—including loan application, appraisal, document preparation and recording fees—that are assessed when purchasing a home can be recouped by adding them to the adjusted cost basis, the starting point for figuring a gain or less when selling the home. Significant home improvements also can be calculated into your cost basis.