On one of the occasions that I went to confession in recent times, for my penance I was told to pray a Hail Mary if thought X crosses my mind, and to recite the Apostle’s Creed if thought Y crosses my mind.
I have done this since that confession.
My confessor did not specify whether this penance is temporary or not. Therefore, I don’t know whether this is something I’m supposed to do for the rest of my life (i.e. always respond to thoughts X or Y with the prayer or creed).
Not that it isn’t a good idea to (the penance is very helpful). I’m simply inquiring as to whether it is perpetually obligatory.