In the past I myself did the same. And with time I became concerned by the rightness of this (what I now call) bat habit of mine.
Unfortunately, I still do it. Not as intense as in the past but sometimes, without intent I wake-up at four in the morning still coding. Maybe a new feature (which I start at midnight after I end a project for some client) or maybe a small project about which I think is best if I get it done fast and by doing this, it will give me time to focus on the big projects.
What I saw along the path is that this disrupts my work-flow which is, at the end I find myself tiered and unable to focus as when I work with self-discipline.
My fix about this is not full proof but this is what I recommend you do:
- Dedicate time for work from early in the morning (five or six o'clock) until mid day. Take a break of two or more hours and start again. At six or seven o'clock in the afternoon stop and use the time for leisure, learning, family, personal time.
- Be patient. If you think the project can be ready in five days, inform your client that the best you can do are seven days.
- Start working at two features (if is feasible) at a time. At one of them in the morning, at the other in the afternoon. Even if you don't finish the first one in the morning, leave it for the next day.
Why I think working three days in a row is bad?
After making some adjustments (I still work on my self-discipline from this point of view) I got more time to spend with the loved one and this gave me more quality time dedicated to my work. Moreover, I start seeing things from another perspective and with time, from three skills I arrived to six and I also am on the road of getting a degree. What else changed was the number of clients. With time and experience I saw they expect me to deliver not sooner than a week or so and this allowed me to dedicate time thinking at other things (one of them: "to search after another clients while I work for the others")
For now, it can be OK what you do but on the long run I know is a very bad habit (with negative effects on you, your work and personal life) which I think you need replace with self-discipline and of course, with some good habits starting as right from this moment.