Why is Terminal.app corrupting my tcsh history?
Are you cutting/pasting commands and picking up some of your prompt by accident? 

It's not quite the answer you're looking for but throw sed -i.bak -e "s/\x1b[[0-9;]{1,5}m//g" .history into your .logout or cron it and you shouldn't have to clean it manually again.