If displayed text(i.e. folder name) is unique among items in the same tab bar, just show that
If the folder name is not unique, show the path of the folder up to the point where it’s unique
If the folders are ~/Projects/artoo/images/oryp2 and ~/Projects/artoo/videos/oryp2, show the tab names as images/oryp2 and videos/oryp2.
If the folders are ~Projects/artoo/images/oryp2/optimized and ~/Projects/artoo/videos/oryp2/optimized, the tabs might show images/oryp2/optimized and videos/oryp2/optimized respectively.
The truncation/ellipsis rules of the HIG should apply; I believe the middle of the tab name should be truncated since the beginning and end of the string are most likely to be unique.
This convention puts the unique, distinguishing factors up front while also keeping the standard convention of / separation for directories.
A tooltip should reveal the full path(relative to the home directory if relevant), i.e. ~/Projects/artoo/images/oryp2/optimized in the previous example.
How it’s done elsewhere
Atom
Shows duplicate name, then unique part, separated by spaces and an em dash. This keeps the filename first, but shows the path using a weird, nonstandard separator.
Website Title Tags
Most websites have standardized on Page Name - Site Name or something similar. In this context, this is to help distinguish between multiple pages of the same site. The unique part of the Title is the page name, so it is displayed first(and is less likely to be lost in truncation).
How it’s done elsewhere
Atom
Website Title Tags