Increasing sample size to obtain width of CI / SE: p-hacking? I'm involved in running experiments, where we want to obtain sufficient sample size to obtain a certain width of CI (or equivalently a certain power).
We currently run a pilot, of a few hundred units, calculate the variance (we ignore the size of the effect) and then estimate the sample that would be required to obtain a CI width that we desire.
The sample is an estimate, so sometimes (~half) the CI ends up being smaller than we expect, and sometimes larger. When it's larger, the customer is unhappy.
One approach that's been suggested is to keep sampling until the CI width is sufficiently small. This feels uncomfortably close to p-hacking to me, but we're not calculating p-values, and we're (still) not looking at the size of the effect.
Is this legitimate?

Sampling until a nominated confidence interval width is obtained is technically similar to sequential testing and might be thought by some to be similar to p-hacking, but that does not mean that you not do it!
If your concern is accurate estimation of the population variance then a 'stop when CI is less than' strategy is going to give you low estimates more often than not, because the sampling is more likely to stop after an observation that lowers the sample standard deviation than after an observation that increases it. However, that bias may be quite small and thus might well be of no practical concern. It will depend on the sample size and thus the nominated CI width. It will be less with a large sample because the large sample will have a relatively stable CI estimate prior to stopping whereas a small sample CI will fluctuate much more with each new observation.
If your concern is to accurately estimate the population mean then I don't think there is any issue because your stopping rule is not dependent on the sample mean.
P-hacking is not an all or none phenomenon and procedures that might sometimes be illegitimate may in other circumstances be good practice! It depends on inferential objectives as well as experimental design considerations. See section 3 here: https://link.springer.com/chapter/10.1007/164_2019_286
