Don't have a perfect answer for you here, but I would recommend you check out a book called "Deep Work" by Cal Newport. The book is primarily concerned with focus and how to get more out of it. It's backed by both anecdotes and research. I think you would find it interesting given your question.
With that said, I'm not sure it's "possible" to do cognitively demanding tasks for 6 hours in a row with a 5 minute break after the 4th hour. At work I notice that my coworkers and I have a difficult time focusing intensely after 2 or 3 hours. There comes a point when all you get are diminishing returns. At that point I find it useful to switch tasks completely for an hour or so, to something less cognitively demanding, like administrative things I have to do as an employee.