My experience is that unless it actually writes it down somewhere, it's almost definitely going to forget within the next time or two that the context gets compacted. Even if it does write a rule down, it still may or may not actually follow the rule because it just becomes one additional piece of context to weigh alongside everything else.
To be clear, none of this is specific to Claude as much as just a property of how these tools work. Certain models might be better or worse at making the right calls here, but the fundamental constraint of context limiting how much knowledge can be retained and a "rule" in context, whether written down in advance or manually remembered for the time being, is not a guarantee it will be followed.