On 17 February 2018, Kastrati made his debut as a professional footballer in a 1–0 away defeat against Istra 1961 after being named in the starting line-up.[1] On 10 March 2018, he scored his first two goals in a 4–1 away win over Dinamo Zagreb.[2] On 16 September 2018, Kastrati scored the first hat-trick of his career in a 5–2 away win over Slaven Belupo.[3] On 17 February 2020, Kastrati signed a five-year contract with Dinamo Zagreb.[4] He was sent back on loan to Lokomotiva for the remainder of the season.[4] Four days later, he played the first game after the return against Varaždin after being named in the starting line-up.[5]
Dinamo Zagreb
On 5 August 2020, Kastrati returned to Dinamo Zagreb. His debut with Dinamo Zagreb came eleven days later in a 6–0 home win against his former club Lokomotiva after being named in the starting line-up.[6] Five days after debut, Kastrati was sent off in a 0–1 away win against Istra 1961 after a rough tackle on Obeng Regan.[7] On 26 August, he scored his first goal for Dinamo Zagreb in his third appearance for the club in a 2–2 away draw over CFR Cluj in Champions League qualifying, which Dinamo Zagreb won 6–5 after penalty shootout and progressed to the third qualifying round.[8]
On 12 September, Kastrati scored his first league goal in the Eternal derby as Dinamo Zagreb defeated Hajduk Split 2–1 at Stadion Poljud.[9] On 22 October, he made his debut in a UEFA competition in the Europa League against Feyenoord after being named in the starting line-up.[10][11] On 10 December, he scored his first European goal for Dinamo Zagreb in a 3–1 home win over CSKA Moscow.[12]
During the second half of the season, Kastrati's inefficiency forced coach Zoran Mamić and his successor Damir Krznar to drop him from the starting XI. On 25 April 2021, Krznar unexpectedly named Kastrati in the starting XI for another Eternal derby, this time at Stadion Maksimir, which ended as a 2–0 victory with Kastrati scoring the second goal. After the game, Kastrati and Hajduk's coach Paolo Tramezzani were a subject of controversy after Kastrati was seen giving Tramezzani his shirt.[13]
Legia Warsaw
On 1 September 2021, Kastrati joined Ekstraklasa side Legia Warsaw.[14] In same day later, the club confirmed that he had joined on a four-year contract and received squad number 7.[15] His debut with Legia Warsaw came ten days later in a 1–0 away defeat against Śląsk Wrocław after coming on as a substitute at 46th minute in place of Kacper Skibicki.[16] On 15 September 2021, he scored his first goal for Legia Warsaw in his second appearance for the club in a 1–0 away win over Spartak Moscow in UEFA Europa League.[17]
Fehérvár
On 29 August 2022, Kastrati signed a three-year contract with Nemzeti Bajnokság I club Fehérvár and received squad number 10.[18] His debut with Fehérvár came two days later in a 2–1 home win against Kecskemét after coming on as a substitute at 66th minute in place of Funsho Bamgboye.[19]
^ ab"Lirim Kastrati novi igrač GNK Dinamo" [Lirim Kastrati, new GNK Dinamo player] (in Croatian). GNK Dinamo Zagreb. 17 February 2020. GNK Dinamo je danas dogovorio sve detalje oko prelaska Lirima Kastratija u Maksimir. Krilni igrač i seniorski reprezentativac Kosova ostat će do ljeta na posudbi u Lokomotivi a nakon toga priključit će se prvoj momčadi GNK Dinamo. Otkako sam došao u Hrvatsku, nadao sam se da ću jednog dana završiti u Dinamu. Sada mi se želja ispunila. Želim se zahvaliti svima koji su sudjelovali u ovome i koji su mi omogućili da budem član najveće nogometne institucije na ovim prostorima – rekao je kratko Kastrati po potpisu petogodišnjeg ugovora za naš klub
^"Varaždin – Lokomotiva 0:2" (in Croatian). NK Lokomotiva. 21 February 2020. Početna postava: Grbić, Marković, Kolinger, Kovačić, Karačić, Jakić, Cokaj, Uzuni (Petrak), Tolić (68' Budimir), Kastrati, Tuci (62' Atiemwen)
^"Razigrani Dinamo zabio "pola tuceta" na otvaranju sezone" [Playful Dinamo scored "half a dozen" at the opening of the season] (in Croatian). GNK Dinamo Zagreb. 16 August 2020. Dinamo: Livaković – Stojanović, Theophile, Dilaver (56. Milić), Leovac – Burton; Kastrati (63. Ivanušec), Majer, Gojak, Oršić – Gavranović (63. Kulenović)