Another alternative is to treat the 25m as a minimum time in Pomodoro: if you are tired or have reached a natural break point for your task then stop. If you're in the flow continue.
You may want to enforce a maximum amount of time for health reasons (e.g. to get up from your chain every now and then).
This. The pomodoro technique has helped me greatly, but the time limit is really just about motivation to get started (in my case). It helps by allowing me to tell myself: "You can do this... you can do anything for 35 minutes (the time limit I prefer)."
However, it is very often the case that once the timer expires, I just turn off the alarm and remain focused on my work. Sometimes my session lasts up to an hour or more. And of course, at other times, I finish the task I wanted to work on before the timer expires because the level of focus/flow I was able to achieve enabled me to finish the task more quickly than I thought.
My story is just one, of course, but I highly recommend at least trying the pomodoro method or some variation of it, just to see if you have similar success.
1. If I'm struggling to start, telling myself I only need to spend 25 minutes on it gets me started
2. I can pretty easily hold myself back from checking slack/email or context-switching when the block is 25 minutes - I can always peek at messages after to make sure nothing important happened.
3. It gives me a target - frequently there is something concrete I think I can _complete_ in 25 minutes, and that gives me motivation to push to get it done by then. If it goes a little over, that's fine
4. Because these periods of 25 minutes are really intense, I can't do them back-to-back all day. I have found switching to an interesting YouTube video for 5 minutes during a break (and trying to completely rest the brain during this time) re-energizes me more quickly, and lets me do more pomodoros without needing to stop for a while