I would recommend looking into org-mode for task-based time tracking and documentation (probably using org-capture), it's one of the basic use cases.
I often see it recommended and I like the idea of a light-weight tracker (since I mainly use a .txt document now) - but whenever I read about org-mode it just sounds like a markup language and I know I am missing the powerful part of it.
Personaly I'm using VimOrganizer, which is a plugin for vim with some orgmode commands. I'm looking at the newer nvim orgmode as well. To check in in a task, i type ,ci for clocking. When I'm done, I type ,co for clocking out. This add a clock line to the node where the command is done.