Get the ID / class of the part of the form that has been repainted with an AJAX callback?
I don't know if its the best solution but this works: 

  Drupal.ajax.prototype.commands.customSomething = function(form) {

    var formId = '#' + form.form.context.id;

  };