The solution to this is a Purcell Prussik, that looks like this,
It's a cordelette tied into a loop with a double fisherman's, and then looped back with a prussik to itself. See here for how to tie one.
If I need more slack, I reach up and pull the prussik towards myself, if I need to go shorter I push it up towards the anchor.
It is important that the loop with two strands goes to the climber, as otherwise, you **** without climbing back to the anchor when it is fully extended.
The other thing to note is that the double fishermans won't go through the prussik, so you want it as close to the side that goes to the anchor as possible but not directly on it.
Finally note that this should only be used with a cordelette made out of nylon cord and will not work with a cordelette made from dyspectra/dyneema or a webbing as it will likely slip.
If you need to shorten one, you can tie a figure eight on bight on the part of the cordelette that goes to the anchor and clip the bight to the anchor.
Close up of the prusik,