Diskwarrior still even two decades and change later is a lifesaver. I found my work Time Machine HDD had become corrupted, and Apple's disk utility couldn't fix it. However, I received a "Directory must be rebuilt from a recovery disk because of MacOS security restrictions" error from Diskwarrior. Fear not, you do not need to do this. Under 10.14+, you'll need to grant it the proper permissions.
Step 1: Open the Security and Privacy panel in System Preferences
Go to the Security & Privacy Preference pane in the System Preferences, and click the Privacy tab. Scroll Down on the left-hand side to Full Disk Access.
Step 2: Unlock and click the Plus button
You'll need to click the Unlock button and enter your password to ungrey out the +/- buttons. Once you've entered your password, click the + button as pictured.
Step 3: Locate Diskwarrior and add it
By default, Diskwarrior will install into the Applications folder, locate it (or where you store your copy of Diskwarrior) and click open.
Once you've completed this, you should see Diskwarrior in the Full Disk Access list.
Congrats, relaunch Diskwarrior, and you should be able to use Diskwarrior. Fair warning, Time Machine repairs can take hours and a lot of RAM.