Yak shaving is the name hackers give to the chain of distractions that stand between you and the thing you meant to do. The Jargon File defines it as “any seemingly pointless activity which is actually necessary to solve a problem which solves a problem which, several levels of recursion later, solves the real problem you’re working on.” You sit down to fix one bug and find yourself, hours later, configuring a tool you have never used to compile a library you did not know you needed.
The classic illustration runs as a cascade. You want to wax your car, but the hose is broken, so you need a new hose, but the hardware store requires a membership card you lent to a neighbor, who borrowed it because of something involving a pillow, which leads, by a long chain, to needing some yak hair, which means you end up at the zoo shaving a yak. None of those steps has anything obvious to do with waxing a car, yet each is a genuine prerequisite for the one before it.
The Jargon File records that the term originated at the MIT AI Lab, and dates its coinage to after the year 2000, noting it probably derives from a “Ren and Stimpy” episode involving a literal yak. That places yak shaving among the newer additions to the lexicon, a reminder that hacker slang keeps growing as long as the culture does, and that even a maintained reference work documents its entries’ origins where it can.
What makes the term useful is that it names a specific and very common experience precisely. It is not the same as ordinary procrastination, where you avoid the real work; in yak shaving every individual step really is necessary, which is exactly what makes it so frustrating and so hard to stop. The recursion is the whole point: each task spawns a prerequisite, and you only get to climb back up the stack once the deepest, most absurd-seeming chore is finished.
Because it captures something every programmer recognizes, yak shaving has spread well beyond the lab where it was coined. To announce that you are “shaving a yak” is to acknowledge, with a degree of self-deprecating humor, that you have descended several levels away from your actual goal and may be there for a while. Like much of the vocabulary preserved in the Jargon File, it turns a shared annoyance into a shared joke.