I have been working in a team with 3 other developers, reporting to a tech lead who departed as of very recently. Afterwards, we started reporting to the most senior teammate who was promoted to fill his role.
Within a couple weeks, I was pulled into a one-on-one about my low performance for a couple of recent items, and I have been target of what I am seeing as hostile behavior ever since i.e. frequently getting nitpicked on our public chats for day-to-day conflicts in development like breakages in the dev environment or code style issues in a way out of ordinary and singling me out, mentions of slow work during daily stand-ups, withholding information about configuration for deploying new components and forcing me to seek help publicly before doing it personally etc.
In response, I started automating my role by developing some tooling to replace a lot of the time-consuming work with some promising results, in an attempt to have a bargaining chip with the next level of management who had been voicing complaints about the slow pace of development in the organization. Meanwhile I was put in charge of a whole feature with promises of no interference by the said manager, although likely as a set-up, giving me a good opportunity to put this to test.
After disclosing what I was doing, maybe mistakenly, the hostility I was facing immediately intensified with the manager telling me to "not work on it", and nitpicking me on even smaller minute details (breaking the older 'no-interference' promises) like code styling during stand-ups framed in an extremely negative way as opposed to keeping it contained to text chats. In the end this may work out further in my favor assuming I am not too heavily impacted by these hinderances and keeping them documented, but I am lost on how to respond to overt hostility (especially in a team it is completely out of ordinary) to prevent the negative sentiment from spreading or putting myself under even more stress.
What are some good ways I can at least speak out when incidents like this happen, especially when they are mostly based on small technicalities or differences in opinion?