Use $cid in the name of each window, for example at the end of the name (/window @name. $+ $cid).

on *:close:status window:close -@ @name. $+ $cid


when no one watching us
we are invisible