How to Prevent the Tozi/São Paulo Pass
The Tozi pass (with the underhook, also often called the Wilson pass or the São Paulo pass) can be incredibly difficult to deal with against a good practitioner. All of a sudden, common "best practices" of the guard no longer seem to work, as your partner has willingly compromised their own posture. However, a good understanding of the mechanics of the pass itself can go a long way toward developing effective counters, and this is true across all of jiu jitsu. Here are a few solid ways to deal with this style of passing the guard.
It's important to keep in mind the general "order of operations" for the guard passer here. Generally, they'll get an underhook first, then drop their hips back and then to the side. It is during this phase, immediately following the underhook, that your action needs to begin. As your partner begins to slide off to the side, but before they get a chance to anchor their head in place, use your left hand (assuming they are underhooking with their right arm) to redirect their head to the other side of their body. Once you have stopped their head from being able to plant on your left side, you need to use your hips to create the remainder of the distance here, ultimately shooting to get roughly perpendicular with your partner. Swap your left hand out for your right, focusing on the back of your partner's head staying down. From here, a straightforward omoplata set up avails itself. Even if the omoplata set up isn't 100% successful here, your partner will have to address the threat by centering, and will ultimately nullify their attempt to pass.
Side Sweep Option
There are times when your partner's head is simply planted and unable to be moved. In this case, it's best to wait for your partner to attempt to open your legs. As they switch their hips and reach back for your shin, they are typically going to off-balance themselves in a very subtle way. Time this opportunity just right, and switch your hips back to your left (remember that your partner has tilted your hips to your right, much against your wishes). It's important to do this either as your partner is switching their base, or as they are reaching back to open your legs. IN other words, you'll need a little help with this one. While it's probably not realistic to expect to sweep most partners, what is likely to happen is for them to have to readjust and turn to face you. Once their hips square away, you are back to the center, and there's no longer an imminent threat for a guard pass.
Butterfly Half Option
In the course of attempting to counter, you've missed your first two opportunities: the head redirection (into a potential omoplata), and the hip switch movement (into a possible side sweep). Your partner's base and posture is simply too solid here, and it's a foregone conclusion that they are going to advance past your closed guard. However, this doesn't mean the guard maintenance game is over, not by any stretch. As your legs are about to be opened, concede this point by aiming for butterfly half guard. Grab your partner's belt with your left hand, and block their knee from advancing too far up your body with your left hand. Use these dual frames to angle your hips even further out, and then insert your left butterfly hook as your partner opens your legs up. Keep the half guard hook behind their leg.
Close or far passing?
The Tozi/São Paulo pass has certainly evolved over the years, but it has always been formidable at even higher levels of BJJ competition. Nowadays, there's a counter to the counter to the counter for virtually every move in jiu jitsu, largely thanks to the connectivity provided by the Internet and a thoroughly connected, obsessed jiu jitsu community. This move is no different, but there is a great deal of value in combing through old school techniques, wherein the counters might not be as well known. At any rate, everything moves through popularity in cycles, and you'll likely see today's old school moves become in vogue once again, and vice versa. Stay vigilant and keep working on improving your overall vocabulary on the mats, and you can pick which era you wish to draw from.