Not if they’re command-detonated.
Then they are ineffective. If they aren’t detonated, then the illegals simply run through as though they weren’t there. If they are detonated, then the next wave of illegals runs through the cleared path. This is why a wall is better. Even row after row of razor wire would be more effective than claymores. All you need is to be able to slow them down long enough for a reaction force to get there and take them under aimed fire.