A productivity trick that worked well for me lately: set a 1 hour timer.
I realized my coding days were already about sprints and chill out. The more I get into a project for a long time, the less time I spend in sprints.
So what I do now is to ask myself : "what important thing can I do in an hour?". If it's just a part of a feature, not releasable by itself, that's ok, provided I feel there's some kind of unity in it. When I've decided something, I don't start my timer just yet, but read codebase, think of an implementation path, wonder about side effects. And when I'm sure, I'll start the timer and go coding.
Sometime, it will takes less than an hour, sometime it'll take more. I try to stick to an hour but I don't make it a strict rule I should absolutely observe. But this feeling of constraint allows me to focus more, and not to feel guilty / in the urge when I'm between two sprints and I chat with colleagues.
Doing so, I've went for an average of 2 or 3 sprints a day to 4 or 5. That's a win.