Yak shaving is a symptom
You sit down to fix a typo. To fix the typo you need to rebuild. To rebuild you need a newer version of a tool. That tool needs a config file that does not exist yet. Three hours later you are writing the config file, and the typo is still there. That chain is not just a funny story to tell at standup, it is diagnostic information about the project.
What yak shaving actually is
Yak shaving is doing task B so you can do task C, so you can do task D, so you can finally do task A, the one you actually wanted. Every step in the chain is real work, and every step is also a detour. The name makes it sound absurd on purpose, but the absurdity is the point: nobody designed this path, it just accreted.
Every yak is a missing affordance
Each detour exists because something that should have been easy was not. A script that should exist and does not. A default that should be sane and is not. A dependency that should be pinned and floats instead. The yak is never the real obstacle, it is the visible mark left by a missing affordance that nobody has built yet.
The chain length is a metric
A one-step chain is friction. A five-step chain is a signal. If getting from "I want to fix a typo" to "I fixed the typo" takes five unrelated detours, count them. That number tells you more about the health of the project than most dashboards do, and it costs nothing to track: just notice how many yaks you shaved before you got anywhere.
When to shave anyway
Sometimes you do not have time to fix the missing affordance, you just need the typo fixed today. That is fine. Shave the yak, ship the fix, move on. The mistake is not shaving when you have to, it is forgetting the shave ever happened once the pressure is off.
Write the yak down
Before you close the tab, write down what you shaved and why it was necessary. A ticket, a line in a doc, a comment near the offending config. Not to complain about it, but so the next person (probably you) can see the pattern building up. A chain nobody writes down just repeats itself, one detour at a time, forever.