730 ILCS 5/3-6-4
2021 Illinois Compiled Statutes|Chapter 730 - CORRECTIONS|730 ILCS 5/ - Unified Code of Corrections.|Chapter V - Sentencing

     for escape or attempted escape shall be served  consecutive to the terms under which the offender is held by the Department of Corrections.(8) If a person charged with a felony commits a     separate felony while on pretrial  release or in pretrial detention in a county jail facility or county detention facility, then the sentences imposed upon conviction of these felonies shall be served consecutively regardless of the order in which the judgments of conviction are entered.(8.5)  If a person commits a battery against a county     correctional officer or sheriff's employee while serving a sentence or in pretrial detention in a county jail facility, then the sentence imposed upon conviction of the battery shall be served consecutively with the sentence imposed upon conviction of the earlier misdemeanor or felony, regardless of the order in which the judgments of conviction are entered.(9) If a person admitted to bail following conviction     of a felony commits a  separate felony while free on bond or if a person detained in a county jail facility or county detention facility following conviction of a felony commits a separate felony while in detention, then any sentence following conviction of the separate felony shall be consecutive to that of the original sentence for which the defendant was on bond or detained.(10) If a person is found to be in possession of an     item of contraband, as defined in Section 31A-0.1 of the Criminal Code of 2012,  while serving a sentence in a county jail or while in pre-trial detention in a county jail, the sentence imposed upon conviction for the offense of possessing contraband in a penal institution shall be served consecutively to the sentence imposed for the offense in which the person is serving sentence in the county jail or serving pretrial detention, regardless of the order in which the judgments of conviction are entered.(11)  If a person is sentenced for a violation of     bail bond under Section 32-10 of the Criminal Code of 1961 or the Criminal Code of 2012, any sentence imposed for that violation shall be served consecutive to the sentence imposed for the charge for which bail had been granted and with respect to which the defendant has been convicted.(e) Consecutive terms; subsequent non-Illinois term.  If an Illinois court has imposed a    sentence of imprisonment on a defendant and the defendant is subsequently sentenced to a term of imprisonment by a court of another state or a federal court, then the Illinois sentence shall run consecutively to the sentence imposed by the court of the other state or the federal court. That same Illinois court, however, may order that the Illinois sentence run concurrently with the sentence imposed by the court of the other state or the federal court, but only if the defendant applies to that same Illinois court within 30 days after the sentence imposed by the court of the other state or the federal court is finalized.(f) Consecutive terms; aggregate maximums and minimums. The aggregate maximum    and aggregate minimum of consecutive sentences shall be determined as follows:(1) For sentences imposed under law in effect prior     to February 1, 1978, the  aggregate maximum of consecutive sentences shall not exceed the maximum term authorized under Section 5-8-1