I doubt that it is made for use with CNC as it doesn't appear to have any connection for the probe input.
It isn't a tool height setter (i.e. Z axis) because the button operating axis is at right angles to the longitudinal axis which would go in the chuck.
It wouldn't be a useful edge finder because they need rotational symmetry which this doesn't have at the business end.
The configuration is reminiscent of a telescopic bore gauge, but the end of the cylinder opposite the button seems to be machined flat, which wouldn't allow it to contact the bore at a single point.
What it would do is act as a go/no-go gauge to measure a slot width, that's what I think it is.