There is a reason that tension in a rope is so confusing. It is because, in reality, the entity we call tension is not a scalar quantity, nor is it a vector quantity. It is a second order tensor, related directly to the so-called stress tensor in the material. Here's how it all plays out mathematically:
Suppose you have a rope under tension laid out from left to right, and let ##\vec{i}## represent the unit vector pointing from left to right along the rope. Then the second order tension tensor for the rope is given by ##\vec{T}=T\vec{i}\vec{i}##, where T is the magnitude of the tension tensor (a scalar). Suppose you have a cross section at a given location along the rope and you want to find the tension force (vector) that the portion of the rope to the right of the cross section is exerting on the portion of the rope to the left of the cross section. To do this, you take the dot product of the tension tensor ##\vec{T}## with of a unit vector drawn from the left of the cross section to the right of the cross section:
$$\vec{T}\centerdot \vec{i}=T\vec{i}\vec{i}\centerdot \vec{i}=T\vec{i}(\vec{i}\centerdot \vec{i})=+T\vec{i}$$
Next, suppose you want to find the tension force (vector) that the portion of the rope to the left of the cross section is exerting on the portion of the rope to the right of the cross section. To do this, you take the dot product of the tension tensor ##\vec{T}## with of a unit vector drawn from the right of the cross section to the left of the cross section:
$$\vec{T}\centerdot (-\vec{i})=T\vec{i}\vec{i}\centerdot (-\vec{i})=-T\vec{i}(\vec{i}\centerdot \vec{i})=-T\vec{i}$$
Doing the math in this way guarantees that you always get the correct sign for the tension force (vector).
Another entity which is also causes confusion for these same reasons is pressure. The pressure tensor is the "isotropic part" of the stress tensor, and can be represented mathematically by:
$$\vec{P}=P(\vec{i}_x\vec{i}_x+\vec{i}_y\vec{i}_y+\vec{i}_z\vec{i}_z)$$ where P is the scalar magnitude of the pressure tensor. See what happens if you dot this tensor with a unit vector (perpendicular to an area element) in an arbitrary direction. This is how the present mathematical formalism automatically satisfies the condition that the pressure at a given location in a fluid acts equally in all directions.
Chet