Email from case - subject line change to Case ID
For Emails sent from Manage Case to case roles, there is hook_civicrm_alterMailParams that can be used to alter the subject. Here's some (maybe-not-the-greatest) code I have from an earlier customization. Note that the logic here will remove the hash whether it actually finds the case or not, which was desirable at the time but in those weird scenarios you might prefer it to leave the hash, in which case just move that part down inside the if ($case_id) block.

function myextension_civicrm_alterMailParams( &amp;$params )
{
    if (preg_match('/\[case #([0-9a-h]{7})\]/', $params['subject'], $matches)) {
        $key = CRM_Core_DAO::escapeString(CIVICRM_SITE_KEY);
        $hash = $matches[1];
        $sqlParams = array(1 =&gt; array($hash, 'String'));
        $case_id = null;
        $dao = CRM_Core_DAO::executeQuery("SELECT id FROM civicrm_case WHERE SUBSTR(SHA1(CONCAT('$key', id)), 1, 7) = %1", $sqlParams);
        if ($dao-&gt;fetch()) {
            $case_id = $dao-&gt;id;
        }
        $dao-&gt;free();

        // remove the case # part - can't do it through message templates since hardcoded in Contact/Form/Task/EmailCommon.php. Note also Activity/BAO/Activity.php removes it before saving on the case but that's after it sends it.
        $pos = strpos( $params['subject'] , '] ' );
        if ( $pos !== FALSE ) {
            $params['subject'] = substr( $params['subject'], $pos + 2 );
        }

        // Now add the real case id if found
        if ($case_id) {
            $params['subject'] .= " [case #{$case_id}]";
        }
    }
}