While this isn't a strong rule, it is generally recommended to keep a normal work routine, particularly if you take the occasional part-time job outside your home. It doesn't have to be formal work wear, but at least putting on a pair of pants will allow you to feel more professional. It may also allow you to help manage your time--professional wear means it times to work, pajamas means its time to relax.
I break this one only because people's definition of pajamas can
vary. Do I wear soft cotton pants with cute little characters on them
while I work? Rarely. Do I still maintain a high amount of comfort
with yoga pants? Absolutely. While I think it is fine to wear my yoga
pants in public, some consider these pants more on the lounging
around the house side rather than daily work attire. Also, I do find myself beginning work while enjoying a cup of coffee in my PJs--but only before 8am.
It's your choice on what to wear while you work. Just make sure whatever you wear is both comfortable and makes you feel productive.