# Dirac Lagrangian under charge conjugation

I am trying to understand why the Dirac Lagrangian is invariant under charge conjugation.

The Dirac Lagrangian is:

$$\mathcal{L} = i\bar{\psi}\gamma^\mu \partial_\mu\psi - m \bar{\psi}\psi$$

I know that under charge conjugation the flowing formulas are correct:

$$\hat{C} \, \bar{\psi}\psi \, \hat{C} = +\bar{\psi}\psi, \\ \hat{C} \, \bar{\psi}\gamma^\mu\psi \,\hat{C} = -\bar{\psi}\gamma^\mu\psi, \\ \hat{C} \, \partial_\mu \,\hat{C} = \partial_\mu \\$$

Therefore:

$$\hat{C} \, \mathcal{L} \,\hat{C} = \hat{C} \, i\bar{\psi}\gamma^\mu \partial_\mu\psi \,\hat{C} - \hat{C} \, m \bar{\psi}\psi \,\hat{C}$$ Where $$\hat{C} \, i\bar{\psi}\gamma^\mu \partial_\mu\psi \,\hat{C} = i\hat{C} \, \bar{\psi}\gamma^\mu \hat{C} \hat{C} \,\partial_\mu\psi \,\hat{C} = i\hat{C} \, \bar{\psi}\gamma^\mu \hat{C} \partial_\mu \hat{C} \,\psi \,\hat{C}$$

And because $$\partial_\mu$$ commutes with all $$\gamma^\mu$$ we use the same calculations as in $$\hat{C} \, \bar{\psi}\gamma^\mu\psi \,\hat{C} = -\bar{\psi}\gamma^\mu\psi$$ and get:

$$\hat{C} \, i\bar{\psi}\gamma^\mu \partial_\mu\psi \,\hat{C} = -i\bar{\psi}\gamma^\mu \partial_\mu\psi$$

Therefore overall:

$$\hat{C} \, \mathcal{L} \,\hat{C} = -i\bar{\psi}\gamma^\mu \partial_\mu\psi - m \bar{\psi}\psi \neq \mathcal{L}$$

What am I missing?

Note that charge conjugation interchanges the anticommuting $$\bar \psi$$ and $$\psi$$, so after conjugation by $$\hat C$$ the $$\partial_\mu$$ acts on the $$\bar\psi$$, and needs a sign-changing integration by parts.
In detail: $$\hat C \psi \hat C^{-1}= {\mathcal C}^{-1}\bar\psi^T\\ \hat C \bar \psi \hat C^{-1} = - \psi^T {\mathcal C}$$ where the $${\mathcal C}$$ matrix obeys $${\mathcal C}\gamma^\mu {\mathcal C}^{-1}= -(\gamma^\mu)^T.$$