Those who can, do. Those who can't, open an issue about the code of conduct.
And it kinda sorta works.
That’s not saying that CoCs were not a kind of response to some pathological behaviors in online communities: you often are going to get either socially inept man-children, or people on the spectrum, and there are kindergarten-level conflicts. You get programmers who attach themselves to their work too much, have very strong opinions, and often will treat a set of rules as a puzzle you need to game, without much concern towards any consequences.
But my oh my, do lots of popular CoCs look like solution for that problem invented by the same kind of socially inept man-children who are the part of the problem. They likely have read the word “empathy” in a dictionary, but don’t understand what it means in their bones.
I have an even less charitable theory of what CoCs might be about, really, but for now I’m applying Hanlon’s razor and stick to what I’ve stated above.
Be direct. No bullshit. Don't worry about offending anyone, including the project leader; just say what needs to be said about the technical merits of whatever is being discussed. We're all here to [insert project goal]; let's do so with a minimum of drama.
But it's probably better to continue to not have a CoC, and just quietly lead by example instead.