Carpet on hardwood floor, threshold

My inlaws have hardwood floors throughout their house, however in the rooms there is carpet laid directly on top of the hardwood floor with no molding from the carpet in the room to the hardwood floor in the hall. The cats on occasion get shut in a bedroom and they claw the carpet pulling it up from the floor, in some cases making it difficult to open the door. What can I do to cover the edge of the carpet to keep the cats from pulling it up? Thanks