During some kind of repetitive task which doesn't involve thinking, I lost my concentration and forgot what I was doing. When I told someone about this I said 途中でぼけてしまった but I wonder if that is the best way to describe such an occurrence. 途中で集中しなくなった sounds quite odd to me somehow. 集中を失った would be a translation of "lose concentration" in English but I'm not sure that is good Japanese. Is 途中で間を抜けた or something like that too strange?
is a valid way to relate the fact that you lost your concentration, but I guess it is rather colloquial.
You could also say
which could mean that something else caught your attention, but I guess this "something" could just be another thought, in which case it would just mean that your attention drifted.
If you want to use 集中, then I think
Finally, 集中を失った seems to exist, but it sounds more like a medical condition and I don't think it quite fits the situation here.
is bit too awkward to describe "losing concentration" since it sounds like you've left the place in the middle of talking. A similar expression :
can be used when your activity was paused while you are staying in the same place.
When you feel losing concentration while doing tasks you are getting used to such as routine chore, I would feel
集中力が途切れてきた : Concentration has started to lose.
気が抜けてきた : Losing motivation.