It seems to me that there is no place for a priori knowledge in the Tractatus (quoting from Pears/McGuinness translation).
Some basic concepts are : form, possibility, picture.
3 A logical picture of facts is a thought.
Here I read "thought" in a Fregean way, as "thought content" (and not as an act of the mind).
A picture can represent reality in virtue of its (logical or pictorial) form (2.17).
2.11 A picture presents a situation in logical space, the existence and non-existence of states of affairs [see also 2.202].
Thus, we have thoughts that "represent" possible situations [their sense; see 2.221] and true thoughts that represent "actual" situations: facts (2.222 and 3.01).
2.225 There are no pictures that are true a priori.
3.04 If a thought were correct a priori, it would be a thought whose possibility ensured its truth.
This is reminiscent of the well-known ontological arguments: a concept (or thought) that "analytically" entails the existence of an object that falls under the concept; whose possibility implies its actuality.
3.05 A priori knowledge that a thought was true would be possible only if its truth were recognizable from the thought itself (without anything to compare it with).
Thus, it seems that there are no a priori truth.
5.133 All deductions are made a priori.
This fits with the "tautological" nature of logic: logic "transform" but not "produce" truth and knowledge [see also: 5.4731 What makes logic a priori is the impossibility of illogical thought.]
5.134 One elementary proposition cannot be deduced from another.
I.e. there is no knowledge by "logic alone" of the contingent facts of the world. See also :
5.557 The application of logic decides what elementary propositions
there are. [...]
5.5571 If I cannot say a priori what elementary propositions there are, then the attempt to do so must lead to obvious nonsense.
Now for the cogito: in Descartes it is not a deduction but an intuition. If so, it must be modelled in Tractarian's philosophy as an elementary proposition, that cannot be deduced from another.
If it is true, it is so by way of its picturing a fact.
But a picture is always contingent: there are no a priori pictures.
Thus, it can be (at most) the "empirical" recognition of a contingent fact.