The current sensor should be connected after the EMI filter. i.e. between the Inverter and the utility mains.
The presence of voltage across the grid is sensed using a PT/or a resistive divider and not by the CT.
The grid acts as a very low impedance load when you intend to pump current into it, hence it is important that you sense the pumped current so that you do not exceed your system's rated specifications.
When the grid voltage is available, the inverter is synchronized with the voltage waveform of the grid, current starts getting pumped, and this current is monitored via the CT and fed to your inverter's control loop.