Let $(M,g)$ be a Riemannian manifold and $X$ a non-vanishing parallel vector field, i.e. $\nabla_XX=0$. Let $${\cal A}_X:=\{T\in\ ^1_1\!\otimes(TM)\,|\ T(X)=0\}.$$
It is easy to see that ${\cal A}_X$ is a vector space. Also if $T\in {\cal A}_X$ then $\mathscr{L}_X T \in {\cal A}_X$ and $\nabla_X T \in {\cal A}_X$ where $\mathscr{L}_X$ is Lie derivative along $X$. Suppose $Q$ denote the Ricci operator defined by $g(QY,Z)=Ric(Y,Z)$. If $QX=\lambda X$ for some smooth function $\lambda$, I think $Q$ can be written as follow: $$Q=aI+b\omega\otimes X+\sum_ic_iT_i,\quad T_i\in {\cal A}_X,\,a,b,c_i\in C^\infty(M,\Bbb R),\, \omega=g(X,.)$$
Is this conclusion correct? Can anyone give a simple proof?
What we can say about $\dim({\cal A}_X)?$
Thanks in advance
Let's cover the linear algebra first.
Let $(V,g)$ be a finite dimensional real inner product space and $v \in V$ be a non-zero vector. We have a direct sum decomposition $V = \operatorname{span} \{ v \} \oplus \operatorname{span} \{ v \}^{\perp}$. Denote the projection onto the first factor by $P_1$ and onto the second factor by $P_2$. We have $P_1 + P_2 = I$, $P_1 P_2 = P_2 P_1 = 0$ and we can write an explicit formula for $P_i$ as
$$ P_1(w) = \frac{g(v,w)}{g(v,v)} v, \,\, P_2(w) = w - P_1(w). $$
If we denote by $\omega_v \colon V \rightarrow \mathbb{R}$ the linear functional $\omega_v(w) = g(v,w)$ then the formula for $P_1$ can be written as $P_1 = \frac{1}{g(v,v)} \omega_v \otimes v$. Given a linear map $Q \colon V \rightarrow V$, set $Q_i := Q \circ P_i$ so that we have $Q = Q_1 + Q_2$. Since $P_2(v) = 0$, we have $Q_2(v) = 0$ so we decomposed $Q$ into a sum of two linear maps with the second vanishing on $v$. If $v$ is an eigenvector of $Q$ with eigenvalue $\lambda$, we have
$$ Q_1(w) = Q(P_1(w)) = Q \left( \frac{g(v,w)}{g(v,v)} v \right) = \frac{\lambda}{g(v,v)} g(v,w) v = \frac{\lambda}{g(v,v)} (\omega_v \otimes v)(w) $$
so we have
$$ Q = \frac{\lambda}{g(v,v)} \omega_v \otimes v + Q_2 $$
where $Q_2$ vanishes on $v$.
Returning to the global case you ask about, we can write
$$ Q = \frac{\lambda}{g(X,X)} \omega_X \otimes X + Q_2 $$
where $Q_2 \in \mathcal{A}_X$. This has nothing to do with the fact that $X$ is parallel along its integral curves, or that $Q$ is the Ricci tensor. The only thing one needs to know is that $X$ is a non-vanishing vector field and $Q$ is a $(1,1)$ tensor such that $Q(X) = \lambda X$ for a smooth function $\lambda \colon M \rightarrow \mathbb{R}$.
Regarding your question about the dimension of $\mathcal{A}_X$, given a non-zero vector $v \in V$, the space of linear maps $T \colon V \rightarrow V$ which satisfies $Tv = 0$ is an $n^2 - n$-dimensional subspace of $\operatorname{End}(V)$ (where $n = \dim V$). The space $\mathcal{A}_X$ is the space of sections of an $n^2 - n$-dimensional subbundle of $T^{*} M \otimes TM$ (where $n = \dim M$) whose fiber at $p$ is the space of linear maps $T \colon T_pM \rightarrow T_pM$ which satisfy $T(X_p) = 0_p$. Hence, it is infinite dimensional (unless $n = 0$). Again, this has nothing to do with metrics, the Ricci tensor, etc.