Another two methods
1.
If Directory mode supported Shift-numpad-minus, then a macro like this could be used after sWitching to directory mode, go into the "file" window and Tagging the directories you want to keep visible.
STOP_IF_FMODE
STOP_IF_DW
STOP_IF_NOTAGS
CTRL_I,t
STOP_IF_NOTAGS
CTRL_ENTER
WHILE_NOT_ERROR
STOP_IF_NOTAGS
NUM-
2.
This method works with the existing ZTree, but touches the directories that need to be hidden, which may not be wanted.
sWitch to directory mode
Enter into the file window
Tag the directories you want to keep visible
Ctrl-I,t
Ctrl-A,+h
Alt-F10,2,j to get to one of the options with H
F3 to save the config
Esc to the Directory window
sWitch back to file mode
F3 to refresh
do your work
At the end, unhide the directories
Alt-F10,2,j=None
F3
sWitch
Enter into the "file" window
Alt-Tag,a,+h
Ctrl-A,-h
Ben