Is there a way to compare what has changed on an entry while it's being saved?
You're probably looking for Element::getDirtyAttributes() and Element::getDirtyFields()!
The former is for native class properties/attributes (and is based on an ActiveRecord pattern in Yii, I believe...), and the latter is for Craft's &quot;fields,&quot; which may or may not be available, based on what type of Element you're looking at (and what FieldLayout it uses).
You're on the right track! The Element's EVENT_AFTER_SAVE event will fire prior to purging the information with $element-&gt;markAsClean().

Note that the EVENT_AFTER_SAVE event emitted by your element is different than the similarly-named EVENT_AFTER_SAVE_ELEMENT event from the Elements service!