At least in the federal government, we take flagrancy into account when deciding how to resolve violations. I would think that local governments would be of the same mindset. There's that saying that "intent is nine tenths of the law," right? I think that if you tell someone they need a permit and they willfully complete unauthorized work anyway, then criminal intent is so firmly established that the government has no choice but to be highly punitive in terms of penalty fees. Depending on the magnitude of the code violation, and extent to which the safety of others was compromised by the unpermitted work, I'm sure jail time could also be on the table.