Definition: Yak shaving refers to a situation where you need to solve a problem, which may seem frivolous, but is necessary so you can solve a problem, so you can solve a problem, so you can solve a problem, so you can solve the actual problem you set out to solve in the first place.
The number of levels of recursion are not important, but I’d say anything less than 3 does not even qualify as yak shaving. Sometimes it is possible to end up in a recursive loop such that without backing out and making a new start you will never accomplish the intended task.
Example: I need to patch a database with the latest patchset from Oracle. First I need to download it from Oracle. To do that I need an account there. I have forgotten the password to my account so I need to make a new one. When I try to make a new one it tells me there is already an account with my email address. Now I need to find out our account representative’s name so I can have them reset my password. Since we’re part of a larger university system I need to call the DBA who handles our accounts, and of course I don’t know who they are so I have to ask around to get that. Then I call the DBA who handles our Oracle contract and they give me the contact information for our Oracle sales rep. I call them and they say they cannot help me because I am not on their records as the contact person for our contract. I then have to call the system level person back and talk them into calling the rep themselves… etcetera.
Origin: The term Yak Shaving is generally considered to be a reference to a Ren and Stimpy short called “Yak Shaving Day”. For a full explanation of Yak Shaving Day, check out this Wikipedia entry on the subject.