Making a "code" is like building a habit. Maintaining the code might be tiring at first, but consistently caring about others, just like consistently brushing your teeth, will inevitably get easier. If you truly are feeling exhausted/insane after treating people well for a day, its unlikely you think people are worth treating well to begin with.
I think most humans are kind by nature, since we're social beings. In a setting like a tribe or a small community, it's relatively easy since we depend and know everyone else. It's when we have to be like that to everyone, including strangers.. that's tough.