sell at a loss before new year?

Should I, can I sell my stock at a loss before the new year, then claim loss on taxes, then repurchase same stock after the new year at same price? Seems like you can claim loss on taxes and repurchase and own same amount of shares at a lower price so you still have same number of shares. Is this possible or true?